在使用自动编程器重新映射Alt/Ctrl/Win时,使用罗马尼亚程序员布局键入罗马尼亚字符后,Windows变得疯狂 [英] Windows going crazy after typing Romanian characters using a Romanian Programmers layout while remapping Alt/Ctrl/Win with Autohotkey
问题描述
我已经使用Autohotkey重新映射了一些键,如下所示:
I've remapped some keys using Autohotkey, like this:
LWin::LAlt
LCtrl::LWin
LAlt::LCtrl
我将Windows 7与罗马尼亚语(程序员)键盘布局一起使用.例如,如果要键入¤,请按RAlt + a.之所以称为程序员",是因为它是美国QWERTY的常规布局,带有由RAlt激活的其他内容.
I'm using Windows 7 with the Romanian (Programmers) keyboard layout. If I want to type ă I hit RAlt + a, for example. It's called "Programmers" because it's a reqular US QWERTY layout with extras activated by RAlt.
但是,如果我运行我的Autohotkey脚本,然后发送RAlt + a/s/t/i,则系统变得非常笨拙.即使我关闭了Autohotkey,它的行为也仍然如此.我必须注销/重新启动或按魔术键顺序来修复它(我仍然没有弄清楚是什么顺序).
However, if I run my Autohotkey script AND then I send a RAlt + a/s/t/i, the system goes bonkers. Even if I close Autohotkey it still behaves like that. I have to log off/reboot or hit magic key sequence to fix it (I still haven't figured out what sequence).
我猜测发生的事情是Alt莫名其妙地卡住了,我按下的每个键都与Alt混在一起了.按Esc键可切换Windows,在应用程序中按F键可打开文件"菜单,等等.
What I'm guessing happens is that Alt somehow gets stuck and every key I press is mixed up with Alt. Pressing Esc switches Windows, pressing F while in an application opens the File menu, etc.
这是Autohotkey错误还是我做错了什么?
Is this an Autohotkey bug or am I doing something wrong?
我过去曾为此使用SharpKeys,但由于某些要求-共享计算机-每个用户我都需要一些东西,最好可以将其关闭. Autohotkey对此非常适合.
I've used SharpKeys in the past for this but due to some requirements - shared computer - I need something per user and that preferably can be turned off. Autohotkey would have been perfect for this.
谢谢.
后期编辑-解决方案是576i(第一部分+键映射来代替我使用的以前的键盘映射-我放弃了罗马尼亚程序员)
Late edit - the solution was what 576i (first section + key mappings to replace the previous keyboard mapping I was using - I gave up Romanian Programmers)
; Remap Ctrl to Win, Win to Alt, Alt to Ctrl - credit to 579i
$*LWin::Send {LAlt Down}
$*LWin Up::Send {LAlt Up}
$*LCtrl::Send {LWin Down}
$*LCtrl Up::Send {LWin Up}
$*LAlt::Send {LControl Down}
$*LAlt Up::Send {LControl Up}
; Keyboard mappings for Romanian letters
; First of all - GTK Windows are special and need special treatment
#IfWinActive, ahk_class gdkWindowToplevel
>!a::SendInput {Control Down}{Shift Down}u0103{Control Up}{Shift Up}
>!+a::SendInput {Control Down}{Shift Down}u0102{Control Up}{Shift Up}
>!q::SendInput {Control Down}{Shift Down}u00E2{Control Up}{Shift Up}
>!+q::SendInput {Control Down}{Shift Down}u00C2{Control Up}{Shift Up}
>!i::SendInput {Control Down}{Shift Down}u00EE{Control Up}{Shift Up}
>!+i::SendInput {Control Down}{Shift Down}u00CE{Control Up}{Shift Up}
>!s::SendInput {Control Down}{Shift Down}u0219{Control Up}{Shift Up}
>!+s::SendInput {Control Down}{Shift Down}u0218{Control Up}{Shift Up}
>!t::SendInput {Control Down}{Shift Down}u021B{Control Up}{Shift Up}
>!+t::SendInput {Control Down}{Shift Down}u021A{Control Up}{Shift Up}
; Then regular windows
#IfWinActive
>!a::Send ă
>!+a::Send Ă
>!q::Send â
>!+q::Send Â
>!i::Send î
>!+i::Send Î
>!s::Send ș
>!+s::Send Ș
>!t::Send ț
>!+t::Send Ț
[已编辑,其中包含GTK修复程序;对于控制台Windows仍然不起作用,并且在粘贴时会有一些奇怪的故障,有时Ctrl被解释为Alt]
推荐答案
如果您的右Alt键是Alt-Gr键,则为 解释为LControl&会触发脚本的RAlt.
If your right Alt key is an Alt-Gr key it will be intepreted as LControl & RAlt which triggers your script.
同样,您似乎在那儿无休止地循环.
Also it looks like you got an endless loop there.
看看这个例子,这应该对你更好.
Look at this example, this should work better for you.
热键前的 $ 会阻止您使用该键 发送"触发下一个热键. * 确保 当与其他键一起按下时,该键也可以使用.
The $ before hotkeys prevents that the key you "Send" triggers the next hotkey. The * makes sure the key also works when pressed with other keys.
$*LWin::Send {LAlt Down}
$*LWin Up::Send {LAlt Up}
$*LCtrl::Send {LWin Down}
$*LCtrl Up::Send {LWin Up}
$*LAlt::Send {LControl Down}
$*LAlt Up::Send {LControl Up}
如果发生以下情况,此重新映射可能仍会杀死您的Alt-Gr键: 您的键盘驱动程序会在内部发送"LControl& RAlt".
This remapping might still kill your Alt-Gr key if your keyboard drivers sends "LControl & RAlt" internally.
您可以解决此问题,从而为Alt-Gr创建一个特殊的热键 或-如果罗马尼亚语键盘只有几个Alt-Gr组合, 将它们定义为热键.
You can fix this creating a special hotkey either for Alt-Gr or - if the romanian keyboard has only a few Alt-Gr combinations, define those as hotkeys.
Autohotkey帮助文件 Hotkey 页面中的示例:
Example from the Autohotkey help file Hotkey page:
<^>!m::MsgBox You pressed AltGr+m.
<^<!m::MsgBox You pressed LeftControl+LeftAlt+m.
这篇关于在使用自动编程器重新映射Alt/Ctrl/Win时,使用罗马尼亚程序员布局键入罗马尼亚字符后,Windows变得疯狂的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!