dreamfliper
3/11/2017 - 3:24 PM

a naive key-remap script

a naive key-remap script


RAlt::RCtrl
RWin::RAlt
~MButton & WheelUp::
 WinGetActiveTitle, Title
 WinClose, %Title%
return
LWin & V::
 Send #n
return
#A::
 Send {Win Up}
 RUN http://www.google.com.tw/search?q=%clipboard%
return
^F12::
 SendMessage 0x112, 0xF170, 2, , Program Manager  ; Monitor off
return
!S::
 RUN C:\Program Files\Sublime Text 3\sublime_text.exe
return
~LButton & L::
  WinGetActiveTitle, Title
  WinClose, %Title%
return
~MButton & WheelDown::
 RUN ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}
return
~MButton & RButton::
 Send #n
return
~MButton & Backspace::
  Send #{F2}
return  
LAlt & ESC::
    Send #{F2}
return  
;;;push midle mouse right after expanded all windows
;~#F2::
;{
;    Sleep 50
;   Send {MButton}
;}
LAlt & L::
    If  GetKeyState("Shift", "P")
        Send ^L
    Else
        Send ^l
return
LAlt & U::
    If  GetKeyState("Shift", "P")
        Send ^U
    Else
        Send ^u
return
LAlt & '::
  Send ^'
return
LAlt & Enter::
    If  GetKeyState("Shift", "P")
        Send  ^+{Enter}
    Else
        Send ^{Enter} 
return
LAlt & A::
    If GetKeyState("Shift", "P")
     Send +^a
    Else
     Send ^a
return
LAlt & M::
 WinGetActiveTitle, Title
 WinMinimize %Title%
return
LAlt & D::
 Send ^d
return
LAlt & C::
 If  GetKeyState("Shift", "P")
        Send  ^+c
 Else
   	Send ^c
return  
LAlt & Space::
 Send {Shift down}{Shift up}
return
LAlt & Backspace::
    WinGet, Title, ProcessName,A 
    if((Title == "dopus.exe") || (Title == "Everything.exe"))
        Send {Delete}
    Else
        Send ^{Backspace}
return
LAlt & 2::
 If  GetKeyState("RAlt", "P")
     Send !+{2}
 Else
     Send ^2
return
LAlt & 1::
 If  GetKeyState("RAlt", "P")
     Send !+{1}
 Else
     Send ^1
return
LAlt & 0::
 Send ^0
return
LAlt & Delete::
 Send ^{Delete}
return
LAlt & X::
 Send ^x
return	
LAlt & V::
 If  GetKeyState("Shift", "P")
        Send  ^+v
 Else
   	Send ^v
return  
LAlt & H::
 Send ^h
return
LAlt & O::
 Send ^o::
return
LAlt & F::
    If GetKeyState("Shift", "P")
     Send +^f
    Else
     Send ^f
return
LAlt & G::
    If  GetKeyState("Capslock", "P")
    {
        Send ^{F3}
	SetCapsLockState, Off
    }
    Else If GetKeyState("Shift", "P")
        Send +{F3}
    Else If GetKeyState("RAlt", "P")
        Send !{F3}
    Else
        Send {F3} 
return
LAlt & S::
    If GetKeyState("Shift", "P")
     Send +^s
    Else
     Send ^s
return
LAlt & W::
    If GetKeyState("Shift", "P")
     Send +^w
    Else If GetKeyState("RAlt","P")
     Send aw
    Else
     Send ^w
return
LAlt & J::
    If  GetKeyState("Capslock", "P"){
        Send {LAlt up}^{F2}
	SetCapsLockState, Off
}
    Else If GetKeyState("Shift", "P")
        Send +{F2}
    Else
        Send {F2}
return
LAlt & T::
    If GetKeyState("Shift", "P")
        Send +^t
    Else
        Send ^t
return
LAlt & I::
    If GetKeyState("Shift", "P")
        Send +^i
    Else
        Send ^i
return
LAlt & P::
    If GetKeyState("Shift", "P")
        Send +^p
    Else
        Send ^p
return
LAlt & B::
 Send ^b
return
LAlt & K::
 Send ^k
return

LAlt & N::
    If GetKeyState("Shift", "P")
     Send +^n
    Else
     Send ^n
