Implementing multi-layer keyboard in FreeBSD syscons, and control keys repeat rate
freebsd at edvax.de
Tue Dec 5 00:08:57 UTC 2017
On Sun, 3 Dec 2017 17:30:39 -0700, Jack Rosenthal wrote:
> I'm trying to implement a multi-layer keyboard layout for the FreeBSD
> console (sort of like the Neo layout, there's more things that change
> the keys than just shift). If you're curious, the keyboard spec is here:
> Here's what I've got so far:
Interesting effort. However, I think traditional syscons (sc) will
be abolished soon and fully replaced by NewCons (vt) due to the fact
that modern X doesn't work until you switch to vt. Maybe you can
also investigate how vt does things, and find a solution there?
> Essentially, from what I can tell, FreeBSD only supports Shift, Ctrl,
> and Alt (and combinations there of) for modifiers. So I've currently got
> symbols on the 'Alt' layer, cursor controls and numpad on 'Ctrl', and
> the real control keys on 'Ctrl+Shift'.
>From my understanding (many years old!), this is correct, as those
are the esential modifier keys on the i386-oriented hardware
architecture for keyboards and their interfaces.
> Besides having to use 'Ctrl+Shift' to use the real control keys, the
> arrows etc. on the 'Ctrl' layer seem not to repeat when held down.
That is strange. Repeat should be present on all layers where a
"normal" key is part of the combination (even ESC). Additionally,
the lower levels (keyboard driver and sc input handler) typically
deal with "key down" and "key up" events obtained from the keyboard
interface and will generate the repeat from that (for keys that
can have repeat abilities).
> So, a couple of questions:
> 1. Any hacks to get that key repeat working? Honestly the most
> inconvenient part...
No idea anymore, sorry... my days of lowlevel hardware interface
hacking are over... ;-)
> 2. Any way to make the Ctrl key send Ctrl+Shift? I was thinking that I
> could make a function key for that, but cannot find any way to do
> that from the manual (kbdcontrol).
This is something to be implemented in the keyboard driver directly,
i. e., atkbd or ukbd - and re-check with the lower-level sc (or vt?)
interface to those drivers, usually there are ioctl()s doing it.
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
More information about the freebsd-questions