diff options
author | Jonas Avellana <14019120+ninjonas@users.noreply.github.com> | 2019-09-02 08:40:01 -0600 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2019-09-02 07:40:01 -0700 |
commit | f2ea65db6b8834dcb2a21462f43c1d89add6b101 (patch) | |
tree | 1620e9abc8bb455754ea50fd2d27a9c714e7ce03 /keyboards/lily58/keymaps/ninjonas/layer_state_reader.c | |
parent | 0e153781f035876771dd421ac92136ff2897c7d9 (diff) |
[keymap] ninjonas userspace and keymaps for hotdox, lily58, & pinky3 (#6649)
* [keyboard] introducing ninjonas userspace & keymaps for hotdox, lily58, and pinky3
* [fix(#6649)] removed M_EPRM and used builtin EEP_RST keycode as-per review.
* [chore(#6649)] forgot to update keymap legend on lily58
Diffstat (limited to 'keyboards/lily58/keymaps/ninjonas/layer_state_reader.c')
-rw-r--r-- | keyboards/lily58/keymaps/ninjonas/layer_state_reader.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/keyboards/lily58/keymaps/ninjonas/layer_state_reader.c b/keyboards/lily58/keymaps/ninjonas/layer_state_reader.c new file mode 100644 index 0000000000..883eaca036 --- /dev/null +++ b/keyboards/lily58/keymaps/ninjonas/layer_state_reader.c @@ -0,0 +1,37 @@ +#include QMK_KEYBOARD_H +#include <stdio.h> +#include "lily58.h" +#include "ninjonas.h" + +char layer_state_str[24]; + +const char *read_layer_state(void) { + switch (biton32(layer_state)) + { + case _RAISE: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Raise"); + break; + case _LOWER: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Lower"); + break; + case _ADJUST: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Adjust"); + break; + default: + switch (biton32(default_layer_state)) { + case _COLEMAK: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Colemak"); + break; + case _DVORAK: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Dvorak"); + break; + case _QWERTY: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Qwerty"); + break; + default: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Undef-%ld", layer_state); + } + } + + return layer_state_str; +}
\ No newline at end of file |