On 2016-02-14 12:05 Holger Wenzel wrote:
I didn't find a way to do this with the default driver and switched to
the TMK driver. There is a guy called frobniac who has made a german
layout for the Ergodox keyboard.
https://github.com/frobiac/tmk_keyboard
I borrowed generously from his mappings as described in
https://github.com/frobiac/tmk_keyboard/blob/master/keyboard/frobiac/README.md
For me to get going I copied the definition of the RMOD_KEY action
#define MODS4(mods) (((mods)>>4 | (mods)) & 0x0F)
#define ACTION_RMOD_KEY(mod, key) ACTION(ACT_RMODS, MODS4(MOD_BIT
(mod))<<8 | (key))
1. How do I specify umlauts? The C sources do not seem to have any
KEY_Ö or similar (at least I could not find any). Thus I assumed that I
cannot use umlauts in a json layout definition either.
Unfortunately this is a bit tricky. The USB spec has no way to do this,
so as Chris said you are stuck with OS-specific hacks.
I would recommend using the TMK firmware for this; it makes it a bit
easier to write macros you need for this kind of thing. It is more
complicated than the default atreus-firmware codebase but it has more
features:
https://github.com/technomancy/tmk_keyboard/tree/atreus/keyboard/atreus
Details about non-USB-spec keys here:
https://github.com/tmk/tmk_keyboard/wiki/FAQ-Keymap#input-special-charactors-other-than-ascii-like-c%C3%A9dille-%C3%87
2. Is it possible to define more than one momentary layer (like the
fn layer)? The standard layout defines the L2 as "sticky"(?),
i.e. you have to explicitly exit the layer by pressing a key.
This is another feature that is a lot easier to implement with the TMK
firmware. Unfortunately the fn stuff in the default codebase is kind
of special-cased, and not properly generalized to allow it to work
with more than one fn layer.
1. How do I specify umlauts?I can't help with this one, but may be able to help you find a way to
see what keycode another keyboard is sending. Then you could just
assign the appropriate keycode. What operating system are you on? I
use OS X, and use Karabiner's EventViewer to see what keycodes are
being sent.
2. Is it possible to define more than one momentary layer (like theYes, but it will take some work. The layer that is momentarily
fn layer)?
switched to is hard-coded here. You may want to look at some of the
ideas that I'm exploring in pull request #50. As to how ["function",
2] works, take a look at the zero-indexed array defined here. You will
see that this is a call to the C function, layer_jump(). That function
is hard-coded to jump to layer 2. (The two 2's are actually
unrelated.) I haven't looked at the JSON layout much myself, so I
don't have other details for you.