You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ALT+ENTER will cause the subsequent keystroke to get swallowed #28
If the user presses ALT+ENTER, the keystroke after will be swallowed. It seems to have something to do with this commit: Bill-Gray/PDCurses@84db661
I don't understand the inner workings of key handling enough to suggest an elegant solution, but I seem to be able to work around it by ALSO remembering the last keycode that was processed, i.e:
static bool key_already_handled = FALSE;
static int last_key_handled = 0; /* added this */
However, (1) it feels dirty, and (2) I have a feeling it may re-introduce the original bug. I don't currently have a keyboard with a numpad handy to test it out.
Yup, that's a bug... same misbehavior here, in both 'newtest' and 'testcurs'. Thanks for pointing this out.
Unfortunately, the key-handling code has gathered a lot of barnacles, to the point where the way it works is no longer all that obvious to me, even though I wrote some of it (much was recycled from Win32 console, as I recall.) I'll give it a look-over... unfortunately, it may be a while; the "day job" is heating up a bit.
Figured it out. Marking key_already_handled = TRUE is necessary for the pad-multiply, sub, div, add, and Enter keys... unless Alt is held down. It wasn't just Alt-Enter that was messed up; it was Alt-all of those keys. (Except Alt-Padplus, which is used for Unicode entry and was handled elsewhere anyway.)
Hit any of those four Alt-Pad keys, and key_already_handled was set to TRUE... but no extra character was sent to be ignored. Instead, the next key hit was ignored.
Activity
Bill-Gray commentedon Mar 15, 2017
Yup, that's a bug... same misbehavior here, in both 'newtest' and 'testcurs'. Thanks for pointing this out.
Unfortunately, the key-handling code has gathered a lot of barnacles, to the point where the way it works is no longer all that obvious to me, even though I wrote some of it (much was recycled from Win32 console, as I recall.) I'll give it a look-over... unfortunately, it may be a while; the "day job" is heating up a bit.
Work around for https://github.com/Bill-Gray/PDCurses/issues/28
GitMensch commentedon Dec 24, 2018
@Bill-Gray Do you see clangen@a4a5ec7 fixing this and may merge + close this issue?
Fix for issue #28 : if one of those five keys is hit with Alt pressed…
Bill-Gray commentedon Dec 27, 2018
Figured it out. Marking
key_already_handled = TRUEis necessary for the pad-multiply, sub, div, add, and Enter keys... unless Alt is held down. It wasn't just Alt-Enter that was messed up; it was Alt-all of those keys. (Except Alt-Padplus, which is used for Unicode entry and was handled elsewhere anyway.)Hit any of those four Alt-Pad keys, and
key_already_handledwas set to TRUE... but no extra character was sent to be ignored. Instead, the next key hit was ignored.