From 81b5a3ebc762a0631eed814ea652438a34cd385e Mon Sep 17 00:00:00 2001 From: Ilya Zhuravlev Date: Sat, 26 Jun 2021 16:35:43 -0400 Subject: [PATCH] fix compile errors after merge --- .../capsunlocked/cu7/keymaps/default/keymap.c | 4 +- keyboards/misterdeck/keymaps/default/keymap.c | 71 +++++++++++++++++++ .../pohjolaworks/louhi/keymaps/via/keymap.c | 4 +- 3 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 keyboards/misterdeck/keymaps/default/keymap.c diff --git a/keyboards/capsunlocked/cu7/keymaps/default/keymap.c b/keyboards/capsunlocked/cu7/keymaps/default/keymap.c index 52737523ac..702b81cba4 100644 --- a/keyboards/capsunlocked/cu7/keymaps/default/keymap.c +++ b/keyboards/capsunlocked/cu7/keymaps/default/keymap.c @@ -32,7 +32,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; // Volume up/down on the encoder -void encoder_update_user(uint8_t index, bool clockwise) { +bool encoder_update_user(uint8_t index, bool clockwise) { uint16_t held_keycode_timer = timer_read(); if (clockwise) { @@ -45,4 +45,6 @@ void encoder_update_user(uint8_t index, bool clockwise) { while (timer_elapsed(held_keycode_timer) < MEDIA_KEY_DELAY) {} unregister_code(KC_VOLD); } + + return true; } diff --git a/keyboards/misterdeck/keymaps/default/keymap.c b/keyboards/misterdeck/keymaps/default/keymap.c new file mode 100644 index 0000000000..100afc3935 --- /dev/null +++ b/keyboards/misterdeck/keymaps/default/keymap.c @@ -0,0 +1,71 @@ +#include QMK_KEYBOARD_H +#include "quantum.h" + +#define _______ KC_TRNS +#define NUMPAD TO(_NUMPAD) +enum layers { + _NUMPAD = 0, + _FUNC2, + _MOUSE, + _CTRL, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_NUMPAD] = LAYOUT( + KC_P7, KC_P8, KC_P9, LT(_CTRL,KC_P0), + KC_P4, KC_P5, KC_P6, TT(_MOUSE), + KC_P1, KC_P2, KC_P3, TT(_FUNC2) + ), + + [_FUNC2] = LAYOUT( + KC_F17, KC_F18, KC_F19, NUMPAD, + KC_F14, KC_F15, KC_F16, _______, + KC_F11, KC_F12, KC_F13, _______ + ), + + [_MOUSE] = LAYOUT( + _______, _______, KC_WH_D, NUMPAD, + _______, _______, KC_BTN1, _______, + _______, _______, KC_WH_U, _______ + ), + + [_CTRL] = LAYOUT( + KC_MUTE, RGB_TOG, _______, _______, + KC_VOLU, RGB_RMOD, _______, _______, + KC_VOLD, RGB_MOD, _______, _______ + ), + +}; + +static const rgblight_segment_t PROGMEM mrd_numpad_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {0, 4, HSV_GREEN} +); +static const rgblight_segment_t PROGMEM mrd_mouse_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {4, 4, HSV_YELLOW} +); +static const rgblight_segment_t PROGMEM mrd_ctrl_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {8, 4, HSV_PURPLE} +); +static const rgblight_segment_t PROGMEM mrd_func2_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {12, 4, HSV_BLUE} +); + +// Now define the array of layers. Later layers take precedence +static const rgblight_segment_t* const PROGMEM mrd_rgb_layers[] = RGBLIGHT_LAYERS_LIST( + mrd_numpad_layer, + mrd_func2_layer, + mrd_mouse_layer, + mrd_ctrl_layer +); + +void keyboard_post_init_user(void) { + // Enable the LED layers + rgblight_layers = mrd_rgb_layers; +} + +layer_state_t layer_state_set_user(layer_state_t state) { + rgblight_set_layer_state(1, layer_state_cmp(state, _FUNC2)); + rgblight_set_layer_state(2, layer_state_cmp(state, _MOUSE)); + rgblight_set_layer_state(3, layer_state_cmp(state, _CTRL)); + return state; +} diff --git a/keyboards/pohjolaworks/louhi/keymaps/via/keymap.c b/keyboards/pohjolaworks/louhi/keymaps/via/keymap.c index ee334a249b..21e61d5206 100644 --- a/keyboards/pohjolaworks/louhi/keymaps/via/keymap.c +++ b/keyboards/pohjolaworks/louhi/keymaps/via/keymap.c @@ -48,10 +48,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -void encoder_update_user(uint8_t index, bool clockwise) { +bool encoder_update_user(uint8_t index, bool clockwise) { if (clockwise) { tap_code(KC_PGDN); } else { tap_code(KC_PGUP); } + + return true; }