microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
109.8k stars 6.47k forks source link

Re-mapping of keys gets jumbled when multiple keyboard languages are used. #18971

Open tallabomba opened 2 years ago

tallabomba commented 2 years ago

Microsoft PowerToys version

0.59.0

Running as admin

Area(s) with issue?

General

Steps to reproduce

Remap a few keys with keyboard set to ENG Remap the same keys to different keys with keyboard set to SWE Now the mappings are jumbled. Even keys that were not selected have new and wrong mappings.

✔️ Expected Behavior

Being able to have key mappings for each keyboard language (one for THAI, one for ENG, one for SWE, etc)

or (not as useful) having the same hardware key mapped to the same hardware key regardless of keyboard language selected.

❌ Actual Behavior

Key mappings lost, jumbled and changed when multiple keyboard languages are used.

Other Software

No response

jaimecbernardo commented 2 years ago

Can you please send an example of what occurs? Some screenshots might be helpful. We're using Virtual Keys, so if a Virtual Key represents a different key in another language, that might be what you're observing. /needinfo

tallabomba commented 2 years ago

Can you please send an example of what occurs? Some screenshots might be helpful. We're using Virtual Keys, so if a Virtual Key represents a different key in another language, that might be what you're observing. /needinfo Keys1 Keys2 The first image shows three re-mappings entered with the SWEdish keyboard setting. No problems so far. The second image shows what the mappings look like after closing the program, changing to ENGlish keyboard, and starting PowerToys again. The mappings have changed completely, not just the symbols, but even the physical keys that are affected. If I then correct it and change back to SWE keyboard it's all wrong there, and so on.

tallabomba commented 2 years ago

A feature that could be useful, and solve this problem, is to store one mapping per keyboard language installed (3 in my case; THAI, SWE, ENG).

jaimecbernardo commented 2 years ago

/bugreport, so we can try replicating the same settings. A question here is, does the replacement still work? We are manipulating virtual keys here, so if the meaning of the virtual keys change, then it makes sense that the mappings change as well. Is it the case that the backtick character and Ö are the same key in the keyboard but on different layouts?

ghost commented 2 years ago

Hi there!

We need a bit more information to really debug this issue. Can you add a "Report Bug" zip file here? You right click on our system tray icon and just go to report bug. Then drag the zipfile from your desktop onto the GitHub comment box in this issue. Thanks!
Report Bug

Arseni-Paharelau commented 2 years ago

Hi there! Please, let me intervene in this conversation ;)

Is it the case that the backtick character and Ö are the same key in the keyboard but on different layouts?

I'll let tallabomba answer this question but I'm sure this is the case he means, because I have a similar issue and can understand him. Let me describe my case:

My keyboard doesn't contain a separate Numpad section, so I emulate it using the right side of my keyboard with the force of KBM. Here is my shortcut remap list when the ENG layout is active:

ENG

Here is how my remaps look like when I change my layout to RUS (РУС): RUS

I state that, for instance, "K" and "Л" characters are the same physical key but on different layouts. So, here is what happens when I use the same physical key shortcuts but with different layouts: ENG and RUS

ENG layout: 0123456789.+-*/
RUS layout: %№-/":,._?ю+-*/

But it would be nice to have an ability to use my "emulated numpad" regardless of the current active layout. Or at least have an ability to remap the same physical keys for different layouts so that I can always type 0123456789.+-*/ no matter which layout is active (ENG or RUS).

I'm attaching "Report bug" zip file: PowerToysReport_2022-07-17-04-11-26.zip

I guess I understand what you mean by saying: "we're using virtual keys". I hope our case can be resolved somehow in the future. Unfortunately, as of now I still have to use my personal AHK script to satisfy my needs, because it works on any layout. Sharing it here just in case (please, note, I use "CapsLock+Shift" instead of "Win+Alt" here):

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

#Singleinstance force

#If GetKeyState("CapsLock", "T")
<+m::Send,1
<+,::Send,2
<+.::Send,3
<+j::Send,4
<+k::Send,5
<+l::Send,6
<+u::Send,7
<+i::Send,8
<+o::Send,9
<+n::Send,0
<+/::Send,.
<+8::Send,/
<+9::Send,*
<+p::Send,-
<+`;::Send,{+}

Thanks!

ghost commented 2 years ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 5 days. It will be closed if no further activity occurs within 5 days of this comment.

tallabomba commented 2 years ago

I guess I use the wrong terms above. It should probably be "keyboard layouts", not "keyboard languages". Otherwise I think Arseni describes the same bug well above, just a different use case and language pair.