6

I am trying to map the following key combinations on my keyboard using AutoHotkey -

Alt i -> Up Arrow Alt j -> Left Arrow Alt k -> Right Arrow Alt m -> Down Arrow

I added the following code to my AutoHotkey.ahk file -

!i::Up
!j::Down
!m::Left
!k::Right

but it doesn't produce the desired results. Please help!!

Arunabh Das
  • 13,212
  • 21
  • 86
  • 109
  • 1
    @marc AHK scripting is bona fide programming and fits better here than on SU. – Jay Jul 08 '10 at 21:03

3 Answers3

10
!i::SendInput,{UP}
!j::SendInput,{LEFT}
!k::SendInput,{RIGHT}
!m::SendInput,{DOWN} 
Jay
  • 56,361
  • 10
  • 99
  • 123
  • The above settings worked but I had another question related to this. It seems that even though pressing Alt i causes the cursor to move left, if I use Alt i while simultaneously holding down Shift, it doesn't produce the same results as holding down Shift and pressing left arrow, i.e. the text in an editor getting selected as a result of this. Is there a way for AutoHotKey to get Alt i with Shift held down to behave exactly like Shift + Left Arrow? – Arunabh Das Jul 08 '10 at 21:19
  • I *think* you need to map that explicitly: `+!i::SendInput,!{UP}` – Jay Jul 08 '10 at 21:33
1

Jay's answer works, but

!i::Send {Up}
Return
!k::Send {Down}
Return
!l::Send {Right}
Return
!j::Send {Left}
Return

is a much faster solution.

Miguel
  • 566
  • 1
  • 5
  • 16
  • 1
    If your command is a one-liner, you don't need to put `return` on the next line. – bgmCoder Jul 06 '13 at 23:16
  • @Miguel Why would returns make it faster? Unless the Send does it, in which case BGM is correct that the returns should be unnecessary... – Menasheh Jun 30 '15 at 03:33
0

I think a better approach is to use the freeware application TouchCursor http://touchcursor.sourceforge.net/overview.html It has training mode, is easier to configure. Also, I was surprised to learn that using 'space' rather than 'alt' works much better in practice.

Carlo V. Dango
  • 13,322
  • 16
  • 71
  • 114
  • 3
    This question is tagged autohotkey - the fellow wants help with autohotkey, not some other application. – bgmCoder Jul 06 '13 at 23:17