如何将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_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard 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屋!