Apologies for the incomplete instructions; I haven’t had much time in front of a real computer in the past few days. I’m going to try to answer some of your questions, and maybe a couple that you didn’t ask, but might be helpful anyway:
- How does
LSHIFT()
work?
Each key defined in a keymap comprises two bytes of data. For “normal” keys, one byte is the keycode sent via USB to the host computer, and the other is a set of bit flags. Five of those bit flags are used to tell Kaleidoscope if it should add a modifier (shift
, control
, et al) to the USB report when that key is pressed, in addition to the keycode. LSHIFT()
is a C++ preprocessor macro that sets the “left shift” modifier flag in the flags byte of the Key
object in the parens.
- What does
Key_0
mean?
Key_0
is a pre-defined Key
object that stores the USB keycode value for the US QWERTY 0
key. When you tap that key, you’ll get the digit 0
(if your OS keymap is US QWERTY), just like Key_A
will get you a letter a
(again, assuming US QWERTY).
Combining that with above, LSHIFT(Key_0)
will get you the same result as holding down shift
and pressing 0
.
- What does
ShiftToLayer()
mean?
ShiftToLayer()
is entirely different, and has nothing to do with LSHIFT()
. Instead of setting a modifier flag, it sets flags telling Kaleidoscope that when that key is pressed, it should activate the specified layer. If that layer has a higher number than the current highest active layer (i.e. it comes later in the definition of keymaps
), any keys defined on that layer will take precedence over keys on other active layers.
- What’s up with lldata’s firmware sketch?
That sketch has a few Danish characters (Æ, Ø, Å) mapped on the FUNCTION
layer by means of the macros L_AA
, L_AE
, and L_OE
. Each macro appears in three places: the macro index enum, the keymap, and the macroAction()
function. Those macros are shortcuts to make it quicker and/or easier to enter commonly-used Compose key sequences.
I don’t use shortcuts like that, but I use a wide variety of compose sequences, and not frequently enough to feel that it’s particularly slow to type them. If you’re happy typing compose
, a
, e
to get æ
, then there’s no need to define anything special in your sketch. If that’s too slow or awkward for you, figure out where you want to put them in your keymap, and try setting up the macros you need on those keys by defining a key with M(L_AA)
(for example).
If you’re still having trouble, I suggest posting a link to your whole sketch, and identifying exactly what you want — i.e. “I want the key labeled A
on the FUNCTION
layer to produce AE
when I type it.” There are plenty of us here who can both help you get it working, and help explain the details of how it works from there; I know I find it much easier to understand these things when starting from a specific, complete example, rather than starting from general theory.