Close

Double-function Modifier Keys

A project log for Dorsch 40k Keyboard

A 40-key chocolate-bar mechanical keyboard.

deʃhipudeʃhipu 08/08/2020 at 00:410 Comments

The feasibility of this keyboard hinges on the ability to use the modifier keys both as modifier keys and as regular keys. How is this going to work? The basic idea seems very simple: if you use it with another key, it's a modifier, otherwise it's a regular key. But how exactly can we tell? There are a lot of details here.

I got the whole idea from the QMK keyboard firmware, where this is called Mod-Tap. However, it doesn't work exactly how I wanted — the difference is in the time you keep the key pressed. If you press it and release it quickly (tap), it acts as a regular key, but if you hold it down longer, it acts as a modifier. This mostly works, except that sometimes I press a key too slow (especially when it's a space, pressed with my thumb), and then there is no visible effect (modifier keys don't usually do much on their own) and it seems like the switch is mechanically failing, which was very frustrating, at least until you realize what is happening (I replaced the switch before I did).

So I want to do something a little bit smarter:

This is, in my opinion, a little bit better, because no timings are involved, so you can do it as fast or as slow as you like. There is still the downside that you can't hold down the key to make it repeat — though I could probably do that with a timeout, or something like a double-tap. You also can't send the modifier key alone, so forget about using the ctrl key for shooting. It should still be easy to program, and the only extra memory needed is the variable holding the last pressed key, plus the modifier key status, which now has to be separate from the actual key status.

Discussions