~ruther/qmk_firmware

dc39d902704b9c19a89441e8b7afdadaf3543425 — peepeetee 4 years ago 0504578
[Keyboard] Add LED matrix and 2 layouts to hub20 (#12505)

Co-authored-by: Drashna Jaelre <drashna@live.com>
M keyboards/hub20/config.h => keyboards/hub20/config.h +52 -24
@@ 1,5 1,6 @@
/*
Copyright 2020 joshajohnson
Copyright 2020 joshajohnson 
Copyright 2021 peepeetee

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by


@@ 41,29 42,56 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.

#define RGB_DI_PIN B15
#define RGBLED_NUM 27
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
#define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
#define RGBLIGHT_SLEEP         /* If defined, the RGB lighting will be switched off when the host goes to sleep */
// /*== all animations enable ==*/
#define RGBLIGHT_ANIMATIONS
// /*== or choose animations ==*/
// #define RGBLIGHT_EFFECT_BREATHING
// #define RGBLIGHT_EFFECT_RAINBOW_MOOD
// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL
// #define RGBLIGHT_EFFECT_SNAKE
// #define RGBLIGHT_EFFECT_KNIGHT
// #define RGBLIGHT_EFFECT_CHRISTMAS
// #define RGBLIGHT_EFFECT_STATIC_GRADIENT
// #define RGBLIGHT_EFFECT_RGB_TEST
// #define RGBLIGHT_EFFECT_ALTERNATING
// /*== customize breathing effect ==*/
// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/
// #define RGBLIGHT_BREATHE_TABLE_SIZE 256      // 256(default) or 128 or 64
// /*==== use exp() and sin() ====*/
// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85  // 1 to 2.7
// #define RGBLIGHT_EFFECT_BREATHE_MAX    255   // 0 to 255

#define DRIVER_LED_TOTAL 27
#ifdef RGB_DI_PIN
    #define RGBLED_NUM 27
#endif

#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
#define RGB_MATRIX_KEYPRESSES

// This list in in the correct mode order. Next mode is the following line, previous mode is previous line. Loops around.
// #define DISABLE_RGB_MATRIX_SOLID_COLOR                   // Static single hue, no speed support
#define DISABLE_RGB_MATRIX_ALPHAS_MODS                   // Static dual hue, speed is hue for secondary hue
//#define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN              // Static gradient top to bottom, speed controls how much gradient changes
//#define DISABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT           // Static gradient top to bottom, speed controls how much gradient changes
//#define DISABLE_RGB_MATRIX_BREATHING                     // Single hue brightness cycling animation
#define DISABLE_RGB_MATRIX_BAND_SAT                      // Single hue band fading saturation scrolling left to right
#define DISABLE_RGB_MATRIX_BAND_VAL                      // Single hue band fading brightness scrolling left to right
#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT             // Single hue 3 blade spinning pinwheel fades saturation
#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL             // Single hue 3 blade spinning pinwheel fades brightness
#define DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT               // Single hue spinning spiral fades saturation
#define DISABLE_RGB_MATRIX_BAND_SPIRAL_VAL               // Single hue spinning spiral fades brightness
#define DISABLE_RGB_MATRIX_CYCLE_ALL                     // Full keyboard solid hue cycling through full gradient
//#define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT              // Full gradient scrolling left to right
//#define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN                 // Full gradient scrolling top to bottom
#define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON        // Full gradent Chevron shapped scrolling left to right
#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN                  // Full gradient scrolling out to in
#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL             // Full dual gradients scrolling out to in
#define DISABLE_RGB_MATRIX_CYCLE_PINWHEEL                // Full gradient spinning pinwheel around center of keyboard
#define DISABLE_RGB_MATRIX_CYCLE_SPIRAL                  // Full gradient spinning spiral around center of keyboard
#define DISABLE_RGB_MATRIX_DUAL_BEACON                   // Full gradient spinning around center of keyboard
#define DISABLE_RGB_MATRIX_RAINBOW_BEACON                // Full tighter gradient spinning around center of keyboard
#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS             // Full dual gradients spinning two halfs of keyboard
//#define DISABLE_RGB_MATRIX_RAINDROPS                     // Randomly changes a single key's hue
//#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS           // Randomly changes a single key's hue and saturation
// =================================================== Requires RGB_MATRIX_FRAMEBUFFER_EFFECTS =============================================================
// #define DISABLE_RGB_MATRIX_TYPING_HEATMAP                // How hot is your WPM!
//#define DISABLE_RGB_MATRIX_DIGITAL_RAIN                  // That famous computer simulation
// =================================================== RGB_MATRIX_KEYPRESSES OR RGB_MATRIX_KEYRELEASES =====================================================
//#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE         // Pulses keys hit to hue & value then fades value out
//#define DISABLE_RGB_MATRIX_SOLID_REACTIVE                // Static single hue, pulses keys hit to shifted hue then fades to current hue
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE           // Hue & value pulse near a single key hit then fades value out
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE      // Hue & value pulse near multiple key hits then fades value out
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS          // Hue & value pulse the same column and row of a single key hit then fades value out
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS     // Hue & value pulse the same column and row of multiple key hits then fades value out
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS          // Hue & value pulse away on the same column and row of a single key hit then fades value out
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS     // Hue & value pulse away on the same column and row of multiple key hits then fades value out
#define DISABLE_RGB_MATRIX_SPLASH                        // Full gradient & value pulse away from a single key hit then fades value out
#define DISABLE_RGB_MATRIX_MULTISPLASH                   // Full gradient & value pulse away from multiple key hits then fades value out
#define DISABLE_RGB_MATRIX_SOLID_SPLASH                  // Hue & value pulse away from a single key hit then fades value out
#define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH             // Hue & value pulse away from multiple key hits then fades value out

/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5

M keyboards/hub20/hub20.c => keyboards/hub20/hub20.c +154 -1
@@ 1,4 1,4 @@
/* Copyright 2020 joshajohnson
/* Copyright 2020 joshajohnson 2021 peepeetee
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by


@@ 16,3 16,156 @@

#include "hub20.h"


#ifdef RGB_MATRIX_ENABLE
led_config_t g_led_config = { {
    // Key Matrix to LED Index
    {NO_LED,NO_LED,NO_LED,NO_LED},
    { 7,      8,      9,     10},
    { 11,    12,     13,     14},
    { 15,    16,     17,     18},
    { 19,    20,     21,     22},
    { 23,    24,     25,     26}
    //todo: assign leds to keys differently for the different layouts
}, {
    // LED Index to Physical Position
    { 190, 50}, { 111, 50}, { 35, 50}, {38, 0}, {38, 35}, {186, 35}, {186, 0}, // UNDERGLOW
    //todo: underglow location needs to be recalculated. The top row is above row 4, and for now they have the same y value 0
    {  0,  0}, {75,  0}, {150,  0}, {225,  0}, // row 4
    {  0, 16}, {75, 16}, {150, 16}, {225, 16}, // row 3
    {  0, 32}, {75, 32}, {150, 32}, {225, 32}, // row 2
    {  0, 48}, {75, 48}, {150, 48}, {225, 48}, // row 1
    {  0, 64}, {75, 64}, {150, 64}, {225, 64}  // row 0

}, {
    // LED Index to Flag
    LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW,  // UNDERGLOW
    LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,           // row 4
    LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,           // row 3
    LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,           // row 2
    LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,           // row 1
    LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT            // row 0

} };
#endif



// #if LED_MERGE_NUMPAD_LEFT_HANDED_ENTER && LED_MERGE_NUMPAD_RIGHT_HANDED_ZERO
// #error lower left enter conflicts with lower left zero
// #endif

// #if LED_MERGE_NUMPAD_RIGHT_HANDED_ENTER && LED_MERGE_NUMPAD_LEFT_HANDED_ZERO
// #error lower right enter conflicts with lower right zero
// #endif

//     /* LAYOUT_left_handed


//      *     ┌───┬───┐
//      *     │01 │02 │
//      * ┌───┼───┼───┼───┐
//      * │10 │11 │12 │13 │
//      * ├───┼───┼───┼───┤
//      * │   │21 │22 │23 │
//      * │20 ├───┼───┼───┤
//      * │   │31 │32 │33 │
//      * ├───┼───┼───┼───┤
//      * │   │41 │42 │43 │
//      * │40 ├───┼───┴───┤
//      * │   │51 │  52   │
//      * └───┴───┴───────┘
//      */

// #ifndef LED_MERGE_NUMPAD_LEFT_HANDED_PLUS //key 20
// #define LED_MERGE_NUMPAD_LEFT_HANDED_PLUS FALSE
// #endif // LED_MERGE_NUMPAD_LEFT_HANDED_PLUS

// #ifndef LED_MERGE_NUMPAD_LEFT_HANDED_ENTER //key 40
// #define LED_MERGE_NUMPAD_LEFT_HANDED_ENTER FALSE
// #endif // LED_MERGE_NUMPAD_LEFT_HANDED_ENTER

// #ifndef LED_MERGE_NUMPAD_LEFT_HANDED_ZERO //key 52
// #define LED_MERGE_NUMPAD_LEFT_HANDED_ZERO FALSE
// #endif // LED_MERGE_NUMPAD_LEFT_HANDED_ZERO


//     /* LAYOUT_right_handed


//      *     ┌───┬───┐
//      *     │01 │02 │
//      * ┌───┼───┼───┼───┐
//      * │10 │11 │12 │13 │
//      * ├───┼───┼───┼───┤
//      * │20 │21 │22 │   │
//      * ├───┼───┼───┤23 │
//      * │30 │31 │32 │   │
//      * ├───┼───┼───┼───┤
//      * │40 │41 │42 │   │
//      * ├───┴───┼───┤43 │
//      * │  50   │52 │   │
//      * └───────┴───┴───┘
//      */
//         //LOCATION OF bottom row 0 NOT TESTED, WAITING ENDORSEMENT FROM MANUFACTURER

// #ifndef LED_MERGE_NUMPAD_RIGHT_HANDED_PLUS // key 23
// #define LED_MERGE_NUMPAD_RIGHT_HANDED_PLUS FALSE
// #endif // LED_MERGE_NUMPAD_RIGHT_HANDED_PLUS

// #ifndef LED_MERGE_NUMPAD_RIGHT_HANDED_ENTER // key 43
// #define LED_MERGE_NUMPAD_RIGHT_HANDED_ENTER FALSE
// #endif // LED_MERGE_NUMPAD_RIGHT_HANDED_ENTER

// #ifndef LED_MERGE_NUMPAD_RIGHT_HANDED_ZERO // key 50 (confirm with manufacturer)
// #define LED_MERGE_NUMPAD_RIGHT_HANDED_ZERO FALSE
// #endif // LED_MERGE_NUMPAD_RIGHT_HANDED_ZERO

// uint8_t rgb_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i) {
// // Keys here have 2 leds. Here we add the led that is not bound to the key
// // and the default led would be added
// // by the default code that runs after this in rgb_matrix_map_row_column_to_led

// uint8_t counter = 0;

// #if LED_MERGE_NUMPAD_LEFT_HANDED_PLUS //key 20, leds 7 and 11, 7 already bound

//     if (row == 2 && column == 0) {
//         led_i[counter] = 11;
//         counter ++;
//     }
// #endif
// #if LED_MERGE_NUMPAD_LEFT_HANDED_ENTER //key 40, leds 19 and 23, 23 already bound
//     if (row == 4 && column == 0) {
//         led_i[counter] = 23;
//         counter ++;
//     }
// #endif
// #if LED_MERGE_NUMPAD_LEFT_HANDED_ZERO //key 52, leds 25 and 26, 26 already bound
//     if (row == 5 && column == 2) {
//         led_i[counter] = 26;
//         counter ++;
//     }
// #endif

// #if LED_MERGE_NUMPAD_RIGHT_HANDED_PLUS // key 23, led 14 and 18, 14 already bound
//     if (row == 2 && column == 3) {
//         led_i[counter] = 18;
//         counter ++;
//     }
// #endif
// #if LED_MERGE_NUMPAD_RIGHT_HANDED_ENTER // key 43, led 22 and 26, 22 already bound
//     if (row == 4 && column == 3) {
//         led_i[counter] = 26;
//         counter ++;
//     }
// #endif
// #if LED_MERGE_NUMPAD_RIGHT_HANDED_ZERO  // key 50 (confirm with manufacturer)
// // LED 23 and 24, 23(?) already bound
//     if (row == 5 && column == 0) {
//         led_i[counter] = 24;
//         counter ++;
//     }
// #endif
//     return counter;
// }

M keyboards/hub20/hub20.h => keyboards/hub20/hub20.h +90 -0
@@ 29,6 29,24 @@
 * represents the switch matrix.
 */


    /* LAYOUT_all


     *     ┌───┬───┐ 
     *     │01 │02 │    
     * ┌───┼───┼───┼───┐
     * │10 │11 │12 │13 │
     * ├───┼───┼───┼───┤
     * │20 │21 │22 │23 │
     * ├───┼───┼───┼───┤
     * │30 │31 │32 │33 │
     * ├───┼───┼───┼───┤
     * │40 │41 │42 │43 │
     * ├───┼───┼───┼───┤
     * │50 │51 │52 │53 │
     * └───┴───┴───┴───┘
     */
#define LAYOUT_all(   \
      K01,      K02,    \
    K10, K11, K12, K13, \


@@ 45,3 63,75 @@
    { K40, K41, K42, K43, }, \
    { K50, K51, K52, K53, }, \
}

    /* LAYOUT_left_handed


     *     ┌───┬───┐ 
     *     │01 │02 │    
     * ┌───┼───┼───┼───┐
     * │10 │11 │12 │13 │
     * ├───┼───┼───┼───┤
     * │   │21 │22 │23 │
     * │20 ├───┼───┼───┤
     * │   │31 │32 │33 │
     * ├───┼───┼───┼───┤
     * │   │41 │42 │43 │
     * │40 ├───┼───┴───┤
     * │   │51 │  52   │
     * └───┴───┴───────┘
     */
