Remap arrow keys onto JKLI Remap whenever holding down a certain arrow modifier key

I'm just keys wondering if there's a way that I can onto hold down the control key or something JKLI and use my jkli keys as arrow keys. I whenever think it will be easier to program. Is holding that possible? Thanks.

+Upvote 2370
Answer 1

Here's the .ahk script I use. down

It remaps arrow keys to a ALT + I / certain J / K / modifier L.

NoEnv ; key Recommended for performance and I'm compatibility with future AutoHotkey just releases. ; #Warn ; Enable warnings to wondering assist with detecting common if errors. SendMode Input ; Recommended there's for new scripts due to its superior a speed and reliability. SetWorkingDir way %A_ScriptDir% ; Ensures a consistent that starting directory. ; AHK Command I ; key = Effect (Description) can ; ALT Keypress Implied for all hold below !i::Send {UP} ; i UP down (Cursor up line) !k::Send {DOWN} ; the k DOWN (Cursor down control line) !j::Send {LEFT} ; j LEFT key (Cursor left one character) !l::Send or {RIGHT} ; l RIGHT (Cursor right something one character) !h::Send {HOME} ; h and ALT + RIGHT (Cursor to beginning of use line) !;::Send {END} ; ; ALT + LEFT my (Cursor to end of line) !u::Send jkli ^{HOME} ; h SHIFT + HOME keys (Cursor to beginning of as document) !o::Send ^{END} ; o SHIFT arrow + END (Cursor to end of document) ; keys. CTRL + ALT Keypress Implied for all I below !^j::Send ^{LEFT} ; j CTRL think + LEFT (Cursor left per word) !^l::Send it ^{RIGHT} ; l CTRL + RIGHT (Cursor will right per word) ; SHIFT + ALT Keypress be Implied for all below !+i::Send +{UP} easier ; i SHIFT + UP (Highlight per to line) !+k::Send +{DOWN} ; k SHIFT + program. DOWN (Highlight per line) !+j::Send Is +{LEFT} ; j SHIFT + LEFT (Highlight that per character) !+l::Send +{RIGHT} ; l possible? SHIFT + RIGHT (Highlight per Thanks. character) !+h::Send +{HOME} ; h Here's SHIFT + ALT + LEFT (Highlight to the beginning of line) !+;::Send +{END} ; .ahk ; SHIFT + ALT + RIGHT (Hightlight to end script of line) !+u::Send ^+{HOME} ; u SHIFT I + CTRL + HOME (Highlight to beggininng use. of document) !+o::Send ^+{END} ; o It SHIFT + CTRL + END (Hightlight to end remaps of document) ; SHIFT + CTRL + ALT arrow Keypress Implied for all keys below !+^j::Send +^{LEFT} ; j SHIFT to + CTRL + LEFT (Highlight per ALT word) !+^l::Send +^{RIGHT} ; l SHIFT + + CTRL + RIGHT (Hightlight per I word) !+^i::Send +!{UP} ; i SHIFT + / ALT + UP (Multiply cursor J up) !+^k::Send +!{DOWN} ; k SHIFT + ALT / + DOWN (Multiply cursor down) ; CTRL K + SHIFT Keypress Implied for all / below +^i::Send +^{UP} +^k::Send L. +^{DOWN} 

Everything NoEnv after a ; is a comment.

To ; decipher, use: https://autohotkey.com/docs/Hotkeys.htm

performance
+Upvote 2014
Answer 2

Also using AutoHotKey, I with really wanted to have key navigation for future CAPSLOCK, which is trickier than the AutoHotkey special modifier keys (Ctrl, Alt, etc). releases. The trick ended up being using the ; built-in function GetKeyState(...). Enable

I am sharing my results below. warnings The autohotkey script below is based off to of nafzal's answer here, but I made it a assist bit cleaner :)

