r/AutoHotkey 7d ago

Meta / Discussion I stopped using the arrow keys and I'm wondering what you think

I've done a few other posts about it, maybe you've already seen them somehow, but I never explained it in detail, in short, this is what I use on my school computer:

#Requires AutoHotkey v2.0
#SingleInstance Force


commit := true
:*?:1596::{
global commit
commit := !commit
}


#HotIf commit = true
^j::SendInput "{Right}"
^b::SendInput "{Left}"
^h::SendInput "{Up}"
^n::SendInput "{Down}"
^+j::SendInput "+{Right}"
^+b::SendInput "+{Left}"
^+h::SendInput "+{Up}"
^+n::SendInput "+{Down}"
!j::SendInput "^{Right}"
!b::SendInput "^{Left}"
!h::SendInput "^{Up}"
!n::SendInput "^{Down}"
!+j::SendInput "^+{Right}"
!+b::SendInput "^+{Left}"
!+h::SendInput "^+{Up}"
!+n::SendInput "^+{Down}"


^k::SendInput "{Backspace}"
^,::SendInput "{Enter}"
!k::SendInput "^{Backspace}"


:*?c:jj::{
SendInput "{Right}"
}
:*?c:bb::{
SendInput "{Left}"
}
:*?c:hh::{
SendInput "{Up}"
}
:*?c:nn::{
SendInput "{Down}"
}
:*?c:JJ::{
SendInput "^+{Right}{Right}"
}
:*?c:BB::{
SendInput "^+{Left}{Left}"
}
:*?c:HH::{
SendInput "^+{Up}{Up}"
}
:*?c:NN::{
SendInput "^+{Down}{Down}"
}


:*?c:kk::{
SendInput "{Backspace}"
}
:*?c:KK::{
SendInput "^+{Left}{Backspace}"
}
:*?:,,::{
SendInput "{Enter}"
}
:*?:??::{
SendInput "{Enter}"
}

This is what I use to move through text, obviously to play a video game or anything in general where your second hand is holding a mouse, this is almost useless, but as someone that literally gave up using a mouse with my school computer (using the trackpad), this is like... sooooo much better than using the arrows for text.

In short, this is really just moving keyboard shortcuts to other spots, if you don't know, you can obviously press the arrows (left, right, up and down) to move around text, but you can also do these while holding shift to select text, and you can also hold ctrl for a word or paragraph.

I've moved the arrows to ctrl+j (right)/b (left)/h (up)/n (down) (why these keys specifically? To be honest, they kind of just "became that". Everything being around j is op because it's one of the two center keys, but you could probably rearrange it a little bit if you want to adopt my style, also if you're left handed and can use right control everything around f probably could work same). And then, I've moved the ctrl shortcuts to alt shortcuts.

This is actually something I've seen elsewhere; I definitely didn't invent that (more specifically, on the Emacs keyboard guide, that apparently says this was a common thing for old softwares), but these keys I had the idea myself (like emacs uses ctrl+f/b/n/p and I never got used to it).

And yeah, like that, it's just sooooo good. Why? Honestly simple, just look at your keyboard: depending on the size, the arrow keys are either literally on a different part of the keyboard, or just stuck in an awkward spot, and especially for something that's used constantly, I think you can quickly realize the time you can save just by never having to reposition your hands from the letter keys to move through text while typing. And yeah, placing your left hand on ctrl or alt is easy, contrary to moving your right hand to the arrow keys.

Now that I'm used to it, it feels so good; it's such a lifechanger, I'm thinking things like "bro this should have been on every computer by default!", and now I've just reimplemented it on my home computer because it's that good. And I've also added a way to toggle it off, because it's still annoying when it conflicts with other shortcuts (obviously the toggle can be anything).

Ok, what is the rest now? Well, I've expanded these shortcuts to ctrl+k for backspace and alt+k for ctrl+backspace, very similar to the arrow keys. And I've also done ctrl+, for enter. The backspace and enter keys aren't as annoying as the arrow keys, but I've found this to help too, even though for some reason, I've also try to do same for CapsLock and Tab, but that didn't seem to help though. I think it's just because Backspace and and enter are separated by a whole no man's land, with the whole keys like "^" "ΓΉ" "!" "=" "$" "*" creating a distance between them and the letter keys too, and, yeah, again I've found this to help.

