microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
109.68k stars 6.46k forks source link

Keyboard Manager: failed to map keys #21877

Open gnatseira opened 1 year ago

gnatseira commented 1 year ago

Microsoft PowerToys version

0.64.0

Installation method

PowerToys auto-update

Running as admin

Yes

Area(s) with issue?

Keyboard Manager

Steps to reproduce

I use the Keyboard Manager to map Ctrl to Alt so that I can use Alt + c/v to copy/paste. In summary, I try to use Alt for shortcuts in many applications. But it sometimes fails to map Crtl to Alt. When I pressed Alt, it had no response. I don't know how to reproduce this bug. It happened occassionaly in recent versions. Even I restart powertoys as admin, it still doesn't work. I have to quit the app, then launch it again to make it work. You can try the same setting in your powertoys. I believe you can find it easily.

✔️ Expected Behavior

For example, when I press Alt and T, it should open a new tab in Chrome. Also, Alt + C can copy some texts.

❌ Actual Behavior

It doesn't open a new tab, but open the setting of chrome (i.e., the button next to avatar). Alt + C cannot copy any text.

Other Software

Chrome 107.0.5304.88.

Jay-o-Way commented 1 year ago

Hello and thanks for your message. can you share a screenshot of your settings please?

mrbagpipe commented 1 year ago

I have the same problem since updating to v0.64.0 and today to v0.64.1

I mapped Alt+Space to Win+1 but it doesn't work anymore

image

gnatseira commented 1 year ago

image It's the setting in my Keyboard Manager. @Jay-o-Way

Jay-o-Way commented 1 year ago

I mapped Alt+Space to Win+1 but it doesn't work anymore

@mrbagpipe Can't reproduce that problem, it works fine on my computer.

I use the Keyboard Manager to map Ctrl to Alt so that I can use Alt + c/v to copy/paste.

@gnatseira Again: Working well on my end. Is there anything (any app) that could interfere with (hot)keys?

mrbagpipe commented 1 year ago

@Jay-o-Way I did a small recording of the issue. Is there any logs I can share?

It seems to be random. Sometimes it works for a while after rebooting

Carnac_pGyrbb4NQx

hyue418 commented 1 year ago

me too

gnatseira commented 1 year ago

@Jay-o-Way Hi, I found the reason for this issue. When I open WeChat of Tencent Inc., the mapping function fails. I guess that the two softwares blocked other mappings to make its own shortcut keys work. I would appreciate it if you would take the time to fix it. Thanks.

hyue418 commented 1 year ago

Yeah, me too. Do not open wechat use no problem, once open wechat will be stuck for a while, and then all the key mapping is invalid, hope the author can fix this problem.

mrbagpipe commented 1 year ago

I don't use WeChat but I still experience this issue on a daily basis. I just haven't identified which program is colliding with this keyboard mapping. Once this happens, I usually restart PowerToys and things go back to normal for a little while

hyue418 commented 1 year ago

I don't use WeChat but I still experience this issue on a daily basis. I just haven't identified which program is colliding with this keyboard mapping. Once this happens, I usually restart PowerToys and things go back to normal for a little while

There seems to be a lot of conflicting programs. Once I use wechat, it will be invalid. And even restarting the software won't work unless you restart the entire system.

t3239658 commented 1 year ago

Yeah, me too. Do not open wechat use no problem, once open wechat will be stuck for a while, and then all the key mapping is invalid, hope the author can fix this problem.

The same problem, hoping to repair as soon as possible

monkeycraps commented 1 year ago

is there any log for keyboard mapping changed, or any notify can be hooked to check ?

gnatseira commented 1 year ago

is there any log for keyboard mapping changed, or any notify can be hooked to check ?

I don't know how to catch logs for keyboard mapping on Windows. But you can try, it can reproduce the result every time by opening WeChat.

xingyuezhiji commented 1 year ago

电脑睡眠之后重新登录电脑,映射就又生效了,但只要一打开微信小程序,就又会失效

ifu25 commented 1 year ago

Win+L 锁定后解锁,或者 Ctrl+Alt+Del 然后再取消就好了😂,可恶的微信~

w-zhiwei commented 1 year ago

just encountered this problem. Anyone knows the cause?

ifu25 commented 12 months ago

电脑睡眠之后重新登录电脑,映射就又生效了,但只要一打开微信小程序,就又会失效