#define LAYOUT_left_handed(   \
      K01,      K02,    \
    K10, K11, K12, K13, \
         K21, K22, K23, \
    K20, K31, K32, K33, \
         K41, K42, K43, \
    K40, K51, K52       \
) \
{ \
    { ___, K01, K02, ___, }, \
    { K10, K11, K12, K13, }, \
    { K20, K21, K22, K23, }, \
    { ___, K31, K32, K33, }, \
    { K40, K41, K42, K43, }, \
    { ___, K51, K52, ___, }, \
}


    /* LAYOUT_right_handed


     *     ┌───┬───┐ 
     *     │01 │02 │    
     * ┌───┼───┼───┼───┐
     * │10 │11 │12 │13 │
     * ├───┼───┼───┼───┤
     * │20 │21 │22 │   │
     * ├───┼───┼───┤23 │
     * │30 │31 │32 │   │
     * ├───┼───┼───┼───┤
     * │40 │41 │42 │   │
     * ├───┴───┼───┤43 │
     * │  50(not sure, confirm)   │52 │   │
     * └───────┴───┴───┘
     */
        //NOT TESTED, WAITING ENDORSEMENT FROM MANUFACTURER
#define LAYOUT_right_handed(   \
      K01,      K02,    \
    K10, K11, K12, K13, \
    K20, K21, K22,      \
    K30, K31, K32, K23, \
    K40, K41, K42,      \
    K50,      K52, K43  \
) \
{ \
    { ___, K01, K02, ___, }, \
    { K10, K11, K12, K13, }, \
    { K20, K21, K22, K23, }, \
    { K30, K31, K32, ___, }, \
    { K40, K41, K42, K43, }, \
    { K50, ___, K52, ___, }, \
}



