Perfect! Now you just need to repeat the process for whatever other cmd shortcuts you’d like to map as ctrl shortcuts. Now you should be able to test out the new mapping - open up a terminal and use the cmd + c shortcut - it should send a SIGINT like ctrl + c typically would. Make sure you include the 0x prefix - in my case, ctrl + c is Unicode 0x3. In this case, we want to emulate ctrl + c, so open up Key Codes and with the window focused, press the key combination.Ĭopy the hexadecimal code under the Unicode section into the iTerm field. I use the Key Codes app to figure out what the appropriate hexadecimal code is for the key combination that I want to emulate. Select the ‘Send Hex Code’ option in the select box. This is the literal shortcut you’ll use to trigger the mapping, so you should be pressing the shortcut that you actually want to be pressing on a regular basis. Click the field to set the keyboard shortcut - let’s say cmd + c. In the ‘Key Mapping’ section, click the plus button to add a mapping. Open up iTerm’s preferences window, and head to the ‘Keys’ tab. ITerm is pretty configurable, so what we can do is set up certain key combinations to forward hexadecimal key codes for the ‘proper’ keys. Any terminal programs that use ctrl shortcuts are affected (like nano, for example). This sucks, because muscle memory from using Linux makes me reach for what is now my cmd key. Expectedly, terminal commands like ctrl + c and ctrl + l (which clears the buffer, super useful) don’t just work with the cmd key - you need to use ctrl. Where it doesn’t work out so well, is in iTerm. Sweet, now I can reach for the key I’m used to and get cmd instead. So, using macOS’s built-in keyboard configuration, I mapped my ctrl modifier to be cmd, and my cmd modifier to be ctrl. On macOS, the cmd key tends to be a pain in the ass.Ĭopy and paste, quitting applications, and all sorts of other things that you’d typically do with the ctrl key on a Linux or Windows machine, all use the cmd key instead. Using Linux, or even Windows, the ctrl key tends to be the only real modifier key you need to worry about, especially in the context of using a terminal. I use macOS, both on my laptop and desktop (a Hackintosh). I had made the switch to caps lock control around a year before I picked up my HHKB, so it was no problem using it, mostly. Where’s it gone to? It’s replaced the bastard child of keyboard keys, Caps Lock. The keyboard is really a topic for another post - the reason I mention it is the placement of the ctrl key. After trying a couple different kinds of keyboards, I eventually settled on a Happy Hacking Keyboard.
0 Comments
Leave a Reply. |