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

CANARY: ALT+NUMPAD ADD is Broken #17762

Open
Zeroes1 opened this issue Aug 21, 2024 · 10 comments · Fixed by #17774
Open

CANARY: ALT+NUMPAD ADD is Broken #17762

Zeroes1 opened this issue Aug 21, 2024 · 10 comments · Fixed by #17774
Assignees
Labels
Area-Input Related to input processing (key presses, mouse, etc.) In-PR This issue has a related PR Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal.

Comments

@Zeroes1
Copy link

Zeroes1 commented Aug 21, 2024

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 Zeroes1 added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Aug 21, 2024
@Zeroes1
Copy link
Author

Zeroes1 commented Aug 21, 2024

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...

@carlos-zamora carlos-zamora added Area-Input Related to input processing (key presses, mouse, etc.) Product-Terminal The new Windows Terminal. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Aug 21, 2024
DHowett added a commit that referenced this issue Aug 22, 2024
We were erroneously eating Alt followed by VK_ADD. This change makes
sure we cache key presses and releases that happen once a numpad
composition is active so that we can send them when you release Alt.

Right now, we only send them when you release Alt after composing Alt
and VK_ADD (entering hex mode) and only if you haven't inserted an
actual hex numpad code. This does mean that `Alt VK_ADD 0 0 H I` will
result in an input of "+hi". That... seems like a small price to pay for
Alt VK_ADD working again.

Closes #17762
@microsoft-github-policy-service microsoft-github-policy-service bot added the In-PR This issue has a related PR label Aug 22, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Tag-Fix Doesn't match tag requirements label Aug 23, 2024
DHowett added a commit that referenced this issue Aug 23, 2024
We were erroneously eating Alt followed by VK_ADD. This change makes
sure we cache key presses and releases that happen once a numpad
composition is active so that we can send them when you release Alt.

Right now, we only send them when you release Alt after composing Alt
and VK_ADD (entering hex mode) and only if you haven't inserted an
actual hex numpad code. This does mean that `Alt VK_ADD 0 0 H I` will
result in an input of "+hi". That... seems like a small price to pay for
Alt VK_ADD working again.

Closes #17762

(cherry picked from commit e006f75)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgSF50M
Service-Version: 1.21
@Zeroes1
Copy link
Author

Zeroes1 commented Aug 25, 2024

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

@DHowett
Copy link
Member

DHowett commented Aug 26, 2024

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

@Zeroes1
Copy link
Author

Zeroes1 commented Aug 27, 2024

@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
Copy link
Member

lhecker commented Aug 27, 2024

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
Copy link
Author

Zeroes1 commented Sep 16, 2024

@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
Copy link
Author

Zeroes1 commented Sep 16, 2024

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
Copy link
Member

lhecker commented Sep 16, 2024

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

@lhecker lhecker reopened this Sep 16, 2024
@lhecker lhecker self-assigned this Sep 16, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs-Tag-Fix Doesn't match tag requirements label Sep 16, 2024
@HamRusTal
Copy link

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

@lhecker
Copy link
Member

lhecker commented Sep 16, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Input Related to input processing (key presses, mouse, etc.) In-PR This issue has a related PR Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal.
Projects
Status: Cherry Picked
Development

Successfully merging a pull request may close this issue.

5 participants