M keyboards/hub20/info.json => keyboards/hub20/info.json +50 -0
@@ 30,6 30,56 @@
          {"label":"0", "x":2, "y":5},
          {"label":"0", "x":3, "y":5}
        ]
      },
      "LAYOUT_left_handed": {
        "layout": [
          {"label":"Mute", "x":0.5, "y":0},
          {"label":"Play / Pause", "x":2.5, "y":0},
          {"label":"-", "x":0, "y":1},
          {"label":"*", "x":1, "y":1},
          {"label":"/", "x":2, "y":1},
          {"label":"Numlock", "x":3, "y":1},
          {"label":"7", "x":1, "y":2},
          {"label":"8", "x":2, "y":2},
          {"label":"9", "x":3, "y":2},
          {"label":"+", "x":0, "y":2, "h":2},
          {"label":"4", "x":1, "y":3},
          {"label":"5", "x":2, "y":3},
          {"label":"6", "x":3, "y":3},
          {"label":"Enter", "x":0, "y":4, "h":2},
          {"label":"1", "x":1, "y":4},
          {"label":"2", "x":2, "y":4},
          {"label":"3", "x":3, "y":4},
          {"label":".", "x":1, "y":5},
          {"label":"0", "x":3, "y":5, "w":2}
        ]
      },
      "LAYOUT_right_handed": {
        "layout": [
          {"label":"Mute",         "x":0.5, "y":0},
          {"label":"Play / Pause", "x":2.5, "y":0},
          {"label":"Numlock",      "x":0, "y":1},
          {"label":"/",            "x":1, "y":1},
          {"label":"*",            "x":2, "y":1},
          {"label":"-",            "x":3, "y":1},
            
          {"label":"7",            "x":0, "y":2},
          {"label":"8",            "x":1, "y":2},
          {"label":"9",            "x":2, "y":2},
            
          {"label":"4",            "x":0, "y":3},
          {"label":"5",            "x":1, "y":3},
          {"label":"6",            "x":2, "y":3},
          {"label":"+",            "x":3, "y":2, "h":2},

          {"label":"1",            "x":0, "y":4},
          {"label":"2",            "x":1, "y":4},
          {"label":"3",            "x":2, "y":4},

          {"label":"0",            "x":0, "y":5, "w":2},
          {"label":".",            "x":2, "y":5},
          {"label":"Enter",        "x":3, "y":4, "h":2}
        ]
      }
    }
}