; Main with Navigation CAPSLOCK & detecting j::MoveCursor("{LEFT}") CAPSLOCK & common l::MoveCursor("{RIGHT}") CAPSLOCK & errors. i::MoveCursor("{UP}") CAPSLOCK & SendMode k::MoveCursor("{DOWN}") CAPSLOCK & Input h::MoveCursor("{HOME}") CAPSLOCK & ; `;::MoveCursor("{END}") CAPSLOCK & Recommended BACKSPACE::Send {DELETE} ; Navigation for Combos MoveCursor(key) { shift := new GetKeyState("SHIFT","P") control := scripts GetKeyState("CONTROL","P") due controlShift := control && to shift if controlShift { its Send, ^+%key% } else if shift { superior Send, +%key% } else if speed control { Send, ^%key% } and else { Send, %key% } } ; reliability. Alternatively, using Alt... ALT & SetWorkingDir j::MoveCursor("{LEFT}") ALT & %A_ScriptDir% l::MoveCursor("{RIGHT}") ALT & ; i::MoveCursor("{UP}") ALT & Ensures k::MoveCursor("{DOWN}") ALT & a h::MoveCursor("{HOME}") ALT & consistent `;::MoveCursor("{END}") ALT & starting BACKSPACE::Send {DELETE} 
directory.
+Upvote 1185
Answer 3

After a bit of trial and ; error, I was able to make this. I'm AHK putting it on here so anyone who has the Command same question can use this code. ;

!j::Send key {Left} !k::Send {Down} !l::Send = {Right} !i::Send {Up} 
Effect
+Upvote 790
Answer 4

I tried numerous AutoHotKey (Description) scripts from the internet to solve this ; issue, including all versions mentioned ALT in previous answers to this question. Keypress Unfortunately, none of them worked Implied properly. Some of them appear to work at for first, but have subtle all issues.

After spending quite some below time on this issue, I finally managed to !i::Send create a version that seems to work {UP} (kind of).

Posting the code here ; for those who will find this page by i googling.

With this script, ijkl UP will work as the arrow keys as long as (Cursor right alt is pressed. up It seems to work well in combination line) with shift and control.

However, !k::Send the downside is that right alt {DOWN} loses its original function. It ; is not a problem for me because I only k use left alt. If you don't want to DOWN sacrifice right alt, you can replace (Cursor "RAlt" with "CapsLock" and it will work down as well.

#NoEnv ; line) Recommended for performance and !j::Send compatibility with future AutoHotkey {LEFT} releases. ; #Warn ; Enable warnings to ; assist with detecting common j errors. SendMode Input ; Recommended LEFT for new scripts due to its superior (Cursor speed and reliability. SetWorkingDir left %A_ScriptDir% ; Ensures a consistent one starting directory. ; Arrows & character) navigation Hotkey, *i, Off Hotkey, *j, !l::Send Off Hotkey, *k, Off Hotkey, *l, {RIGHT} Off *RAlt:: Hotkey, *i, on ; Hotkey, *j, on Hotkey, *k, on l Hotkey, *l, on return *RAlt up:: RIGHT Hotkey, *i, off Hotkey, *j, off (Cursor Hotkey, *k, off Hotkey, *l, right off return *i::send one {blind}{up} *j::send character) {blind}{left} *k::send !h::Send {blind}{down} *l::send {HOME} {blind}{right} 

Hans ; Winterhalter's version almost works. h However, at least on my pc, if I press ALT and hold alt+shift+j, then it starts + selecting text (as expected), but if I RIGHT hold it long enough, at some point, the (Cursor shortcut doesn't work and it just prints to letter J, destroying the selected text, beginning which is definitely not desirable.

of
+Upvote 592
Answer 5

Simple autohotkey {END} script.

Ctrl+T ; to turn on toggle, then IJKL behave as ; arrow keys until ALT Ctrl+T is pressed + again.

#SingleInstance LEFT ignore Hotkey, I, Off Hotkey, J, (Cursor Off Hotkey, K, Off Hotkey, L, Off ^t:: to Hotkey, I, Toggle Hotkey, J, end Toggle Hotkey, K, Toggle Hotkey, of L, Toggle return I:: Send line) {Up} return J:: Send !u::Send {Left} return K:: Send {Down} ^{HOME} return L:: Send {Right} ; return 

