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

Remaps incorrectly if I change keyboard layout #31042

Closed
haraldpost opened this issue Jan 19, 2024 · 12 comments
Closed

Remaps incorrectly if I change keyboard layout #31042

haraldpost opened this issue Jan 19, 2024 · 12 comments
Labels
Issue-Bug Something isn't working Product-Keyboard Shortcut Manager Issues regarding Keyboard Shortcut Manager Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@haraldpost
Copy link

haraldpost commented Jan 19, 2024

Microsoft PowerToys version

0.77.0

Installation method

PowerToys auto-update

Running as admin

Yes

Area(s) with issue?

Keyboard Manager

Steps to reproduce

US english kb layout. Remap ` to Esc. Remap Esc to `. Then swap to Norwegian kb layout momentarily.

✔️ Expected Behavior

ø should not be affected by remap of Esc and `.

❌ Actual Behavior

ø and Esc have swapped places. Keypress to Esc gives ø. Keypress to ø gives Esc. It seems ASCII code 96 and 155 somehow are interchanged?

Other Software

No response

@haraldpost haraldpost added Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Jan 19, 2024
@TheJoeFin TheJoeFin added the Product-Keyboard Shortcut Manager Issues regarding Keyboard Shortcut Manager label Jan 19, 2024
@TheJoeFin
Copy link
Collaborator

/bugreport

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Jan 19, 2024
@haraldpost
Copy link
Author

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams Needs-Team-Response An issue author responded so the team needs to follow up and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Jan 20, 2024
@TheJoeFin
Copy link
Collaborator

Keyboard manager remaps keys to other keys, not ASCII to ASCII. This means key ` is key 192 (which is OEM 3 Key) will always be mapped to Escape. Switching languages has no affect on the keys.

This enhancement is being tracked in another issue. So this one will be closed in favor of that issue. Please add your support there.

/dup #6976

Copy link
Contributor

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@microsoft-github-policy-service microsoft-github-policy-service bot added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams Needs-Team-Response An issue author responded so the team needs to follow up labels Jan 21, 2024
@haraldpost
Copy link
Author

haraldpost commented Jan 22, 2024

Keyboard manager remaps keys to other keys, not ASCII to ASCII. This means key ` is key 192 (which is OEM 3 Key) will always be mapped to Escape. Switching languages has no affect on the keys.

This enhancement is being tracked in another issue. So this one will be closed in favor of that issue. Please add your support there.

/dup #6976

I'm not sure we understand each other. I use US english kb layout, enter Keyboard Manager and choose to remap ` to Esc, and Esc to `. I then switch to Norwegian kb layout for some work, and discover that ø is mapped to Esc, and Esc to ø. If I open Keyboard Manager I can see that mapping is changed. ø to Esc, and Esc to ø.

I really don't understand why ø and ` should have anything in common at all. They are not the same key, in fact are at opposite sides of the keyboard.

@TheJoeFin
Copy link
Collaborator

@haraldpost what type of keyboard do you have? From the one log you shared it looked like the key was OEM key 3, which are unique to your keyboard manufacturer. Is it the same physical key on your keyboard?

@haraldpost
Copy link
Author

haraldpost commented Jan 22, 2024

@haraldpost what type of keyboard do you have? From the one log you shared it looked like the key was OEM key 3, which are unique to your keyboard manufacturer. Is it the same physical key on your keyboard?

@TheJoeFin Excuse my ignorance but I don't know what an OEM key 3 is. The keyboard is a Lenovo ThinkPad TrackPoint Keyboard II, norwegian key layout. The ø key replaces the ; key in US english. I just now plugged in my mechanical US english key layout keyboard now and I still have that ø key maps to Esc.

Keyboard_Layout_Norwegian

@TheJoeFin
Copy link
Collaborator

Details on OEM Keys: https://stackoverflow.com/questions/582403/what-are-the-oem-keys-in-the-system-windows-forms-keys-enumeration

It is strange that they keyboard would swap which key is which OEM key.

Just to make sure I understand the problem, is this correct:
image

If you are willing I'd be interested to see what the key codes are reported in the Keyboard Manger. Can you remap ` to A and ø to B then share the settings from the Keyboard Manger either via a bugreport, or by going to your local settings at
c:<user>\AppData\Local\Microsoft\PowerToys\Keyboard Manager\default.json

I don't think PowerToys would be changing the key code when you change keyboard, I suspect there is something going on with the key being reported to PowerToys when the language changes.

@TheJoeFin
Copy link
Collaborator

maybe related to #25368

@haraldpost
Copy link
Author

haraldpost commented Jan 22, 2024

I don't think PowerToys would be changing the key code when you change keyboard, I suspect there is something going on with the key being reported to PowerToys when the language changes.

Yes.

Screenshot 2024-01-22 223322

I switch to norwegian layout, and open PowerToys again (few seconds later).

Screenshot 2024-01-22 223155

@TheJoeFin
Copy link
Collaborator

I understand the symbol changes, but can you provide Keyboard settings before and after language change to know if it is the Keycode changing or the way Windows is reading/reporting the key to PowerToys @haraldpost

@haraldpost
Copy link
Author

haraldpost commented Jan 27, 2024

Just to make sure I understand the problem, is this correct: image

If you are willing I'd be interested to see what the key codes are reported in the Keyboard Manger. Can you remap ` to A and ø to B then share the settings from the Keyboard Manger either via a bugreport, or by going to your local settings at c:\AppData\Local\Microsoft\PowerToys\Keyboard Manager\default.json

I don't think PowerToys would be changing the key code when you change keyboard, I suspect there is something going on with the key being reported to PowerToys when the language changes.

Ok. For this test I first changed to norwegian layout. Then opened PowerToys. It seems I can't find the ` character by pressing the key that you outlined. Pressing Shift+\ key should produce ` character. I confirmed that it does so in Notepad. However, this key combination does not produce ` in PowerToys in the scroll box for key remap. I also cannot find the character manually by scrolling the list... so I am unable to fulfill your request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug Something isn't working Product-Keyboard Shortcut Manager Issues regarding Keyboard Shortcut Manager Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

2 participants