A keyboards/hub20/keymaps/left_hand_numpad/keymap.c => keyboards/hub20/keymaps/left_hand_numpad/keymap.c +61 -0
@@ 0,0 1,61 @@
/* Copyright 2020 joshajohnson 2021 peepeetee
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#include QMK_KEYBOARD_H



// #define LED_MERGE_NUMPAD_LEFT_HANDED_PLUS TRUE
// #define LED_MERGE_NUMPAD_LEFT_HANDED_ENTER TRUE
// #define LED_MERGE_NUMPAD_LEFT_HANDED_ZERO TRUE


#define MO_NLCK LT(1, KC_NLCK) // Numlock on tap, layer change on hold

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT_left_handed(
                 KC_MUTE,  KC_MPLY,
       KC_PMNS,  KC_PAST,  KC_PSLS,    MO_NLCK,
                   KC_P7,    KC_P8,      KC_P9,
       KC_PPLS,    KC_P4,    KC_P5,      KC_P6,
                   KC_P1,    KC_P2,      KC_P3,
       KC_PENT,  KC_PDOT,    KC_P0
),
    [1] = LAYOUT_left_handed(
                   RESET,  _______,
       RGB_TOG, RGB_RMOD,  RGB_MOD,    _______,
       _______,  RGB_VAD,  RGB_VAI,    _______,
                 RGB_HUD,  RGB_HUI,    _______,
       _______,  RGB_SAD,  RGB_SAI,    _______,
                 _______,        _______
)
};

void encoder_update_user(uint8_t index, bool clockwise) {
    if (index == 0) { /* Left Encoder */
        if (clockwise) {
            tap_code(KC_VOLU);
        } else {
            tap_code(KC_VOLD);
        }
    } else if (index == 1) { /* Right Encoder */
        if (clockwise) {
            tap_code(KC_MNXT);
        } else {
            tap_code(KC_MPRV);
        }
    }
}


