Xah Fly Keys Major Mode Key Problem

By Xah Lee. Date: .

Been sketching a way to solve the major mode key problem of xah fly keys. [see Emacs: Xah Fly Keys]

Here's the problem. In xah fly keys, there is a problem of major mode keys. That is, major mode uses Ctrl+c prefix by emacs convention. Now, Ctrl+c is hard to press, and also this convention is a big mess. Because its not just Ctrl+c key, because some those key is actually reserved as user custome keys. So major modes ends up using combination of

Since major mode keys are used a lot, especially magit and org, so you have to press these difficult keys a lot. So it reduces the usefulness of xah fly keys system.

The most easy solution, is just to collect the commands you want of a major mode, and map them to meta key. With a hook. Or, map them to a leader key such as f9. One shot command should use leader key sequence, while repeatable “hold key” commands use Meta. If one want to be efficient. (the advantage of hydra is to combine them. So, saving keyspot, but with cost of complexity)

Now, the problem of the above most simple and easy way, is: it gets into the meta keyspace, and require a separate key spot e.g. F9 as leader. (as such, they are completely separate/independent from xah fly keys, for good or bad.). The reason using meta keyspace is not that ideal, is that, we want the xah fly key system to use less keyspace as possible (currently just Ctrl and maybe count CapsLock ). Because meta, alt, function etc keyspots are precious. Other app or Operating System need them too. And the reason using f9 or any function key, is not that ideal, is because again in general, one should minimize keyspace. In particular, many laptop keys, there's no function by default, or that it's hard to press on laptop, and also those 60% in vogue in a niche keyboard community makes it very hard to press function keys. Kinesis doesn't have nice function keys either. Nor ergodox.

But, if you don't mind using Meta keyspace or F9, then, problem solved. It is the most simple, easy to understand, and efficient system, used together with xah fly keys to solve the major mode key problem.

considerations

In designing this system, here's things we need to consider:

Physical Keyboards consideration is important, for example, otherwise we could assume everyone is using a full external IBM PC keyboard. Which has nice fat F9 key. But the fact is, a lot people, perhaps 50% of emacs users, are not on such keyboard.

Emacs convention is important consideration, because xah fly keys works inside emacs, and need to have smooth integration with thousands of existing modes and packages.

Ease of implementation in elisp is important to consider, because some keyboarding setup cannot be done in emacs, such as remap capslock, or difficult need hack such as sticky modifier, or dual function modifier.

Operating System key convention in use. We also need to consider. For example, on Microsoft Windows, you probably don't want emacs to use ❖ Window key, and in particular ❖ Window+l, since it cannot be remapped.