0

With the AutoHotKey script

LWin::
return

the Left Windows key can be completely disabled. Not only is a simple Left Windows hit disabled, but also any other combinations including a Left Windows key, has no effect, as the Left Windows key were not pressed. For example: LWin+E, which normally opens an Explorer window, will just send an "e".

Never the less, as soon as a new mapping using the Left Windows key is defined, all the rest of the Left Windows keybindings return active. For example, with the script:

LWin::
return


LWin & a::
Send foo
return

LWin + a will print "foo". Left Windows alone will do nothing. But, magically, Left Windows + E will open an Explorer Window.

How could I disable a modifier (like LWin, RWin, LAlt, RAlt, LCtrl, RCtrl) so that none of the keybinding (but the ones I explicitily defined) run?

4

1 回答 1

1

指定LWin您希望禁用的每个组合。

LWin::
LWin & e::    ; this combinations is disabled
return


LWin & a::
tooltip, foo
return

除非您禁用它,否则所有其他默认组合仍然有效。

如果你不愿意写出每一个组合,你可以用不同的方式来做。由于您现在正在使用它,所以它不太可靠Send

global LWin_g := 0 

SetTimer , checkLWin , 25
return


checkLWin:
    if( GetKeyState( "LWin" , "P") )
        LWin_g := 1
    else
        LWin_g := 0
return

$e::
    if( LWin_g )
    {
        tooltip, action 
    }
    else
    {
        Send ,e
    }
return

LWin::  
return
于 2013-07-09T13:19:00.953 回答