如何将 AltGr 键全局映射到 Alt 键? [英] How to globally map AltGr key to Alt key?
问题描述
我希望我的 AltGr 键的行为与左 Alt 完全一样.
通常,我使用 Autohotkey 来做这种事情,但我对不同的解决方案持开放态度.
I want my AltGr key to behave exactly like left Alt.
Usually, I do this kind of stuff with Autohotkey, but I'm open to different solutions.
我试过了:
LControl & RAlt::Alt
并且 Autohotkey 显示关于 Alt
未被识别操作的错误.
然后我尝试了以下代码:
And Autohotkey displayed error about Alt
not being recognized action.
Then I tried the following code:
LControl & RAlt::
Send {Alt down}
KeyWait LCtrl
KeyWait Ralt
Send {Alt up}
return
哪种工作方式 - 我可以使用 AltGr 键来访问热键,但它的行为仍然不同:
当我按下并释放左 Alt 时,当前程序中的第一个菜单项获得焦点.
使用此脚本按下并释放 AltGr 没有任何作用.
which sort of works - I'm able to use the AltGr key for accessing hotkeys, but it still behaves differently:
When I press and release the left Alt, the first menu item in the current program receives focus.
Pressing and releasing AltGr with this script does nothing.
有什么想法吗?Autohotkey 甚至可以做到这一点吗?(将右 Ctrl 和 Shift 重新映射到他们的左兄弟姐妹是小菜一碟)
Any ideas? Is this even possible with Autohotkey? (remapping right Ctrl and Shift to their left siblings was piece of cake)
<小时>注意:我尝试在代码中将 Alt
切换为 LAlt
并没有任何区别.
Note: I tried switching
Alt
to LAlt
in the code and it made no difference.
推荐答案
谢谢大家的解答.我无法使用 AutoHotkey 解决这个问题——PhilLho 的回答很接近,但我真的需要与左 Alt 键完全相同的行为.
Thank you all for answers. I was unable to solve this using AutoHotkey -- PhilLho's answer was close, but I really needed exatly the same behaviour as with left Alt key.
但是,注册表事项实际上按照我的需要工作.
However, the registry thing actually worked as I needed.
将其另存为 AltGR_to_LeftAlt.reg 文件并运行:
Save this as AltGR_to_LeftAlt.reg file and run it:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlKeyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,38,00,38,e0,00,00,00,00
或者,有一个 GUI 工具可以为您执行此操作——它被称为 SharpKeys 并且运行良好:
Or, there is a GUI tool that does this for you -- it's called SharpKeys and works peachy:
哦,别忘了重新启动或注销 - 在那之前它不会工作!
Oh, and don't forget to reboot or log off -- it won't work until then!
这篇关于如何将 AltGr 键全局映射到 Alt 键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!