aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 0a3171eeed98df0b08a24c2ac590cca6097c83a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Dakkar's Keyboardio Model 01 Firmware
 
This is mostly a stripped-down version of the official firmware, with
custom keymaps and two custom plugins.
 
## Keymaps
 
The keymaps are in [`keymaps.h`](keymaps.h), which should not be
included directly. [`#include "keymap-wrapper.h"`](keymap-wrapper.h)
instead! The wrapper defines the (hacky) `ColorKeymaps` macro that
transposes the array-of-pairs keymaps into pair-of-arrays (actual
keymap, color map).
 
This allows me to define, next to each key, what "class" of key it is,
and therefore which colour its LED should light up. The classes are
defined in [`key-classes.h`](key-classes.h), and the corresponding
colours in [`color-themes.h`](color-themes.h).
 
## Macros
 
The only non-trivial macro is [`fvwmMacro`](macros.h): it selects the
`FVWM` layer, and also acts as the `LeftAlt` key.
 
This is because all the functions of my window manager (fvwm2) are
accessed with key combinations using the left "alt" key, for which I
have a dedicated layout, plus I need alt-tab to switch to a different
window, and that needs left-alt to stay pressed.
 
## Plugins
 
### DakkarColor
 
Source: [`DakkarColor.h`](DakkarColor.h)
 
This plugin defines a `LEDMode` sub class, which uses a color map as
built by `keymap-wrapper.h` (i.e. a DefaultColormap) to assign each
key its color.
 
In addition to simple colors, it allows you to set a function pointer
(look at the `num-breathe()` function in `color-themes.h` for a
minimal example).
 
### ColorPicker
 
Source [`color-picker.h`](color-picker.h)
 
This plugin defines a `LEDMode` subclass that, when selected, takes
over all key presses, and turns half the keyboard into a control panel
to paint the other half.
 
The Fn (palm) keys switch into editing mode, with that half housing
the controls.
 
The controls are:
 
* the keys of the 2 outermost columns show the value of the 8 colors
  in the palette; pressing one selects the color
* 3 rows of 4 keys to change the selected color in the HSV space (one
  row for H, one for S, one for V; in each row the keys do -10 -1 +1
  +10)
 
Pressing a key on the non-control half of the keyboard assigns the
selected color to that key.
 
The plugin also defines a Focus (serial control protocol) command
`color-picker.dump` which prints the current values of the 8 colors,
and a compact color map for the keys.