A keyboards/hub20/keymaps/right_hand_numpad/keymap.c => keyboards/hub20/keymaps/right_hand_numpad/keymap.c +66 -0
@@ 0,0 1,66 @@
/* Copyright 2021 peepeetee
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#include QMK_KEYBOARD_H



// #define LED_MERGE_NUMPAD_RIGHT_HANDED_PLUS TRUE
// #define LED_MERGE_NUMPAD_RIGHT_HANDED_ENTER TRUE
// #define LED_MERGE_NUMPAD_RIGHT_HANDED_ZERO TRUE


#define MO_NLCK LT(1, KC_NLCK) // Numlock on tap, layer change on hold

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

//NOT TESTED, WAITING ENDORSEMENT FROM MANUFACTURER
    [0] = LAYOUT_right_handed(
                 KC_MUTE,  KC_MPLY,
        MO_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
        KC_P7,   KC_P8,   KC_P9,
        KC_P4,   KC_P5,   KC_P6,   KC_PPLS,
        KC_P1,   KC_P2,   KC_P3,
        KC_P0,   KC_PDOT,          KC_PENT
),
    [1] = LAYOUT_right_handed(
                   RESET,  _______,
       RGB_TOG, RGB_RMOD,  RGB_MOD,    _______,
       _______,  RGB_VAD,  RGB_VAI,
       _______,  RGB_HUD,  RGB_HUI,    _______,
       _______,  RGB_SAD,  RGB_SAI,
           _______,        _______,    _______
)
};




void encoder_update_user(uint8_t index, bool clockwise) {
    if (index == 0) { /* Left Encoder */
        if (clockwise) {
            tap_code(KC_VOLU);
        } else {
            tap_code(KC_VOLD);
        }
    } else if (index == 1) { /* Right Encoder */
        if (clockwise) {
            tap_code(KC_MNXT);
        } else {
            tap_code(KC_MPRV);
        }
    }
}


M keyboards/hub20/rules.mk => keyboards/hub20/rules.mk +5 -3
@@ 10,16 10,18 @@ BOOTLOADER = stm32-dfu
BOOTMAGIC_ENABLE = lite       # Virtual DIP switch configuration
MOUSEKEY_ENABLE = yes       # Mouse keys
EXTRAKEY_ENABLE = yes       # Audio control and System control
CONSOLE_ENABLE = yes        # Console for debug
COMMAND_ENABLE = yes        # Commands for debug and configuration
CONSOLE_ENABLE = no        # Console for debug
COMMAND_ENABLE = no        # Commands for debug and configuration
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no       # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = yes           # USB Nkey Rollover
BACKLIGHT_ENABLE = no       # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = yes       # Enable keyboard RGB underglow
RGBLIGHT_ENABLE = no       # Enable keyboard RGB underglow
BLUETOOTH_ENABLE = no       # Enable Bluetooth
AUDIO_ENABLE = no           # Audio output
RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = WS2812
ENCODER_ENABLE = yes

# Enter lower-power sleep mode when on the ChibiOS idle thread