New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows 10 April 2018 release breaks _getch #1113

Closed
wwiv opened this Issue May 2, 2018 · 3 comments

Comments

Projects
None yet
1 participant
@wwiv
Contributor

wwiv commented May 2, 2018

It looks like windows 10 10.0.17134 DLL version (aka build 1803, aka april 2018 release) _getch is broken

It doesn't return 0 then the extended key reliably anymore, it returns 0 then the ascii key value, looks like they try to handle mbcs in it and don't do it right for non wide char apps

@wwiv

This comment has been minimized.

Contributor

wwiv commented May 2, 2018

testcase:

#include <iostream>
#include <conio.h>

int main()
{
  int i = 0;
  for (;;) {
    auto c = _getch();
    std::cout << i++ << ": " << c << std::endl;
    if (c == 27) break;
  }
    return 0;
}

On 10.0.17134:

0: 97
1: 115
2: 100
3: 102
4: 27

On 10.0.16299

0: 97
1: 0
2: 115
3: 0
4: 100
5: 0
6: 102
7: 0

wwiv added a commit to wwiv/wwiv that referenced this issue Jun 3, 2018

Use _getwch vs. _getch
We don't care what we enter locally since we're using cp437 terminals,
so this would work around wwivbbs#1113
@wwiv

This comment has been minimized.

Contributor

wwiv commented Jun 5, 2018

Workaround the issue and I think the workaround is good enough to leave it in

@wwiv wwiv closed this Jun 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment