I really would love to see how dual role modifiers perform programmed in a microcontroller. I have spent some time prototyping variations in AHK, and implementing them properly in Linux is one of my big future goals. So, here I am posting my manifesto.
A lot of the functions I am using are tied with OS interface, but there are obviously common issues worth discussing:
1. A major one being, how do you deal with rollover? It is natural for multiple keys to be held down while typing quickly, without the intention for triggering a chord. AHK seems to handle an endless number of key remaps very effectively, so I am able to actually remap every single key to
a) detect if D-R mod key is held
b) 'sleep' for 70ms, and detect if D-R mod key is still being held
c) if yes, overwrite key function with modifier layer
d) else, perform original key function
(in addition to buffering input of the original D-R function to ensure the correct order of keypresses)
Sorry if this is explicit in your code, but I thought I would ask for some ideas in English (well, Japanese is okay too but :P)
If this were to be a mainstream implementation, what are the foreseeable issues which experienced and laypeople alike might encounter? Personally, I think achieving this sort of behaviour in software, let alone an interpreted script, will always leave it open to conflicts when CPU(s) are held up. However, in my mind this is a compromise worth taking for a lot of users. I plan to spend a lot of time researching possibilities for a mainstream implementation.
2. I don't think spacebar is good for a D-R key at all for this reason (in addition to upstroke activation being too annoying), even though it is clearly the most popular candidate and definitely useful in many specific scenarios. Likewise, I believe common alphanumeric keys should be excluded in default layouts - chorded keyboards should be classed in a separate use category from mainstream/downstroke activated keyboards, otherwise confusion/feel will forever prevent its acceptance. In the case of a kinesis-style mapping, backspace (left thumb) works very well. Tab is another good candidate (capslock also, but often reserved as dedicated ctrl). An actual kinesis/ergodox can use capslock, home, end (del also, but better as a dedicated mod key) - for the left side alone. On the right side, ralt, ' and \ are natural candidates.
3. Auto-repeat (see next post)
4. As for usage ideas, my position is that any layer function that is truly invaluable deserves a dedicated non D-R modifier key, because of the issue in 1. Therefore I treat any D-R layer as a 'convenience' layer. You can put in some useful highlight+copy/cut/paste style editing macros in there. Window functions like ctrl(shift)-tab, virtual desktop switching. Mouse functions can be vital to alleviate RSI. If you could make a quick record/play text macro function bindable to number keys etc that would be great. When combined with software mapping, mouse gestures, per application shortcuts, and much more. Even a simple alias for ctrl+alt+shift has its uses. On the kinesis/ergodox I count >600 accessible global shortcuts - for the LHS alone. I am currently testing use of ~120 LHS shortcuts.
5. In the end the most important problem is standardisation. This will mean common functions will take a long time time to emerge from the community's choices. Related issues apply to the mouse button equivalent also, rocker gestures. One which incorporates some smart mnemonics will likely prove the winner. So, it's worth discussing imho.
Anyhow, looking forward to see what hardware functions you guys come up with.