From 48a8682438d5708636c3260adfb6a75ac89ed05a Mon Sep 17 00:00:00 2001 From: James Young <18669334+noroadsleft@users.noreply.github.com> Date: Thu, 19 Aug 2021 17:13:31 +0000 Subject: Linworks Whale75 Layout Macro refactor and Configurator fixes (#14059) * info.json: human-friendly formatting * info.json: remove "w":1 instances * info.json: correct positions of Left, Down and Right Arrow keys * info.json: add LAYOUT_all data * move Home key to end of home row According to photographs of the keyboard, the fourth key down on the right side is physically on the home row. This commit moves the key argument and keycodes to the home row. * whale75.h: use QMK 3-character notation for matrix * whale75.h: add matrix diagram * add keyboard-level encoder functionality * info.json: correct key sequence on ISO layouts --- keyboards/linworks/whale75/whale75.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'keyboards/linworks/whale75/whale75.c') diff --git a/keyboards/linworks/whale75/whale75.c b/keyboards/linworks/whale75/whale75.c index 4bce30adf3..ef86e0268a 100644 --- a/keyboards/linworks/whale75/whale75.c +++ b/keyboards/linworks/whale75/whale75.c @@ -14,3 +14,29 @@ * along with this program. If not, see . */ #include "whale75.h" + +#if defined(ENCODER_ENABLE) +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + /* The switch case allows for different encoder mappings on different layers, "default" map gets applied for all unspecified layers */ + switch(get_highest_layer(layer_state)){ + case 1: + if (clockwise) { + tap_code(KC_MNXT); + } else { + tap_code(KC_MPRV); + } + break; + default: + if (clockwise){ + tap_code(KC_VOLU); + } else{ + tap_code(KC_VOLD); + } + break; + } + } + return true; +} +#endif -- cgit v1.2.3