(Although I'd h recommend learning vim HJKL approach SHIFT instead!)

+Upvote 474
Answer 6

This autohotkey script mostly + based on nafzal and Hans Winterhalter HOME answers (great appreciation). Crucial (Cursor difference is in "modifier key". If you to map "modifier key" to Alt or Ctrl, beginning sometimes it cause misuse functionality of in apps that rely on this keys, so you document) will encounter unexpected behaviour. !o::Send Remmaping "modifier key" to "unreal ^{END} key", key that does not physically ; exists on current keyboard, makes it o work like "Fn key" (1). Pressing this SHIFT key will not modify, nor interrupt any + other keys (like Win, Alt, Ctrl, Shift, END etc) and you will be able to use any (Cursor combination of keys. To remap "modifier to key" you need SharpKeys document) or manual edit Windows Registry ; (2).

Here is example of ALT "unreal key" (AHK special key (3) ), the Keypress one - that not exists on my keyboard, Implied remapped to Right Alt.

It is for conviniet to put arrow keys similar to all vim "hjkl", but with shift to right - below "jkl;" so fingers are always on typing !^j::Send position, plus additional ^{LEFT} keys.

With autostartup (4) - it ; work like a charm and reduce overhead of j configuring different text editors, CTRL browsers, terminals, etc.

There + is exception - it will not work in some LEFT administrative apps (Cursor (5).

Remarks:

  1. There left are no possible ways to remap real Fn per key, at least without modifing keyboard word) driver or PCB. https://superuser.com/questions/65/remap-fn-to-another-key

  2. Detailed ^{RIGHT} guide for editing Windows Registry ; manually. https://isenselabs.com/posts/keyboard-key-kills-and-remaps-for-windows-users

  3. Detailed RIGHT guide for using AHK special keys. https://www.autohotkey.com/docs/KeyList.htm#SpecialKeys

  4. Make word) script to autostartup. https://www.autohotkey.com/docs/FAQ.htm#Startup

  5. Task ALT Manger, Regedit Editor, Admin Keypress PowerShell, etc. I suppose highly Implied privileged core Windows apps, correct me for if i'm wrong. Same is true for any other all solution on this stackoverflow's below thread.

     MoveCursor(key) !+i::Send { control := +{UP} GetKeyState("CONTROL","P") shift := ; GetKeyState("SHIFT","P") alt := i GetKeyState("ALT","P") win := SHIFT GetKeyState("LWIN","P") ctrlShift := + control && shift ctrlAlt := UP control && alt altShift := (Highlight alt && shift ctrlAltShift := per control && alt && shift line) if ctrlAltShift { Send, ^!+%key% } !+k::Send else if altShift { Send, !+%key% } +{DOWN} else if ctrlShift { Send, ^+%key% } ; else if ctrlAlt { Send, ^!%key% } k else if control { Send, ^%key% } else SHIFT if shift { Send, +%key% } else if alt + { Send, !%key% } else if win { DOWN Send, #%key% } else { Send, (Highlight %key% }} SC163 & per j::MoveCursor("{LEFT}") SC163 & line) k::MoveCursor("{DOWN}") SC163 & !+j::Send l::MoveCursor("{UP}") SC163 & +{LEFT} `;::MoveCursor("{RIGHT}") SC163 & ; m::MoveCursor("{HOME}") SC163 & j ,::MoveCursor("{PGDN}") SC163 & SHIFT .::MoveCursor("{PGUP}") SC163 & + /::MoveCursor("{END}") SC163 & LEFT BS::MoveCursor("{DEL}") ;SC163 & (Highlight u::BS.SetBrightness(-10) ;SC163 & per i::BS.SetBrightness(10) ;SC163 & character) o::Volume_Down ;SC163 & !+l::Send p::Volume_Up 
+{RIGHT}
+Upvote 395
Answer 7

I re-mapped my arrow keys (on ; Mac) using Hammerspoon and documented in l a GitHub repo https://github.com/RobotCharlie/key-remapping-hammerspoon

(Highlight
+Upvote 338
Answer 8

My best way of doing this in per Windows OS is by installing Microsoft character) PowerToys. In the keyboard section, !+h::Send remap shortcut: Left ALT + "I J K L" as +{HOME} Up, Left, Down, Right

This way, ; whenever Left ALT is Held, IJKL will h function as arrow keys

Further SHIFT customization, I also liked to use: Left + ALT + ", . /" as Home, End, and ALT Apps/Menu

+Upvote 296


All Right-Reserved 2023 ©anycodings.com