对的对的,打开小程序也不行,我是测试发现微信中点击一个网页链接,通【微信内置的浏览器窗口】打开后就会造成 PowerToys 的快捷键映射失效!微信设置中改为用操作系统自带的浏览器打开就没有问题。

tedli commented 10 months ago

It seems that, wechat also did something like https://github.com/microsoft/PowerToys/blob/5e7d5d1f7fa8a8b1963746a57442f2a400dafce1/src/modules/keyboardmanager/KeyboardManagerEditor/KeyboardManagerEditor.cpp#L148 , but didn't call hook set by other tools. https://github.com/microsoft/PowerToys/blob/5e7d5d1f7fa8a8b1963746a57442f2a400dafce1/src/modules/keyboardmanager/KeyboardManagerEditor/KeyboardManagerEditor.cpp#L223

If so, it's wechat's fault, it's dosen't make sense to try to fix this at powertoys' side.

ffwindy commented 8 months ago

当打开微信的时候,F22按键被按下并没有释放,因此键盘管理器失效,通过软件释放F22之后键盘管理器映射就可以重新使用。请问有快捷释放按键的方法么?

ffwindy commented 8 months ago

当打开微信的时候,F22按键被按下并没有释放,因此键盘管理器失效,通过软件释放F22之后键盘管理器映射就可以重新使用。请问有快捷释放按键的方法么?

image 可以将F22 映射到 disable ,能解决打开微信键盘失灵的问题

acniray commented 7 months ago

当打开微信的时候,F22按键被按下并没有释放,因此键盘管理器失效,通过软件释放F22之后键盘管理器映射就可以重新使用。请问有快捷释放按键的方法么?

image 可以将F22 映射到 disable ,能解决打开微信键盘失灵的问题

正解在这里。。吐血。。。

ifu25 commented 7 months ago

当打开微信的时候,F22按键被按下并没有释放,因此键盘管理器失效,通过软件释放F22之后键盘管理器映射就可以重新使用。请问有快捷释放按键的方法么?

image 可以将F22 映射到 disable ,能解决打开微信键盘失灵的问题

厉害厉害,测试ok,终于完美解决了~⛳

agenshuuu commented 7 months ago

弟兄们,建议直接转战AutoHotkey:作为一款强大的自动化工具,AutoHotkey可以创建脚本以实现复杂的键盘映射和宏定义,并且它通常不会受到相同级别的冲突影响,因为它是通过独立运行的脚本来管理键盘输入的。 经测试快捷键不会因wechat的启动而受影响,经过一个晚上已经将九个快捷操作全部迁移了,在gpt的帮助下省了很多事。 希望能给你们带来帮助

Giresharu commented 7 months ago

弟兄们,建议直接转战AutoHotkey:作为一款强大的自动化工具,AutoHotkey可以创建脚本以实现复杂的键盘映射和宏定义,并且它通常不会受到相同级别的冲突影响,因为它是通过独立运行的脚本来管理键盘输入的。 经测试快捷键不会因wechat的启动而受影响,经过一个晚上已经将九个快捷操作全部迁移了,在gpt的帮助下省了很多事。 希望能给你们带来帮助

ahk 似乎优先度没有原本的 win 快捷键高,比如说按下 win+s 的时候必然会先触发搜索,然后再触发 ahk 中的宏。而keyboard manager可以让原本的功能失效。另外我不是很想去改注册表修改这些快捷键,一旦经过什么修复就总是被还原然后又要去搜半天怎么改,太痛苦了

lns567 commented 5 months ago

当打开微信的时候,F22按键被按下并没有释放,因此键盘管理器失效,通过软件释放F22之后键盘管理器映射就可以重新使用。请问有快捷释放按键的方法么?

image 可以将F22 映射到 disable ,能解决打开微信键盘失灵的问题

好像找不到F22键

lfoxhlnut commented 2 weeks ago

当打开微信的时候,F22按键被按下并没有释放,因此键盘管理器失效,通过软件释放F22之后键盘管理器映射就可以重新使用。请问有快捷释放按键的方法么?

image 可以将F22 映射到 disable ,能解决打开微信键盘失灵的问题

好像找不到F22键

F22 在 F21 后面, F21 在 F20 后面, F20 在 F2 后面, 就像 F10 在 F1 后面一样