mhpreiman
1/5/2018 - 10:58 PM

ahk rebind non-modifier keys

Rebind non-modifier keys without  triggering single key function when pushing combo (give sufficient time to push down the second key)
NB! Wrecks other keybinds using Capslock. For example if caps sends -, then every other keybind using caps gets a - and only after the timeout (1.2 seconds) which usually means after the other keybind has executed (can't delete the backspace anymore)!

Solution:   BEST

CapsLock::
  ;code 
  Return
 
CapsLock & Esc::
  ;code
  Return

Space & Esc::
  ;code
  Return

IF capslock puts something out, you can simply delete this with Send {backspace 4}

Solution:   without capslock-only

CapsLock::Return
CapsLock & Esc::
  ;code   
  Return   

Solution:   limited (doesn't work well with multiple keys - if at all)

CapsLock & Esc::Return            ;needed!
CapsLock::
  KeyWait, Esc, D T.1.2           ;use Esc
    
    if (!ErrorLevel) {            ;Caps + Esc
      ;code
    }
    else {                        ;CapsLock
      ;code                 
    } 
    Return

Solution:   saving for reference in case never ways stop working (it's buggy)

CapsLock::Return           ;important!   due to the bottom kb keyword UP, capslock default has to be disabled expicitly with ~
CapsLock up::               ;UP keyword is VERY important here - so other keybinds won't trigger this caps-only one!
  ;code          
  Return
        
CapsLock & Esc::
  ;code   
  Return