return
LAlt & R::
 If GetKeyState("Shift", "P")
     Send +^r
 Else
     Send ^r
return
LAlt & /::
 Send ^/
return
LAlt & Z::
    If  GetKeyState("Shift", "P")
        Send ^y
    Else
        Send ^z
return
Capslock & '::
  Send {Esc}
return
Capslock & w::
    If  GetKeyState("Shift", "P")
    {
        If GetKeyState("RAlt", "P")
            Send ^+{Up}
        Else
            Send  +{Up}
    }
    Else If Getkeystate("LWin","P")
    Send !{Up}
    Else If Getkeystate("LAlt","P")
    {
        If Getkeystate("RAlt","P")
            Send !^{Up}
        Else
            Send ^{Home}
    }    
    Else
        Send {Up} 
return
Capslock & d::
    If  GetKeyState("Shift", "P")
    {
        If  GetKeyState("LAlt", "P")
            Send ^+{Right}
        Else
            Send +{Right}
    }
    Else If GetKeyState("LAlt", "P")
        Send ^{Right}
    Else If GetKeyState("Ctrl", "P")
        Send !{Right}
    Else
        Send {Right} 
return
Capslock & a::
    If  GetKeyState("Shift", "P")
    {
        If  GetKeyState("LAlt", "P")
            Send ^+{Left}
        Else
            Send +{Left}
    }
    Else If GetKeyState("LAlt", "P")
        Send ^{Left}
    Else If GetKeyState("Ctrl", "P")
        Send !{Left}
    Else
        Send {Left} 
return
Capslock & s::
    If  GetKeyState("Shift", "P")
    {
        If GetKeyState("RAlt", "P")
            Send ^+{Down}
        ; Else If GetKeyState("RWin","P")
        ;     Send !^{Down}
        Else
            Send  +{Down}
    }
    Else If Getkeystate("LAlt","P")
    {
        If Getkeystate("RAlt","P")
            Send !^{Down}
        Else
            Send ^{Home}
    }    
    Else If Getkeystate("LAlt","P")
    Send ^{End}
    Else
        Send {Down} 
return
Capslock & c::
    If  GetKeyState("LAlt", "P")
        Send  ^{Delete}
    Else
        Send {Delete} 
return
Capslock & z::
    If  GetKeyState("Shift", "P")
        Send  +{End}
    Else If GetKeyState("Ctrl", "P")
        Send  ^{End}
    Else
        Send {End} 
return
Capslock & q::
    If  GetKeyState("Shift", "P")
        Send  +{Home}
    Else If GetKeyState("Ctrl", "P")
        Send  ^{Home}
    Else
        Send {Home} 
return
Capslock & e::
    If  GetKeyState("LAlt", "P")
        Send  ^{Backspace}
    Else
        Send {Backspace} 
return
Capslock & Enter:: 
    Send {Enter}
return
Capslock & F:: 
    Send {Enter}
return
Capslock & Space:: 
    Send {Space}
return
Capslock & LAlt::
    Send {Capslock}
return
LAlt & [::
    WinGet, Title, ProcessName,A 
    if(Title == "dopus.exe")
        Send ^{Left}
    else if GetKeyState("Shift", "P")
	Send +^{Tab}
    else 
        Send ^[
return
LAlt & ]::
    WinGet, Title, ProcessName,A 
    if(Title == "dopus.exe")
        Send ^{Right}
    else if GetKeyState("Shift", "P")
	Send ^{Tab}
    else 
        Send ^]
return
Capslock & I:: 
    Send {PgUp}
return
Capslock & K:: 
    Send {PgDn}
return
Capslock & 1::
     Send {F1}
return
Capslock & 2::
     Send {F2}
return
Capslock & 3::
     Send {F3}
return
Capslock & 4::
     Send {F4}
return
Capslock & 5::
     Send {F5}
return
Capslock & 6::
     Send {F6}
return
Capslock & 7::
     Send {F7}
return
Capslock & 8::
     Send {F8}
return
Capslock & 9::
     Send {+}
return
Capslock & 0::
     Send {=}
return
LAlt & Q::
 Send !{F4}
return
LAlt & ,::
 Send ^,
return
;RAlt & Q::
; Send #f
;return
#Enter::AppsKey
#Space::#q