diff options
author | QMK Bot <hello@qmk.fm> | 2022-03-08 03:46:20 +0000 |
---|---|---|
committer | QMK Bot <hello@qmk.fm> | 2022-03-08 03:46:20 +0000 |
commit | 0cf1186f8d857e62eab30ab3323573fda8238fd9 (patch) | |
tree | 06dfde75af7e0f06e637c0324b131d31c409b228 /keyboards/winry/winry315/keymaps/left_numpad | |
parent | b069002e6150e9735c86a93d68a6bb8fd708c09e (diff) | |
parent | eb35f58a6ec9068329a39e3ef8449568e90931e9 (diff) | |
download | qmk_firmware-0cf1186f8d857e62eab30ab3323573fda8238fd9.tar.gz qmk_firmware-0cf1186f8d857e62eab30ab3323573fda8238fd9.zip |
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'keyboards/winry/winry315/keymaps/left_numpad')
-rw-r--r-- | keyboards/winry/winry315/keymaps/left_numpad/config.h | 6 | ||||
-rw-r--r-- | keyboards/winry/winry315/keymaps/left_numpad/keymap.c | 81 | ||||
-rw-r--r-- | keyboards/winry/winry315/keymaps/left_numpad/readme.md | 3 |
3 files changed, 90 insertions, 0 deletions
diff --git a/keyboards/winry/winry315/keymaps/left_numpad/config.h b/keyboards/winry/winry315/keymaps/left_numpad/config.h new file mode 100644 index 0000000000..acb72b5bb4 --- /dev/null +++ b/keyboards/winry/winry315/keymaps/left_numpad/config.h @@ -0,0 +1,6 @@ +// Copyright 2022 Sergey Vlasov (@sigprof) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define WINRY315_DEFAULT_ORIENTATION WINRY315_ORIENTATION_LEFT diff --git a/keyboards/winry/winry315/keymaps/left_numpad/keymap.c b/keyboards/winry/winry315/keymaps/left_numpad/keymap.c new file mode 100644 index 0000000000..8864b1b45a --- /dev/null +++ b/keyboards/winry/winry315/keymaps/left_numpad/keymap.c @@ -0,0 +1,81 @@ +// Copyright 2022 Sergey Vlasov (@sigprof) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +// Defines names for use in layer keycodes and the keymap +enum layer_names { + _BASE, + _RGB, +}; + +// Shorter defines for some QMK keycodes (to keep the keymap aligned) +#define U_LTESC LT(_RGB, KC_ESC) + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Base */ + [_BASE] = LAYOUT_left( + KC_MPLY, U_LTESC, KC_BSPC, KC_PENT, + KC_P7, KC_P8, KC_P9, + KC_MUTE, KC_P4, KC_P5, KC_P6, + KC_P1, KC_P2, KC_P3, + KC_HOME, KC_P0, KC_P0, KC_PDOT + ), + + /* RGB configuration */ + [_RGB] = LAYOUT_left( + RGB_M_R, KC_TRNS, RGB_SPD, RGB_SPI, + RGB_TOG, RGB_HUD, RGB_HUI, + RGB_M_B, RGB_M_P, RGB_SAD, RGB_SAI, + KC_NO, RGB_VAD, RGB_VAI, + RGB_M_P, KC_NLCK, RGB_RMOD,RGB_MOD + ), +}; +// clang-format on + +bool encoder_update_user(uint8_t index, bool clockwise) { + uint8_t layer = get_highest_layer(layer_state | default_layer_state); + + switch (index) { + case 0: + // Bottom encoder (left in the default orientation) + if (layer == _RGB) { + if (clockwise) { + rgblight_increase_val(); + } else { + rgblight_decrease_val(); + } + } else { + tap_code(clockwise ? KC_PGDN : KC_PGUP); + } + break; + + case 1: + // Center encoder + if (layer == _RGB) { + if (clockwise) { + rgblight_increase_sat(); + } else { + rgblight_decrease_sat(); + } + } else { + tap_code_delay(clockwise ? KC_VOLU : KC_VOLD, 10); + } + break; + + case 2: + // Top encoder (right in the default orientation) + if (layer == _RGB) { + if (clockwise) { + rgblight_increase_hue(); + } else { + rgblight_decrease_hue(); + } + } else { + tap_code_delay(clockwise ? KC_MNXT : KC_MPRV, 10); + } + break; + } + return false; +} diff --git a/keyboards/winry/winry315/keymaps/left_numpad/readme.md b/keyboards/winry/winry315/keymaps/left_numpad/readme.md new file mode 100644 index 0000000000..9562c2fc19 --- /dev/null +++ b/keyboards/winry/winry315/keymaps/left_numpad/readme.md @@ -0,0 +1,3 @@ +# The “Left Numpad” keymap for Winry315 + +This is a keymap example for the Winry315 board in the “left” orientation (the board is rotated so that the encoders are on the left side, and the keys are in 5 rows of 3 keys). The `LAYOUT_left` macro is used for this orientation, and `WINRY315_DEFAULT_ORIENTATION` is redefined in `config.h` to change the behavior of RGB Matrix effects. |