Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Alt-punctuation in plugin key handler

Charles Dye

Super Moderator
May
5,853
217
Staff member
Several of the keys in my EditKeys plugin have stopped working. It appears that many Alt-punctuation combinations return different strings than they used to:

Old Name:New Name:
Alt-;Alt-º
Alt-'Alt-Þ
Alt-Plus (the = key on the main keyboard)Alt-»
Alt-,Alt-¼
Alt-Minus (the - key on the main keyboard)Alt-½
Alt-[Alt-Û
Alt-]Alt-Ý
Alt-Decimal (the . on the main keyboard)Alt-¾
Alt-/ (the slash on the main keyboard)Alt-¿

There may be others; these are just the ones I've found so far. All the funky characters seem to come from the Latin-1 block; I'm guessing that they relate numerically to virtual-key values. It looks like this change began in v35.
 
A few more:

Old Name:New Name:
Alt-\Alt-Ü
Alt-`Alt-À
Alt-Divide (the slash key on the keypad)Alt-o
Alt-* (the asterisk on the keypad)Alt-j
 
I'm seeing these strange values in 35.01.21, 36.01.55, 36.50.61. 34.01.27 returns the expected strings.

Also, other chords which include Alt also return the strange strings. Ctrl-Alt-period gives "Ctrl-Alt-¾", Alt-Shift-period gives "Alt-Shift-¾", and so on. And using the right-hand Alt key instead of the left Alt sometimes gives no string at all, just a key value.
 
Same behavior in Take Command ConPTY tabs, Take Command hidden-console tabs, console windows, Windows Terminal... even ConEmu if you remember that.

I'm interested in the string value returns by ki->pszKey. EditKeys also calls GetAsyncKeyState() a few times to check for weird combinations of shift keys, but I don't think that's relevant. I see the same behavior in other, simpler plugins.

I think somewhere VKEY_* values are getting treated as ASCII — well, Unicode — characters. For example: The apostrophe key, VKEY_OEM_7, has a value of 0xDE. For Alt-apostrophe, TCC is returning a key name of Alt-Þ. The uppercase thorn is Unicode U+00DE.

Here is a much simpler plugin which demonstrates the issue: KTest It just displays the string in ki->pszKey, if there is one, or the value of ki->nKey if not.
 
Back
Top