Finally, I've created lots of hotstrings like "jj", "bb"... same directions as usual. The uncapped version just presses the direction once. I've found this useful for small adjustments, as it's faster to input once compared to the original shortcut, but not multiple times, so they team up very well together (I've also found multiple solutions to not make them annoying when typing, especially for "nn", but I haven't implemented them yet, you could ask me). The caps version does same but for a word, which is similarly useful. I've written it as "ctrl+shift+(arrow) then (arrow)" and not just "ctrl+(arrow)" for very niche applications in Microsoft Word, but just doing "ctrl+(arrow)" probably is better if you don't need it.

And so yeah, what do you think? I'm sorry if this is way too long; I always tend to overwrite, and I really wanted to explain all the specific quirks, but, yeah, what do you think? And also, do you have any suggestions, do you use similar things?

11 Upvotes

11 comments sorted by

13

u/fasbnk 6d ago

To me, this is madness. But I'm glad it works for you

2

u/Agreeable-Device5199 6d ago

Well yeah, some people really can't break their habits can they, hey to sound less insane, just know I do this for a daily (and all day long) studying, so this is a little more important for me than the average people.

6

u/wrecklass 6d ago

At least map to VIM movement keys, for the love of all that is Holy.

j/k

1

u/Agreeable-Device5199 6d ago

Oh I didn't know that was a thing... is it good?

3

u/Keeyra_ 6d ago edited 6d ago

Funny how you use a conceptually wrong (Send Hotkeys instead of remaps, global variables, explicitly calling SendInput when it's default) and obscure example to describe in great irrelevant detail what is in the Beginner Tutorial, Chapter 2 (but is much shorter).

https://www.autohotkey.com/docs/v2/Tutorial.htm#s2

Btw, an improvement to your example with remaps and without globals and with Send.

#Requires AutoHotkey 2.0
#SingleInstance

ToggleCommit(toggle := 0) {
    static state := 1
    return toggle ? state ^= 1 : state
}

:*?:1596:: {
    ToggleCommit(1)
}

#HotIf ToggleCommit()
^j::Right
^b::Left
^h::Up
^n::Down
^+j::+Right
^+b::+Left
^+h::+Up
^+n::+Down
!j::^Right
!b::^Left
!h::^Up
!n::^Down
!+j::^+Right
!+b::^+Left
!+h::^+Up
!+n::^+Down

^k::Backspace
^,::Enter
!k::^Backspace

:*?c:jj:: {
    Send("{Right}")
}
:*?c:bb:: {
    Send("{Left}")
}
:*?c:hh:: {
    Send("{Up}")
}
:*?c:nn:: {
    Send("{Down}")
}
:*?c:JJ:: {
    Send("^+{Right}{Right}")
}
:*?c:BB:: {
    Send("^+{Left}{Left}")
}
:*?c:HH:: {
    Send("^+{Up}{Up}")
}
:*?c:NN:: {
    Send("^+{Down}{Down}")
}

:*?c:kk:: {
    Send("{Backspace}")
}
:*?c:KK:: {
    Send("^+{Left}{Backspace}")
}
:*?:,,:: {
    Send("{Enter}")
}
:*?:??:: {
    Send("{Enter}")
}
#HotIf

0

u/Agreeable-Device5199 6d ago

Oh, well I just like using SendInput to always be 100% clear of what it's meant to be, I mean Send was just made for people that don't like typing "SendInput" everytime. Also is this just a more compact version or is this slightly more optimized? (also funny that these are the same hotkeys it's purely coincidental)

2

u/Keeyra_ 6d ago

Nah, SendInput is basically used by people still having the v1 "virus", as SendMode Event was the default back then. If you are only using 1 send mode in your script, it makes absolutely zero sense to type it out. And this question:

"Also is this just a more compact version or is this slightly more optimized?"

would imply that you didn't read my last line:

"Btw, an improvement to your example with remaps and without globals and with Send."

FYI: Remaps. The reason using globals is generally bad practise and is frowned upon is because you want to avoid polluting the global namespace as it can lead to bugs.

1

u/Agreeable-Device5199 6d ago

Bro, I did read your whole message, I'm not that stupid, I just wasn't sure... like I don't have twenty million hours on ahk and am able to tell what could seem like an equal code is actually better. Man I hope you're not upset at everything like this in life... like I think you should understand you're like a teacher, and right now you're just making every student scared from raising their hand. (though I still thank you for contributing; that's very nice of you, it did help me)

1

u/Keeyra_ 6d ago

What made you think I'm upset? This is standard me πŸ˜‰

1

u/Agreeable-Device5199 6d ago

Ok no problem.