[atreus] Re: Fwd: Re: Umlauts and Layers - atreus - FreeLists

  • From: Alexander Baier <alexander.baier@xxxxxxxxxxx>
  • To: Holger Wenzel <drholgerwenzel@xxxxxxxxx>
  • Date: Sun, 14 Feb 2016 17:32:44 +0100

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))

I read through the tmk documentation located at docs/keymap.md but could
not find out what the ACTION macro does, or what ACT_RMODS is, or how
these two defines actually work. Do you know why these macros are
structure this way?

On 2016-02-09 12:05 Phil Hagelberg wrote:
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

Thank you for the pointers, I started to look through the tmk
documentation and will try to put together my own layout.

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.

Do you have some pointers for this as well? I did not find any
documentation in docs/keymap.md mentioning sticky or oneshot
modifiers/layers.

On 2016-02-08 19:04 Chris Gerber wrote:
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 the
fn layer)?  
Yes, but it will take some work. The layer that is momentarily
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.

As mentioned above, I decided to go with the tmk firmware as Phil and
Holger recommended, but thanks for the pointers and explanations!



Regards!
-- 
Alexander Baier

Other related posts: