microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.45k stars 8.3k forks source link

CANARY: ALT+NUMPAD ADD is Broken #17762

Closed Zeroes1 closed 1 month ago

Zeroes1 commented 2 months ago

Windows Terminal version

1.22.2334.0

Windows build number

10.0.19045.4780

Other Software

No response

Steps to reproduce

Alt+NumpadAdd pressing combination is broken since Canary build terminal-1.22.2201.0 terminal-1.22.2191.0 - latest good terminal-1.22.2201.0 - broken ... terminal-1.22.2334.0 - broken

run utilities for getting codes DOWN/UP VK_CODES etc press Alt key after press NumpadAdd and release NumpadAdd, press NumpadAdd and release NumpadAdd, press NumpadAdd and release NumpadAdd

Expected Behavior

terminal-1.22.2191.0 - latest good: 21:42:56 KEY_EVENT_RECORD: Dn, 1, Vk="VK_ADD" [107/0x006B], Scan=0x004E uChar=[U='+' (0x002B): A='+' (0x2B)] Ctrl=0x00000002 (cAsac - ecns) (Windowed) 21:42:56 KEY_EVENT_RECORD: Dn, 1, Vk="VK_ADD" [107/0x006B], Scan=0x004E uChar=[U='+' (0x002B): A='+' (0x2B)] Ctrl=0x00000002 (cAsac - ecns) (Windowed) 21:42:57 KEY_EVENT_RECORD: Up, 1, Vk="VK_ADD" [107/0x006B], Scan=0x004E uChar=[U='+' (0x002B): A='+' (0x2B)] Ctrl=0x00000002 (cAsac - ecns) (Windowed)

Actual Behavior

since terminal-1.22.2201.0 to latest canary build terminal-1.22.2334.0 is broken:

21:44:18 KEY_EVENT_RECORD: Up, 1, Vk="VK_ADD" [107/0x006B], Scan=0x004E uChar=[U='+' (0x002B): A='+' (0x2B)] Ctrl=0x00000002 (cAsac - ecns) (Windowed) 21:44:18 KEY_EVENT_RECORD: Up, 1, Vk="VK_ADD" [107/0x006B], Scan=0x004E uChar=[U='+' (0x002B): A='+' (0x2B)] Ctrl=0x00000002 (cAsac - ecns) (Windowed) 21:44:18 KEY_EVENT_RECORD: Up, 1, Vk="VK_ADD" [107/0x006B], Scan=0x004E uChar=[U='+' (0x002B): A='+' (0x2B)] Ctrl=0x00000002 (cAsac - ecns) (Windowed)

Zeroes1 commented 2 months ago

with another combination I no have problem, only 100% with Alt+NumPadAdd or RAlt+NumpadAdd

if press and release only Alt/Ralt - no problem if press and release only NumPadAdd - no problem

ps. What I found problem : my macros for FAR MANAGER for key="AltAdd" is stop working...

Zeroes1 commented 2 months ago

Hi!, fix implemented in latest canary? i check latest terminal-1.22.2371.0 - problem still exist...

DHowett commented 2 months ago

@zeroes1 I believe there has been a build issue preventing Canary updates. Sorry about that.

Zeroes1 commented 2 months ago

@DHowett , bad news!

I tested terminal-1.23.2391.0 now i see what logic change, but wrong anyway :((((((

test: i press ALT (and hold all time)

I see what generated many events like: 15:20:15 KEY_EVENT_RECORD: Dn, 1, Vk="VK_MENU" [18/0x0012], Scan=0x0038 uChar=[U=' ' (0x0000): A=' ' (0x00)] Ctrl=0x00000002 (cAsac - ecns) (Windowed)

after press NumAdd - any events is stopped, after I press and release NumAdd many times and I see - no any KEY EVENTS!!!

ONLY when I release ALT i see what get ALL chain events in console. It's wrong! (for example I hold ALT 1min)

terminal-1.22.2191.0 - latest good version:

test: i press ALT (and hold all time)

generated many events like: 15:20:15 KEY_EVENT_RECORD: Dn, 1, Vk="VK_MENU" [18/0x0012], Scan=0x0038 uChar=[U=' ' (0x0000): A=' ' (0x00)] Ctrl=0x00000002 (cAsac - ecns) (Windowed)

after press NumAdd i see straightaway event: 15:48:19 KEY_EVENT_RECORD: Dn, 1, Vk="VK_ADD" [107/0x006B], Scan=0x004E uChar=[U='+' (0x002B): A='+' (0x2B)] Ctrl=0x00000002 (cAsac - ecns) (Windowed)

after release NumAdd i see straightaway event: 15:48:19 KEY_EVENT_RECORD: Up, 1, Vk="VK_ADD" [107/0x006B], Scan=0x004E uChar=[U='+' (0x002B): A='+' (0x2B)] Ctrl=0x00000002 (cAsac - ecns) (Windowed)

ALT is holded all times!

or may be not all PR implemented in terminal-1.23.2391.0 ?

ps. Why did the problem with Alt+Numpad appear at all??? and you can't return the code from terminal-1.22.2191.0?

lhecker commented 2 months ago

I added support for EnableHexNumpad which allows you to enter a Unicode character with Alt Numpad+ <hex code of a character>. I also enabled this by default because I thought it would not conflict with anything. I'll consider adding a registry key check for EnableHexNumpad so that it doesn't conflict for you.

Zeroes1 commented 1 month ago

@lhecker any news?

"I'll consider adding a registry key check for EnableHexNumpad"

I try monintoring registry RegQueryValue but no see any help checked canary terminal-1.23.2581.0

Zeroes1 commented 1 month ago

For return old behavior I temporary use Autohotkey v2 script:

;Temporary Fix for Alt+NumPadAdd for Windows Terminal
HotIfWinActive "ahk_class CASCADIA_HOSTING_WINDOW_CLASS"
Hotkey "!NumpadAdd", Temp_Fix

Temp_Fix(HotkeyName)
{ 
  Send "{Alt Down}{NumpadAdd}{Alt Up}"
}
lhecker commented 1 month ago

Ah I'm sorry. I forgot about this issue. I'll reopen it and assign myself so that I don't forget it.

HamRusTal commented 1 month ago

Why should Alt+NumDigits affect the NumAdd at all? Shouldn't only the combinations with digits be affected?

lhecker commented 1 month ago

Alt+NumpadAdd triggers the hexadecimal input of Unicode characters. You can find more information about it if you search for EnableHexNumpad. For instance, typing Alt + NumpadAdd + 221E inserts ∞. Since we need a custom Alt+Numpad implementation, I choose to have EnableHexNumpad always enabled. I didn't realize that this could cause issues.

Zeroes1 commented 1 month ago

@lhecker big thanks! Now work fine! (also registry key - work, where simple users can read about this or this hidden feature?) ps. checked on terminal-1.23.2681.0

lhecker commented 1 month ago

To be honest, I genuinely don't know why EnableHexNumpad isn't publicly documented by Microsoft. Even WikiPedia has an article about it: https://en.wikipedia.org/wiki/Unicode_input#In_Microsoft_Windows Perhaps numpad input just isn't as popular anymore as it used to be, so no one is interested in it?