Commits

Tomasz Stachowiak committed 6b32deb

SentInput -> SendEvent, since Input doesn't always catch key presses

Comments (0)

Files changed (3)

         disable = ''.join('{%s Up}' % m for m in mod)
         enable = ''.join('{%s Down}' % m for m in mod)
         
-        print 'SendInput %s%s%s' % (disable, val, enable)
+        print 'SendEvent %s%s%s' % (disable, val, enable)
 
 
 def remapKey(key, remappings):
 #MaxThreadsBuffer On
 #SingleInstance force
 
-; Process, priority,, Realtime
+SetKeyDelay, -1, -1
+Process, priority,, High
 
 g_mod1 := 0
 g_mod1Prev := 0
 
 
 *e::
-SendInput {Blind}{f}
+SendEvent {Blind}{f}
 return
 
 
 *r::
-SendInput {Blind}{p}
+SendEvent {Blind}{p}
 return
 
 
 *t::
-SendInput {Blind}{g}
+SendEvent {Blind}{g}
 return
 
 
 *y::
-SendInput {Blind}{j}
+SendEvent {Blind}{j}
 return
 
 
 *u::
 
 if g_numpad {
-SendInput {Blind}{4}
+SendEvent {Blind}{4}
 return
 }
 
 if g_mod1 {
-SendInput {Blind}{Home}
+SendEvent {Blind}{Home}
 return
 }
-SendInput {Blind}{l}
+SendEvent {Blind}{l}
 return
 
 
 *i::
 
 if g_numpad {
-SendInput {Blind}{5}
+SendEvent {Blind}{5}
 return
 }
 
 GetKeyState, ctrl, Ctrl
 if g_mod1 && (ctrl = D || g_mod1Ctrl) {
-SendInput {Ctrl Up}{Blind}{PgUp}{Ctrl Down}
+SendEvent {Ctrl Up}{Blind}{PgUp}{Ctrl Down}
 return
 }
 if g_mod1 {
-SendInput {Blind}{Up}
+SendEvent {Blind}{Up}
 return
 }
 
 if g_mod2 {
-SendInput {Blind}{U+005b}
+SendEvent {Blind}{U+005b}
 return
 }
-SendInput {Blind}{u}
+SendEvent {Blind}{u}
 return
 
 
 *o::
 
 if g_numpad {
-SendInput {Blind}{6}
+SendEvent {Blind}{6}
 return
 }
 
 if g_mod1 {
-SendInput {Blind}{End}
+SendEvent {Blind}{End}
 return
 }
 
 if g_mod2 {
-SendInput {Blind}{U+005d}
+SendEvent {Blind}{U+005d}
 return
 }
-SendInput {Blind}{y}
+SendEvent {Blind}{y}
 return
 
 
 *p::
 
 if g_numpad {
-SendInput {Blind}{U+002a}
+SendEvent {Blind}{U+002a}
 return
 }
 
 if g_mod1 {
-SendInput {Blind}{Delete}
+SendEvent {Blind}{Delete}
 return
 }
-SendInput {Blind}{sc027}
+SendEvent {Blind}{sc027}
 return
 
 
     
 return
 }
-SendInput {Blind}{r}
+SendEvent {Blind}{r}
 return
 
 
     
 return
 }
-SendInput {Blind}{s}
+SendEvent {Blind}{s}
 return
 
 
     
 return
 }
-SendInput {Blind}{s Up}
+SendEvent {Blind}{s Up}
 return
 
 
     
 return
 }
-SendInput {Blind}{t}
+SendEvent {Blind}{t}
 return
 
 
     
 return
 }
-SendInput {Blind}{t Up}
+SendEvent {Blind}{t Up}
 return
 
 
 *g::
-SendInput {Blind}{d}
+SendEvent {Blind}{d}
 return
 
 
 *h::
 
 if g_mod1 {
-SendInput {Blind}{Backspace}
+SendEvent {Blind}{Backspace}
 return
 }
 
 if g_mod2 {
-SendInput {Blind}{U+005f}
+SendEvent {Blind}{U+005f}
 return
 }
 SendInput {Blind}{h}
 *j::
 
 if g_numpad {
-SendInput {Blind}{1}
+SendEvent {Blind}{1}
 return
 }
 
 if g_mod1 {
-SendInput {Blind}{Left}
+SendEvent {Blind}{Left}
 return
 }
 
 if g_mod2 {
-SendInput {Blind}{U+0028}
+SendEvent {Blind}{U+0028}
 return
 }
