Note the call to `process_record_user()` at the end. Additionally, users of the keyboard will need to use `NEW_SAFE_RANGE` instead of `SAFE_RANGE` if they wish to add their own custom keycodes at keymap level, beyond what is provided by the keyboard.
Note the call to `process_record_user()` at the end.
@ -121,7 +121,7 @@ The Charybdis firmware defines a number of keycodes to leverage its features, na
```
```
#ifndef NO_CHARYBDIS_KEYCODES
#ifndef NO_CHARYBDIS_KEYCODES
enum charybdis_keycodes {
enum charybdis_keycodes {
POINTER_DEFAULT_DPI_FORWARD = SAFE_RANGE,
POINTER_DEFAULT_DPI_FORWARD = QK_KB_0,
POINTER_DEFAULT_DPI_REVERSE,
POINTER_DEFAULT_DPI_REVERSE,
POINTER_SNIPING_DPI_FORWARD,
POINTER_SNIPING_DPI_FORWARD,
POINTER_SNIPING_DPI_REVERSE,
POINTER_SNIPING_DPI_REVERSE,
@ -129,7 +129,6 @@ enum charybdis_keycodes {
SNIPING_MODE_TOGGLE,
SNIPING_MODE_TOGGLE,
DRAGSCROLL_MODE,
DRAGSCROLL_MODE,
DRAGSCROLL_MODE_TOGGLE,
DRAGSCROLL_MODE_TOGGLE,
CHARYBDIS_SAFE_RANGE,
};
};
#define DPI_MOD POINTER_DEFAULT_DPI_FORWARD
#define DPI_MOD POINTER_DEFAULT_DPI_FORWARD
@ -143,20 +142,6 @@ enum charybdis_keycodes {
#endif // !NO_CHARYBDIS_KEYCODES
#endif // !NO_CHARYBDIS_KEYCODES
```
```
Users extending the keycode set themselves (either in their keymap, or in their userspace) must start at `CHARYBDIS_SAFE_RANGE` to avoid conflicts, _eg._:
```c
enum userspace_keycodes {
#ifndef NO_CHARYBDIS_KEYCODES
MY_FIRST_KEYCODE = CHARYBDIS_SAFE_RANGE,
#else
MY_FIRST_KEYCODE = SAFE_RANGE,
#endif // !NO_CHARYBDIS_KEYCODES
MY_SECOND_KEYCODE,
…
};
```
To disable the custom keycodes, and reduce binary size, simply add a definition in `config.h`:
To disable the custom keycodes, and reduce binary size, simply add a definition in `config.h`:
@ -53,7 +53,3 @@ Colors for FLED_INDI mode are hardcoded as hue/saturation values, the caps lock
- FLED_MOD - Cycle between the 3 modes (FLED_OFF -> FLED_RGB -> FLED_INDI)
- FLED_MOD - Cycle between the 3 modes (FLED_OFF -> FLED_RGB -> FLED_INDI)
- FLED_VAI - Increase front LED brightness
- FLED_VAI - Increase front LED brightness
- FLED_VAD - Decrease front LED brightness
- FLED_VAD - Decrease front LED brightness
# Further Notes
As SAFE_RANGE is used for defining the custom keycodes seen above, please use NEW_SAFE_RANGE as the starting value for any custom keycodes in keymap.c, as per the example.