Skip to content
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

Special keys not recognized behaves like backspace in windows (switch fall through) #111

Closed
Xenoamor opened this issue May 4, 2021 · 0 comments
Assignees

Comments

@Xenoamor
Copy link

Xenoamor commented May 4, 2021

case 224: // symbol
{
c = _getch();
switch (c)
{
case 72:
return std::make_pair(KeyType::up, ' ');
break;
case 80:
return std::make_pair(KeyType::down, ' ');
break;
case 75:
return std::make_pair(KeyType::left, ' ');
break;
case 77:
return std::make_pair(KeyType::right, ' ');
break;
case 71:
return std::make_pair(KeyType::home, ' ');
break;
case 79:
return std::make_pair(KeyType::end, ' ');
break;
case 83:
return std::make_pair(KeyType::canc, ' ');
break;
}
}

Not sure if this is intentional or not but if switch (c) does not have a matching case then it will fall through as there's no outside break statement which will cause it to trigger a backspace with case 8

@daniele77 daniele77 self-assigned this May 5, 2021
@daniele77 daniele77 changed the title Possible switch fall through Special keys not recognized behaves like backspace in windows (switch fall through) May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants