Jump to content

Mapping arrow keys to Letters J,K,L,I


Recommended Posts

Hello,

I wouldn't call myself an expert on Autoit, but I have frequently used it over the years whenever the opportunity presents itself as it did just now: While programming I find it quite annoying, that specific autocomplete mechanisms require me to use the left or right arrow keys to get out of a bracket, or if I want to correct a typo I must look down at my keyboard, find the arrow keys and, if I am currently working on my laptop, sofa or bed, bend my wrist in an unnatural way to press the damned buttons. I can't be the only fool with this problem. Anyways, besides the 1.5 seconds lost in this maneuver, the main drawback is that it trips up my programming-flow.

So what I wanted to program is the ability to use the letters J, K, L, I  in combination with {Win} {ALT} as hotkeys for Left, Down, Right, Up respectively. The problem of course is that if I use a hotkey, I cannot use the key for anything else besides the said autoit function, which would be pointless, since I still need those keys to write code!

Any Ideas? Alternate software?

Many thanks,

mio

Link to comment
Share on other sites

By "while programming", do you mean "while programming AutoIt in SciTE4AutoIt3"? Or while programming in other languages in other editors?

I myself often find that using vim (primarily a linux editor, but I install Cygwin everywhere I go) makes for efficient editing, especially on small form-factor keyboards (i.e. keyboards without a numpad). Not for AutoIt though. Scite is fine, except for its horrendous auto-indentation, but that can be fixed by slamming Ctrl+T as often as possible :)

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

I just started using Visual Studio a few weeks ago for a c++ project. But its any IDE really, as far as I know, eclipse for java and notepad++ for small VB stuff could all use this.

cash money

http://www.howtogeek.com/howto/windows-vista/map-any-key-to-any-key-on-windows-xp-vista/

ah no it doesn't work, just for single keys, and its previous use is lost. But I like the idea of using the Caps Lock key as something else. I have an Idea how to do it in autoit: make Capslock a hotkey, when pressed it starts a second autoit script for JKLI that either ends after a half a second, or if either JKL or I is pressed it presses respective arrow key.

not the most elegant solution though

Edited by miomaz
Link to comment
Share on other sites

Not sure what your point is then... What goes wrong when you set {Win} + {Alt} + <j/k/l/i> as hotkeys? (Apart from that the four combinations "{Win} + {Alt} + j", "{Win} + {Alt} + k", "{Win} + {Alt} + l" and "{Win} + {Alt} + i" cannot be used for other purposes any more, but with keybindings that specific who really cares?)

By the way, you can still make the hotkeys do both your special bidding, and their normal function. Say we capture ^a (Ctrl+a) to write a line of output, but we still want to select all when we press it:

HotKeySet("^a", "testfunc");

While True
    Sleep(1000)
WEnd

Func testfunc()
    ConsoleWrite("test" & @CRLF)
    HotKeySet("^a")
    Send("^a")
    HotKeySet("^a", "testfunc");
EndFunc   ;==>testfunc
Edited by SadBunny

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...