Moving the Ctrl Key
emacswiki.org
emacswiki.org
There are two Alt and Ctrl keys on the keyboard. Use both, and use both halves of the keyboard If you're doing a combination like Ctrl F, use the right control key. If you're doing Ctrl-l, use the left control key.
In general, when using these modifier keys, make sure both your hands are being utilized.
Also, there's simply no rule that says one must use the pinky for the Ctrl key. Use some other finger. In fact, insisting on using the pinky is a sign you are also insisting on using one hand to enter the key combination.
Perhaps it slows me down a little, but my performance is not correlated with typing speed.
Thumbs are good for layer switching, keys like Tab and Enter, etc, which are important but not very-very frequent.
Here's the XCompose file I use:
This is the closest thing I found just now by googling, though by similarly 'directional' reasoning I think Del and Backspace don't belong in the central column and should be on opposite sides: https://www.keyboardco.com/keyboard/truly-ergonomic-227-mech...
As well as enter/backspace/delete, it's also useful to have esc/tab near spacebar. https://github.com/manna-harbour/miryoku
e.g. A popular off-the-shelf keyboard which supports this layout https://www.zsa.io/moonlander/
> ...below the space bar
Well. Then you'd need to move your hands, or stretch your fingers a bit. It's better to have a smaller spacebar key, to allow for extra keys.
What you're looking for, is a ISO Level 3 Shift (at least as far as X11 is concerned. Don't know the terms on windows).
I configured my keyboard to use the WIN keys as that. Super I only use for window-management related things, which I don't use is all the time and I can configure the actions to be on my right-hand. Therefore, since CAPS is useless, I remapped it to Super.
This way, with the dead keys, you can create many composed symbols. For writing French, an US layout is perfect, and I can type as fast as on a French keyboard. For your particular case, I don't know how to create the Ż, but Lvl3 + e + Z -> Ź. It's likely that if you used a different layout, this would be possible.
---
[0] I've tried multiple times to get a keyboard layout like on a mac, with its deadkeys system, but never managed to remap the AltGr properly.
If I recommend Emacs to anybody today, the first thing I would tell them is to:
- enable evil mode and prefer its interface to vanilla Emacs
- install doom-emacs and learn to love the leader key instead of the C-[...] combinations
And of course what you said about moving your whole hand and using both hands still applies, including when you need to use the shift key.
I started to develop RSI once in 2015 and got my act together after that scare with an ergonomic setup and better practices. It's been smooth sailing since, always as an Emacs user.
Citation needed. Even the poster child for that rumor, RMS, fixed his problem by switching to a better keyboard.
Also, in jest: citation needed on the RMS claim. We can all play that game ad absurdium :)
> In the mid 90s I had bad hand pain, so bad that most of the day I could only type with one finger. The FSF hired typists for me part of the day, and part of the day I tolerated the pain. After a few years I found out that the pain was due to the hard keys of my keyboard. I switched to a keyboard with lighter key pressure and the problem mostly went away.
Caps Lock as Ctrl will serve most Emacs users for quite a long time, and it's traditionally where the key was before IBM in their infinite wisdom moved it in 1986.
I'm of the opinion if you're regularly pressing keys on the keyboard without using the tips of your fingers and/or thumbs you're doing it wrong.
Then don't contort. As I mentioned in another comment, insisting on keeping your fingers on the home keys is a bad idea. You should never bend the wrist while typing. When I want to hit the Ctrl key, I move my whole arm down and to the left so that my pinky (or any other finger) is over the Ctrl key. Moving your whole arm is what is recommended.
BTW, I'm not against remapping to the Caps Lock key at all - I grew up on those keyboards as well. I am merely dismayed that it is the first advice given, when it is fairly minor in preventing RSI.
FWIW: if you are RSI prone, you to be minimizing time spent on a keyboard in the first place, and heavy editor use is probably just a bad idea in general.
And before you say I'd be faster with a typical home row setup, I program fast enough to compete with the best in the world in competitions, editor and keyboard enthusiasts talks a lot but they don't really deliver that extra speed in practice. They optimise for one use case and ignore the others, so they don't get faster overall.
I lost the speed because I wasn't doing as much documentation as I used to with qwerty. For development, that loss of speed hasn't made any difference because I type just as fast for development purposes.
But my main point is the people I know have not optimised things for speed, they have done it for comfort. A ten hour trip in a plane takes the same time in business class as it does in economy but one is a nicer way to travel.
I wouldnt run out and tell everyone to change their setup, people are usually driven to it for one reason or another, either just curious or have an issue they need to address but on a topic of ergonomics, thats exactly what ergo keyboards are about.But that makes touch typing ridiculously hard. It is extremely easy to fail to return your hand correctly to the home row and now everything you type will be off.
With Vim and Caps Lock mapped to Ctrl & Esc I never have to completely leave the home row.
I just just use the side of my palm (top of fifth metacarpal) to engage C.
Super comfortable, low effort, no leaving the home row.
Since then a great many have come up with actually ergonomic keyboards and they virtually all have something in common: modifiers easily reached with the thumbs while the hands are in their home position.
No crazy "moving the entire left hand to not hit ctrl with the pinky". That's not ergonomic. At all.
If the layout is QWERTY, left hand on asdf, right and on jkl; and the thumbs on modifiers/spacebar.
Hitting modifiers do not require hand movement and do not require stretching the finger underneath your other fingers.
If anyone's serious about this, consider an actual ergonomic keyboard (Ergodox, Keyboardio, Kinesis, etc.).
I picked Japanese keyboards --even though I don't speak japanese-- for several reasons: they're ubiquitous, they can be had with Topre switches (I much prefer Topre than Cherry), the spacebar is tiny so I don't need to distort my thumbs to reach the modifiers, they have lots of modifiers (due to the various input methods japanese has) and, well, the killer...
Laptops with japanese keyboards are a thing.
Laptops with, say, a Keyboardio keyboard: not so much a thing (unless you carry your keyboard and your laptop of course).
I remap the entire keyboard to be basically QWERTY with Hyper and Super in addition to Ctrl/Alt/Meta/Shift. Super is dedicated only* to the window manager and nothing else. Modifier+ijkl sends the actual arrows key code. Works in every single app.
Life is good.
Sorry, but ergonomists disagree. Moving your whole hand + arm, as long as you are not twisting your wrist, is in general recommended.
I've asked them about keeping the fingers on the home row, and the response has always been: "No good research to support it, nor any to disrecommend it."
While most people do not have an ergonomic keyboard then what you say is likely true and most ergonomists would agree but I think they would also agree that even better is not have to move and use an ergonomic keyboard. That comes with cost and time which is why most still dont use them.That's actually kind of nice to hear - I'm self-taught when it comes to typing (having to get chat messages out fast in StarCraft online multiplayer waaaay back), and naturally fell into a style that kind-of hovers my hands on the edges of the keyboard, using my shoulders and elbows to push my hands inwards when the center keys are needed. Relevant to the topic: Pinky on ctrl requires no twisting, just bending the finger down.
Whenever people (mostly co-workers) realize how I type, they almost always think it's kinda crazy, since I can hit keys without feeling from the home row..
This is the thing I miss most from X vs MacOS. On Mac, the command key is the primary shortcut modifier both for apps and for the OS / "window manager".
There's also home-row mods that's very popular with tiny keyboards, and is arguably even more ergonomic.
Before using a japanese HHKB Pro JP I was using a reqular US QWERTY HHKB Pro 2. But then I figured out a narrower spacebar and more modifiers would suit me best. The big enter key on the HHKB Pro JP may not be for everyone that said.
As for the setup, I don't have a public Github page with my config (I use Git but with bare git repos on my own servers) and it's actually going to depend on how you did configure the DIP switches on the HHKB Pro JP (it's got 6 dip switches IIRC) but it's nothing out of the ordinary.
I'll just throw random infos that may get you started if you go this route...
I'm on Linux so it's just one .xkb file which is mostly a modified QWERTY layout to add Hyper and Super modifiers. I had to mess up a bit with the japanese Henkan and Muhenkan modifiers keycodes IIRC.
As a sidenote I'll say that you probably can do everything from the .xkb file but xkb and xmodmap (to set up modifiers) aren't mutually exclusive.
In the .xbk file a "regular" key like, say, 'x' stays of the type ALPHABETIC but I modified i j k and l to be FOUR_ALPHA and they're then (example for 'i'):
key <AD08> { type= "FOUR_ALPHA", symbols[Group1]= [ i, I, osfUp, osfUp ] };
where FOUR_ALPHA has "Hyper" in its short modifiers list.I use Hyper for a lot of shortcuts (I configured Hyper to be the key at the left of the spacebar) but not for ijkl: Hyper+ijkl is used to send arrow keys code, always.
As for Super I use it only for my WM: so I configured one key to be Super in .xkb and then my WM (Awesome WM) only requires one line to be modified to tell it which modifier you want to use for shortcuts.
It's not complicated but it took me some time to set up everything: mostly because I had no idea how the .xkb file format was working and it certainly looks a bit alien.
I versioned my .xkb keymap files in Git and I experimented. I'm still under X so an xev window open to see the event (not sure how that works under Wayland) / keycodes sent, an editor to edit the .xkb file, commit changes as soon as good progress were made:
xkbcomp mykeymappings.xkb $DISPLAY
To test the new settings. Rinse and repeat.Once it's set up, it's set up for good.
Coordinating both hands to press key combos seems much harder than doing that with just one hand.
Also, in many cases (unrelated to Emacs), one hand is on mouse, so pressing keyboard shortcuts by one hand is much more useful than depending on both hands.
Anything is harder until you get used to it :-)
I had to make the shift. It wasn't really an option for me. Life improved after I made that shift.
> Also, in many cases (unrelated to Emacs), one hand is on mouse
While this is unfortunately true, it is still considered unergonomic by most ergonomists (any mouse use is unergonomic if it is continuous). They always recommend using the keyboard if the mouse can be avoided.
In a past life I did CAD work with a mouse. Horrible ergonomic issues ensued. Life got a lot better once I switched to programming.
...though I will admit that I have a bad habit of hitting C-x one-handedly (I have my system configured to the Dvorak layout).
You can also remap both caps lock and enter to control when they are used in combination with other keys. If you press them alone then they can be caps lock(or escape) and enter as normal. Pretty easy to do in karabiner. No RSI issues and you never have to worry about hunting for the ctrl keys with your pinkies on the bottom of the keyboard.
no it's not. insisting on using the pinky is an attempt to keep the rest of your touch-typing fingers remaining in place on the home row, which is the main reason using opposite hand shift keys is appealing in the first place.
If you're going to take your fingers off the home row, sure, use opposing index fingers for everything.
I think the recommendation to remap control onto caps lock is fundamentally misguided and based on poor typing practice. Many Control bindings are on the left (C-x, C-c) and using caps lock for them (without sticky keys) would be very unergonomic.
What I do is remap control, alt and windows key such that control is closest to the space key (like windows, alt, ctrl space ctrl alt windows). Then I can use my thumbs (symmetrically on both sides) to type any control key sequence.
Some guitar pedals wired as momentary switches wired to a teensy.
It's been using it for so long I forget they are there. I haven't even checked on the teensy since I can remember.
I instinctive tape my feet even if I'm working away from my desk. If I'm zoned in I can even stamp my foot as though the pedal has become unresponsive...
I don't use Emacs as much as I used to but that's why I built them.
The very first version I had predate the current setup and was a button on the underside of my desk that plugged into my keyboard with an audio jack and jury rigged internally to ctrl (didn't have alt for some reason). Thats got to be like 25 years ago now.
It was so inconvenient as pushing my knee up was hard work (I was convinced this would stop me getting a DVT from long desk hours... But only in my right leg I guess?) esp as I got a new desk that had more clearance, if I moved the keyboard it might unplug or pull the button off the desk. And finally once I got a new keyboard the wire would trigger the button and I couldn't think why so I ditched it.
What a blast from the past!
The teensy using the keyboard library just holds ctrl or alt for the duration.
Linux is more finiticky but xkb lets you do the same (Linux or x or whatever seems to track which keyboard is which and doesn't mix inputs).
No idea bout Mac.
I use Emacs with vim bindings. I also have a Moonlander and I absolutely love it. I've got my QMK set up so that the key just below my left thumb (I press space with my right hand, so left is best for this—you might switch it depending on how you hit the space bar) is ESC on tap and Control on hold. This is the single-biggest improvement to ergonomics from a software side. Spend the time to figure out how to get this done, and then get used to it. Your hands will thank you until you breath your last breath.
I also use dvorak, and the keyboard setup every time i used different keyboard was getting a bit annoying.
It's happened more than once with Chrome's Inspector or in the shell. It would be even worse with Emacs in terminal mode, where ESC is a prefix key.
For example, any press under 200ms is ESC, anything over will register as Ctrl. The timeout can be adjusted to work and not capture that time that you press it but then decide you don't want it.In vi/vim I never hit the escape key, because the old terminals I used in high school didn't have an escape key or arrow keys. ctrl and left curly bracket is escape and h, j, k, l are to move the cursor.
The muscle memory is too strong to change after 30+ years so change the keyboard mappings instead!
This makes the Ctrl sticky, thus emulating the modal behavior of vim, but using emacs bindings. It also has some clever escape sequences that let you input complex chords without ever having to press more than one button at a time.
I have gotten so used to it that I have started looking into a way to make a solution that is global across my whole system (Linux). So far I can emulate some of the behaviour using something like kmonad (https://github.com/kmonad/kmonad) although some things like repeated keystrokes cannot easily be expressed using the configuration language and requires a more low-level approach.
My final changes were, in order of effectiveness:
- Put Ctrl on Alt, next to the space bar. Use thumb to press. This saves a huge amount of pinky and wrist contorting.
- Put Alt on Win, next to the now Ctrl key. Also use thumb to press. With both of these my pinkies have way less to do.
- Put Backspace on CapsLock. Though this does use a pinky finger, it is much easier to type than the normal backspace location requiring a hand full stretch.
- Use the Dvorak layout. Much less finger travel since more is on the home row compared to Qwerty.
- In Vim, use Ctrl+C instead of Escape to leave insert mode. Though not exactly identical, Ctrl+C is almost the same as escape and especially with the above changes is much easier to type than hitting the actual escape key.
I have been typing for 15 years since and I have zero hand pain.
everything else is a meme
I generally use emacs when I'm doing quick edits and don't want to open a GUI, or if I want to take notes. After I got used to the bindings for movement I realized I was able to do them globally. This pretty much allows me to have great keybindings (when Ctrl is remapped) on any editor or application I am using. If you don't already do this I highly recommend trying it for a week over the arrow keys. Just be careful. It may be hard to go back.
This also dramatically improve the experience in other "Ctrl heavy" applications.
P.S. I also use Caps Lock for switching layouts and never been happier.
“You can try” he said with a smile.
His keyboard keys were all blank and he was in Dvorak.
“…maybe it’s best that you drive.”
(I'd have to twist my wrist a bit to use caps lock as a control key, so perhaps my hands are just an odd shape. But i do like having symmetrical meta keys anyway, as i can perform the same motions with both hands.)
I don't think I could even bend my pinky comfortably to do this action.
All my CS1.6 teammates used this. Learned in compsci classes it wasn't as ubiquitous as is first thought.
I often perform cut/copy/paste with CTRL+Insert,SHIFT+Delete,SHIFT+Insert which is fine on a full sized keyboard. It's why I can't buy so many keyboards that have "optimised" the layout.
But twisting the palm to hit Ctrl always struck me as a terrible idea, maybe because I have large hands. Better remap Capslock.
It's still possible to hurt your thumb from overuse, but it's a far stronger finger than the pinky, and no stretching is involved.
That makes the key on the left of the spacebar as Ctrl and the key on the right of the spacebar as Alt. This is much better, in my opinion, than using the pinky on the Capslock.
Hand size and posture do vary a lot so looking for the right setup is important but learning to be ultra relaxed and effortless in your typing (and chording) is much more portable
With tap-hold functionality, the key behaves the same when tapped, but as the modifier key when held.
So, you can put Shift/Ctrl/Gui/Alt as tap-hold underneath asdf and jkl; on the home row.
This can be achieved on a fancy keyboard, or with cross-platform software like kmonad.
A one-shot shift under one thumb is also amazing, if you have such a keyboard.
However, give me some easily accessible Copy/Paste and Undo/Redo buttons.
Yes, it's a good move for people using control a lot. I am using evil mode in emacs so I have the escape in the same place.
I also use homerow mods which i find really great.
With the homerow mod, the homerow keyas 'asdf' and 'jkl;' are mirrors of 'gui, alt, ctrl, shift'
So the a key is an a except of you hold it down and press another key, in that case it is the gui key.
It works really well in emacs as well as on my tiling window manager where there is a lot of use of the combinations. (I have no idea why my font appears different)However, since I am left-handed, the experience might be a little different for me, since I bias towards the left for all modification keys (that includes the Alt key.) The idea of having those keys comfortably near the thumb is interesting though, as some have mentioned, like having a trackpoint so close by when typing (I also remap the top buttons to favor me using my left hand more.)
Assuming average case, most of the complaints in this thread can be solved by using the side of the palm (top of fifth metacarpal) to engage C. Requires no remaps, doesn't take long to get used to, is totally comfortable, and leaves you on the home row.
One trick, not mentioned in the linked doc, is to move C-x to something else using Emacs' very special "ctl-x-map".
Check one of the mapping using "Ctrl + one finger of the right hand" which is a functionality you don't use much and map that to ctl-x-map.
If only there were more non-US people making decisions in tech, we could have had a dedicated key for that, the way Japanese keyboards have a bunch of Japanese-specific keys, but alas.
dconf write /org/gnome/desktop/input-sources/xkb-options "['ctrl:swapcaps']"
But I'm not sure where it fits; in the Gnome section, or the xkb section?NOTE: this overwrites the value, you should do a `read` first
It's convenient to have a mode for typing in caps for stuff like "MAX_NUM_WORKERS". -- Especially if you're using Shift on the opposite hand from the letters you're typing, rather than just stretching to hold down shift the entire time.
But, the standard keyboard design isn't a very practical one. -- I think Caps Lock is better placed behind a Fn key, in the same way that "brightness up/down" is behind a Fn key on most laptops.
Nowadays I have convenient access to it via a mod-key on a programmable keyboard, but still don't use it.
Holding shift seems to feel totally fine for my hand geometry, it's the extra distance to CTRL for my pinky (without shifting my forearm down) that gives me wrist pain.
Are you customizing keyboard mappings via setxkbmap or equivalents?
symptoms: customizations done via setxkbmap or equivalents have no effect in VS Code.
solution: use "keyboard.dispatch": "keyCode" in your settings and restart VS Code.