Skip to main content

Firmware-only Keycodes

Firmware only keycodes are keycodes that modify the behavior of the keyboard firmware and are processed to send something different.

Layers​

These keycodes are used by the firmware to switch from one layer to another.

Usage ID (HEX)Usage NameKeycode Identifiers
0xF0Access Layer 0 (default)LAYER_0
0xF1Access Layer 1 (default)LAYER_1
0xF2Access Layer 2 (default)LAYER_2
0xF3Access Layer 3 (default)LAYER_3
0xF4Access Layer 4 (default)LAYER_4
0xF5Access Layer 0 (default)LAYER_5
0xF6Access Layer 1 (default)LAYER_6
0xF7Access Layer 2 (default)LAYER_7
0xF8Access Layer 3 (default)LAYER_8
0xF9Access Layer 4 (default)LAYER_9
0xFAAccess Layer 4 (default)LAYER_A
0xFBAccess Layer 0 (default)LAYER_B
0xFCAccess Layer 1 (default)LAYER_C
0xFDAccess Layer 2 (default)LAYER_D
0xFEAccess Layer 3 (default)LAYER_E
0xFFAccess Layer 4 (default)LAYER_F

If you want to activate a layer by pressing a combination of two other layer keycodes, you can use the function process_user_layers to define the behavior you want.

You will need to add the following two lines to your keymap.h

#define USER_LAYER_FUNCTION   0 
void process_user_layers(uint16_t layermask);

You will also need to define which two layer activate the 3rd one. This is done by adding a few lines in keymap.cpp

void process_user_layers(uint16_t layermask)
{
KeyScanner::process_for_tri_layers(_L1, _L2, _L3);
}

In the example above, both LAYER_1 and LAYER_2 need to be pressed for LAYER_3 to be activated. Note that _L1, _L2 and _L3 are not keycodes.

If combinations with more layers are needed, you can add them in that function.

Page is still a work in progress. Refer to hid_keycodes.h and advanced_keycodes.h for a detailed list of keycodes.