Jump to content

A while ago I got an idea for using my capslock key, which I never use, as a new modifier.

I googled a bit and found out that someone already made it, but it wasn't that good (weird mapping, not useful shortcuts etc.). So I made my own and I think its pretty stellar :D

 

What it does is, when you hold the capslock key, the following changes:

I J K L => UP LEFT DOWN RIGHT

U O => HOME END

T G => PGUP PGDOWN

H Z/Y => BACKSPACE DELETE

Q W E => (ctrl+shift+z) UNDO REDO

X C V => CUT COPY PASTE

A => CTRL

S => SHIFT

F => ALT

D => CTRL + SHIFT

WIN + CAPS => CAPS

 

It took me around a week to get used to it, but once I did, it sped up my coding dramatically, especially because I don't need to reach for the mouse anymore to select text.

 

I've put the AutoHotKey file in the attachments if anyone is interested.

And if you have any ideas on  how to improve it, please tell xD

CapsScript.ahk

Link to comment
https://linustechtips.com/topic/727375-caps-script/
Share on other sites

Link to post
Share on other sites

If you found these sort of binding dramatically improves the rate at which you can output code—do you include the time 'staring at the sky' figuring out the right solution?—then you may want to consider either learning to use Vim or finding some kind of "Vim-mode" for whatever editor or IDE you use.

 

Many people, especially macOS and Linux users that write code for a living, opt to rebind their caps-lock key to CTRL when held, and ESC when pressed and released. ESC is the key typically used to to toggle between (insert|visual|visual-block|command)-mode and normal-mode, though CTRL+[ also works if you prefer the command-line version. In insert mode your keyboard behaves more-or-less like you're used to. "Press 'H' and the 'H' character is inserted into your document behind the cursor.

 

In normal-mode all of the keys behave sort of like what you're describing: the motion keys are HJKL rather than IJKL but the idea is sort of similar, with considerably more bindings. You stay in normal mode until you press one of the keys to leave normal mode; typically something like i or A to insert more text, but vim has several other modes that aren't typically found in other editors. The benefit of mode-toggling is that it makes many of your bindings easier to press (e.g. capslock+z isn't very comfortable on a standard US-QWERTY layout). It also allows for more complex motions than just spamming the button. For example instead of "KKKKK" to go down 5 lines with your example, you could type "5j".

 

I'm not trying to sell you a new text editor, but you may want to Google around and see what those guys have gotten up to. They've been hacking on this stuff for quite some time and come up with an input paradigm that seems to have survived mostly-intact since the late 1960s. If you're using an IDE or Text editor plug in then it's likely you'll also gain tighter integration with that editor. For example the ability to quickly perform search and replace, record & play-back macros, access to yank-rings or registers, more precise cursor positioning, and the ability to easily repeat previous edits. If you decide that kind of power isn't something you want then stick with what you've done.

 

Alternatively, if you really like chords, you may want to look at EMACS or EMACS-like keybindings for your editor. While not as expressive as Vim's normal mode people more familiar with contemporary mode-less editors might find it easier to use. While you would lose the nemonics you've tried to setup (e.g. A=ALT, S=Shift) you're still likely to gain the editor/IDE integration. MacOS ships configured to accept many of these bindings even in ordinary text boxes and Linux graphical interfaces can likewise be configured.

Link to comment
https://linustechtips.com/topic/727375-caps-script/#findComment-9249418
Share on other sites

Link to post
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

×