-SendInput {Blind}{n}
+SendEvent {Blind}{n}
 return
 
 
 *k::
 
 if g_numpad {
-SendInput {Blind}{2}
+SendEvent {Blind}{2}
 return
 }
 
 GetKeyState, ctrl, Ctrl
 if g_mod1 && (ctrl = D || g_mod1Ctrl) {
-SendInput {Ctrl Up}{Blind}{PgDn}{Ctrl Down}
+SendEvent {Ctrl Up}{Blind}{PgDn}{Ctrl Down}
 return
 }
 if g_mod1 {
-SendInput {Blind}{Down}
+SendEvent {Blind}{Down}
 return
 }
 
 if g_mod2 {
-SendInput {Blind}{U+0029}
+SendEvent {Blind}{U+0029}
 return
 }
-SendInput {Blind}{e}
+SendEvent {Blind}{e}
 return
 
 
 *l::
 
 if g_numpad {
-SendInput {Blind}{3}
+SendEvent {Blind}{3}
 return
 }
 
 if g_mod1 {
-SendInput {Blind}{Right}
+SendEvent {Blind}{Right}
 return
 }
 
 if g_mod2 {
-SendInput {Blind}{U+007b}
+SendEvent {Blind}{U+007b}
 return
 }
-SendInput {Blind}{i}
+SendEvent {Blind}{i}
 return
 
 
 *sc027::
 
 if g_numpad {
-SendInput {Blind}{U+002d}
+SendEvent {Blind}{U+002d}
 return
 }
 
 if g_mod1 {
-SendInput {Blind}{Enter}
+SendEvent {Blind}{Enter}
 return
 }
 
 if g_mod2 {
-SendInput {Blind}{U+007d}
+SendEvent {Blind}{U+007d}
 return
 }
-SendInput {Blind}{o}
+SendEvent {Blind}{o}
 return
 
 
     
 return
 }
-SendInput {Blind}{k}
+SendEvent {Blind}{k}
 return
 
 
 *m::
 
 if g_numpad {
-SendInput {Blind}{0}
+SendEvent {Blind}{0}
 return
 }
 
 }
 
 if g_mod2 {
-SendInput {Blind}{U+003d}
+SendEvent {Blind}{U+003d}
 return
 }
 SendInput {Blind}{m}
 *sc028::
 
 if g_mod1 {
-SendInput {Blind}{U+002f}{U+002b}
+SendEvent {Blind}{U+002f}{U+002b}
 return
 }
 SendInput {Blind}{sc028}
 *sc035::
 
 if g_numpad {
-SendInput {Blind}{U+002b}
+SendEvent {Blind}{U+002b}
 return
 }
 
 if g_mod1 {
-SendInput {Blind}{sc056}
+SendEvent {Blind}{sc056}
 return
 }
 SendInput {Blind}{sc035}
 *sc02b::
 
 if g_mod1 {
-SendInput {Blind}{U+002b}{U+002f}
+SendEvent {Blind}{U+002b}{U+002f}
 return
 }
-SendInput {Blind}{sc029}
+SendEvent {Blind}{sc029}
 return
 
 
 *sc033::
 
 if g_numpad {
-SendInput {Blind}{sc033}
+SendEvent {Blind}{sc033}
 return
 }
 
 if g_mod1 {
-SendInput {Blind}+{7}
+SendEvent {Blind}+{7}
 return
 }
 SendInput {Blind}{sc033}
 *sc034::
 
 if g_numpad {
-SendInput {Blind}{sc034}
+SendEvent {Blind}{sc034}
 return
 }
 
 if g_mod1 {
-SendInput {Blind}+{sc056}
+SendEvent {Blind}+{sc056}
 return
 }
 SendInput {Blind}{sc034}
 *5::
 
 if g_mod1 {
-SendInput {Blind}{F5}
+SendEvent {Blind}{F5}
 return
 }
 SendInput {Blind}{5}
 *7::
 
 if g_numpad {
-SendInput {Blind}{7}
+SendEvent {Blind}{7}
 return
 }
 
 *9::
 
 if g_numpad {
-SendInput {Blind}{9}
+SendEvent {Blind}{9}
 return
 }
 
 *0::
 
 if g_numpad {
-SendInput {Blind}{/}
+SendEvent {Blind}{/}
 return
 }
 
 #MaxThreadsBuffer On
 #SingleInstance force
 
-; Process, priority,, Realtime
+SetKeyDelay, -1, -1
+Process, priority,, High
 
 g_mod1 := 0
 g_mod1Prev := 0