From e8ead89dd2e168c33768d1d8feacdd4d87670ad3 Mon Sep 17 00:00:00 2001 From: Paulo Pereira Date: Sun, 19 Mar 2023 10:18:30 +0000 Subject: [PATCH 01/10] Add personal keymap --- keyboards/lily58/keymaps/paulomp90/config.h | 54 +++++++ keyboards/lily58/keymaps/paulomp90/keymap.c | 156 +++++++++++++++++++ keyboards/lily58/keymaps/paulomp90/readme.md | 5 + keyboards/lily58/keymaps/paulomp90/rules.mk | 20 +++ 4 files changed, 235 insertions(+) create mode 100644 keyboards/lily58/keymaps/paulomp90/config.h create mode 100644 keyboards/lily58/keymaps/paulomp90/keymap.c create mode 100644 keyboards/lily58/keymaps/paulomp90/readme.md create mode 100644 keyboards/lily58/keymaps/paulomp90/rules.mk diff --git a/keyboards/lily58/keymaps/paulomp90/config.h b/keyboards/lily58/keymaps/paulomp90/config.h new file mode 100644 index 000000000000..b16e63b6d7ac --- /dev/null +++ b/keyboards/lily58/keymaps/paulomp90/config.h @@ -0,0 +1,54 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 . +*/ + +#pragma once + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define QUICK_TAP_TERM 0 +#define TAPPING_TERM 100 + +#undef RGBLED_NUM +#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 +#define RGBLIGHT_EFFECT_TWINKLE +#define RGBLED_NUM 27 +#define RGBLIGHT_LIMIT_VAL 120 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +// Underglow +/* +#undef RGBLED_NUM +#define RGBLED_NUM 14 // Number of LEDs +#define RGBLIGHT_SLEEP +*/ diff --git a/keyboards/lily58/keymaps/paulomp90/keymap.c b/keyboards/lily58/keymaps/paulomp90/keymap.c new file mode 100644 index 000000000000..37d1e0324081 --- /dev/null +++ b/keyboards/lily58/keymaps/paulomp90/keymap.c @@ -0,0 +1,156 @@ +#include QMK_KEYBOARD_H +#include "keymap_portuguese.h" + +enum layer_number { + _QWERTY = 0, + _LOWER, + _RAISE, + _ADJUST, +}; + +#define RAISE MO(_RAISE) +#define LOWER MO(_LOWER) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY + * ,-----------------------------------------. ,-----------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Back | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | ' | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |LShift| A | S | D | F | G |-------. ,-------| H | J | K | L | Ç | ~ | + * |------+------+------+------+------+------| <> | | ´ |------+------+------+------+------+------| + * |LCTRL | Z | X | C | V | B |-------| |-------| N | M | , | . | - |RShift| + * `-----------------------------------------/ / \ \-----------------------------------------' + * | Alt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | \| | + * | | | |/ / \ \ | | | | + * `-------------------''-------' '------''--------------------' + */ + [_QWERTY] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, + KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_GRV, KC_RBRC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_ENT, RAISE, KC_RGUI, KC_BSLS +), +/* LOWER + * ,-----------------------------------------. ,-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | ! | @ | # | $ | % | | & | / | ( | ) | = | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | 1 | 2 | 3 | 4 | 5 |-------. ,-------| 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+------| <> | | ´` |------+------+------+------+------+------| + * | | | | | | |-------| |-------| | | <> | * | ª | ` | | + * `-----------------------------------------/ / \ \-----------------------------------------' + * | Alt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | \| | + * | | | |/ / \ \ | | | | + * `-------------------''-------' '------''--------------------' + */ + + +/* _______, _______, _______, _______, _______, _______, _______, _______, KC_PIPE, KC_GRAVE, KC_PLUS, KC_LCBR, KC_RCBR, _______, */ +[_LOWER] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______,_______, _______, _______, + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_PIPE, KC_GRAVE, KC_PLUS, KC_LCBR, KC_RCBR, _______, + _______, _______, _______, _______, _______, _______, _______, _______ +), +/* RAISE + * ,-----------------------------------------. ,-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |RGBTOG|RGBHUI|RGBSAI|RGBVAI| |-------. ,-------| | Left | Down | Up |Right | | + * |------+------+------+------+------+------| [ | | ] |------+------+------+------+------+------| + * |RGBMOD|RGBHUD|RGBSAD|RGBVAD| | |-------| |-------| + | = | [ | ] | \ | | + * `-----------------------------------------/ / \ \-----------------------------------------' + * | Alt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | \| | + * | | | |/ / \ \ | | | | + * `-------------------''-------' '------''--------------------' + */ + +[_RAISE] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, + RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, KC_PLUS, KC_EQL, KC_LBRC, KC_RBRC, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* ADJUST + * ,-----------------------------------------. ,-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | |-------. ,-------| | | | | | | + * |------+------+------+------+------+------| | | |------+------+------+------+------+------| + * | | | | | | |-------| |-------| | | | | | | + * `-----------------------------------------/ / \ \-----------------------------------------' + * | Alt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | \| | + * | | | |/ / \ \ | | | | + * `----------------------------' '------''--------------------' + */ + [_ADJUST] = LAYOUT( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +//SSD1306 OLED update loop, make sure to enable OLED_ENABLE=yes in rules.mk +#ifdef OLED_ENABLE + +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + if (!is_keyboard_master()) + return OLED_ROTATION_180; // flips the display 180 degrees if offhand + return rotation; +} + +// When you add source files to SRC in rules.mk, you can use functions. +const char *read_layer_state(void); +const char *read_logo(void); +void set_keylog(uint16_t keycode, keyrecord_t *record); +const char *read_keylog(void); +const char *read_keylogs(void); + +// const char *read_mode_icon(bool swap); +// const char *read_host_led_state(void); +// void set_timelog(void); +// const char *read_timelog(void); + +bool oled_task_user(void) { + if (is_keyboard_master()) { + // If you want to change the display of OLED, you need to change here + oled_write_ln(read_layer_state(), false); + oled_write_ln(read_keylog(), false); + oled_write_ln(read_keylogs(), false); + //oled_write_ln(read_mode_icon(keymap_config.swap_lalt_lgui), false); + //oled_write_ln(read_host_led_state(), false); + //oled_write_ln(read_timelog(), false); + } else { + oled_write(read_logo(), false); + } + return false; +} +#endif // OLED_ENABLE + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { +#ifdef OLED_ENABLE + set_keylog(keycode, record); +#endif + // set_timelog(); + } + return true; +} diff --git a/keyboards/lily58/keymaps/paulomp90/readme.md b/keyboards/lily58/keymaps/paulomp90/readme.md new file mode 100644 index 000000000000..e546668bb302 --- /dev/null +++ b/keyboards/lily58/keymaps/paulomp90/readme.md @@ -0,0 +1,5 @@ +# Paulo Lily58 + +Lily58 is 6×4+5keys column-staggered split keyboard. + +Add portuguese include \ No newline at end of file diff --git a/keyboards/lily58/keymaps/paulomp90/rules.mk b/keyboards/lily58/keymaps/paulomp90/rules.mk new file mode 100644 index 000000000000..063ca44024c1 --- /dev/null +++ b/keyboards/lily58/keymaps/paulomp90/rules.mk @@ -0,0 +1,20 @@ +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = no # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +AUDIO_ENABLE = no # Audio output +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing +OLED_ENABLE= yes # OLED display + +# If you want to change the display of OLED, you need to change here +SRC += ./lib/rgb_state_reader.c \ + ./lib/layer_state_reader.c \ + ./lib/logo_reader.c \ + ./lib/keylogger.c \ + # ./lib/mode_icon_reader.c \ + # ./lib/host_led_state_reader.c \ + # ./lib/timelogger.c \ From 473466f47218ae32da24a142e9f724de44269b2b Mon Sep 17 00:00:00 2001 From: Paulo Pereira Date: Mon, 20 Mar 2023 10:05:51 +0000 Subject: [PATCH 02/10] Add some chages --- keyboards/lily58/keymaps/paulomp90/keymap.c | 38 +++++++++++---------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/keyboards/lily58/keymaps/paulomp90/keymap.c b/keyboards/lily58/keymaps/paulomp90/keymap.c index 2d508d538e0b..ab45b0409c52 100644 --- a/keyboards/lily58/keymaps/paulomp90/keymap.c +++ b/keyboards/lily58/keymaps/paulomp90/keymap.c @@ -15,12 +15,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* QWERTY * ,-----------------------------------------. ,-----------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Back | + * | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BSPC | * |------+------+------+------+------+------| |------+------+------+------+------+------| * | Tab | Q | W | E | R | T | | Y | U | I | O | P | ' | * |------+------+------+------+------+------| |------+------+------+------+------+------| * |LShift| A | S | D | F | G |-------. ,-------| H | J | K | L | Ç | ~ | - * |------+------+------+------+------+------| <> | | ´ |------+------+------+------+------+------| + * |------+------+------+------+------+------| <> | | ´` |------+------+------+------+------+------| * |LCTRL | Z | X | C | V | B |-------| |-------| N | M | , | . | - |RShift| * `-----------------------------------------/ / \ \-----------------------------------------' * | Alt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | \| | @@ -38,11 +38,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------. ,-----------------------------------------. * | | | | | | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | ! | @ | # | $ | % | | & | / | ( | ) | = | | + * | | BRG- | BRG+ | VOL- | VOL+ | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | 1 | 2 | 3 | 4 | 5 |-------. ,-------| 6 | 7 | 8 | 9 | 0 | | + * | | MUTE | PREV | PLAY | NEXT | |-------. ,-------| | | | | | | * |------+------+------+------+------+------| <> | | ´` |------+------+------+------+------+------| - * | | | | | | |-------| |-------| | | <> | * | ª | ` | | + * | | | | | | |-------| |-------| | | * | ª | | | * `-----------------------------------------/ / \ \-----------------------------------------' * | Alt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | \| | * | | | |/ / \ \ | | | | @@ -53,31 +53,33 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* _______, _______, _______, _______, _______, _______, _______, _______, KC_PIPE, KC_GRAVE, KC_PLUS, KC_LCBR, KC_RCBR, _______, */ [_LOWER] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______,_______, _______, _______, - _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, - _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_PIPE, KC_GRAVE, KC_PLUS, KC_LCBR, KC_RCBR, _______, + _______, KC_BRID, KC_BRIU, KC_VOLD, KC_VOLU, _______, _______, _______, _______, _______, _______, _______, + _______, KC_MUTE, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_PLUS, KC_EQL, KC_LBRC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), /* RAISE * ,-----------------------------------------. ,-----------------------------------------. - * | | | | | | | | | | | | | | + * | | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * | F1 | | | | | | | | | Up | | | F12 | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | | | | |-------. ,-------| | Left | Down | Up |Right | | + * | | End | Home | PGDN | PGUP | |-------. ,-------| | Left | Down |Right | | | * |------+------+------+------+------+------| [ | | ] |------+------+------+------+------+------| - * | | | | | | |-------| |-------| + | = | [ | ] | \ | | + * | | | | | | |-------| |-------| DEL | BSPC | | | | | * `-----------------------------------------/ / \ \-----------------------------------------' * | Alt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | \| | * | | | |/ / \ \ | | | | * `-------------------''-------' '------''--------------------' */ + /* _______, _______, _______, _______, _______, _______, _______, _______, KC_PLUS, KC_EQL, KC_LBRC, _______, _______, _______,*/ + [_RAISE] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, - _______, _______, _______, _______, _______, _______, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, - _______, _______, _______, _______, _______, _______, _______, _______, KC_PLUS, KC_EQL, KC_LBRC, KC_RBRC, _______, _______, + _______, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, + KC_F1, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_UP, XXXXXXX, _______, KC_F12, + _______, KC_END, KC_HOME, KC_PGDN, KC_PGUP, _______, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, KC_BSPC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), @@ -87,9 +89,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------| |------+------+------+------+------+------| * | | | | | | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * |RGBTOG|RGBHUI|RGBSAI|RGBVAI| | |-------. ,-------| | | | | | | + * |RGB ON| HUE+ | SAT+ | VAL+ | | |-------. ,-------| | | | | | | * |------+------+------+------+------+------| | | |------+------+------+------+------+------| - * |RGBMOD|RGBHUD|RGBSAD|RGBVAD| | |-------| |-------| | | | | | | + * | MODE | HUE- | SAT- | VAL- | | |-------| |-------| | | | | | | * `-----------------------------------------/ / \ \-----------------------------------------' * | Alt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | \| | * | | | |/ / \ \ | | | | From 00c55c7661a2c783ff026b2627ee9490e74eb206 Mon Sep 17 00:00:00 2001 From: Paulo Pereira Date: Mon, 20 Mar 2023 14:55:41 +0000 Subject: [PATCH 03/10] improvements --- keyboards/lily58/keymaps/paulomp90/config.h | 2 ++ keyboards/lily58/keymaps/paulomp90/keymap.c | 40 ++++++++++----------- keyboards/lily58/keymaps/paulomp90/rules.mk | 2 +- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/keyboards/lily58/keymaps/paulomp90/config.h b/keyboards/lily58/keymaps/paulomp90/config.h index b16e63b6d7ac..eb272065ea4f 100644 --- a/keyboards/lily58/keymaps/paulomp90/config.h +++ b/keyboards/lily58/keymaps/paulomp90/config.h @@ -46,6 +46,8 @@ along with this program. If not, see . #define RGBLIGHT_SAT_STEP 17 #define RGBLIGHT_VAL_STEP 17 +#define TAP_CODE_DELAY 10 + // Underglow /* #undef RGBLED_NUM diff --git a/keyboards/lily58/keymaps/paulomp90/keymap.c b/keyboards/lily58/keymaps/paulomp90/keymap.c index ab45b0409c52..dc8396999f9f 100644 --- a/keyboards/lily58/keymaps/paulomp90/keymap.c +++ b/keyboards/lily58/keymaps/paulomp90/keymap.c @@ -15,49 +15,49 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* QWERTY * ,-----------------------------------------. ,-----------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BSPC | + * | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | '? | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | | Y | U | I | O | P | ' | + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | +* | * |------+------+------+------+------+------| |------+------+------+------+------+------| * |LShift| A | S | D | F | G |-------. ,-------| H | J | K | L | Ç | ~ | - * |------+------+------+------+------+------| <> | | ´` |------+------+------+------+------+------| - * |LCTRL | Z | X | C | V | B |-------| |-------| N | M | , | . | - |RShift| + * |------+------+------+------+------+------| DEL | | BACK |------+------+------+------+------+------| + * |LCTRL | Z | X | C | V | B |-------| |-------| N | M | , | . | - |Shift| * `-----------------------------------------/ / \ \-----------------------------------------' * | Alt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | \| | * | | | |/ / \ \ | | | | * `-------------------''-------' '------''--------------------' */ [_QWERTY] = LAYOUT( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_EQL, KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_GRV, KC_RBRC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_ENT, RAISE, KC_RGUI, KC_BSLS + KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_DEL, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, + KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_ENT, RAISE, KC_RGUI, KC_BSLS ), -/* LOWER + +/* LOWER+ * ,-----------------------------------------. ,-----------------------------------------. * | | | | | | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| * | | BRG- | BRG+ | VOL- | VOL+ | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | MUTE | PREV | PLAY | NEXT | |-------. ,-------| | | | | | | - * |------+------+------+------+------+------| <> | | ´` |------+------+------+------+------+------| - * | | | | | | |-------| |-------| | | * | ª | | | + * | | MUTE | PREV | PLAY | NEXT | |-------. ,-------| | | <> | ºª | ´` | | + * |------+------+------+------+------+------| | | |------+------+------+------+------+------| + * | | | | | | |-------| |-------| | | | | | | * `-----------------------------------------/ / \ \-----------------------------------------' * | Alt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | \| | * | | | |/ / \ \ | | | | * `-------------------''-------' '------''--------------------' */ - -/* _______, _______, _______, _______, _______, _______, _______, _______, KC_PIPE, KC_GRAVE, KC_PLUS, KC_LCBR, KC_RCBR, _______, */ [_LOWER] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______,_______, _______, _______, _______, KC_BRID, KC_BRIU, KC_VOLD, KC_VOLU, _______, _______, _______, _______, _______, _______, _______, - _______, KC_MUTE, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_PLUS, KC_EQL, KC_LBRC, _______, _______, _______, + _______, KC_MUTE, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_GRV, KC_LBRC, KC_RBRC, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), + /* RAISE * ,-----------------------------------------. ,-----------------------------------------. * | | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | | @@ -65,21 +65,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | F1 | | | | | | | | | Up | | | F12 | * |------+------+------+------+------+------| |------+------+------+------+------+------| * | | End | Home | PGDN | PGUP | |-------. ,-------| | Left | Down |Right | | | - * |------+------+------+------+------+------| [ | | ] |------+------+------+------+------+------| - * | | | | | | |-------| |-------| DEL | BSPC | | | | | + * |------+------+------+------+------+------| | | |------+------+------+------+------+------| + * | | | | | | |-------| |-------| | | | | | | * `-----------------------------------------/ / \ \-----------------------------------------' * | Alt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | \| | * | | | |/ / \ \ | | | | * `-------------------''-------' '------''--------------------' */ - /* _______, _______, _______, _______, _______, _______, _______, _______, KC_PLUS, KC_EQL, KC_LBRC, _______, _______, _______,*/ - [_RAISE] = LAYOUT( _______, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, KC_F1, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_UP, XXXXXXX, _______, KC_F12, _______, KC_END, KC_HOME, KC_PGDN, KC_PGUP, _______, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, KC_BSPC, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), diff --git a/keyboards/lily58/keymaps/paulomp90/rules.mk b/keyboards/lily58/keymaps/paulomp90/rules.mk index 063ca44024c1..d8f1b67e8d6a 100644 --- a/keyboards/lily58/keymaps/paulomp90/rules.mk +++ b/keyboards/lily58/keymaps/paulomp90/rules.mk @@ -1,6 +1,6 @@ BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite MOUSEKEY_ENABLE = no # Mouse keys -EXTRAKEY_ENABLE = no # Audio control and System control +EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = no From 7fee7002315fbf4b311ef789aef7b10392e3f5ce Mon Sep 17 00:00:00 2001 From: Paulo Pereira Date: Mon, 3 Apr 2023 15:54:57 +0100 Subject: [PATCH 04/10] Add shift keys --- keyboards/lily58/keymaps/paulomp90/config.h | 13 +- .../paulomp90/features/custom_shift_keys.c | 54 ++++++++ .../paulomp90/features/custom_shift_keys.h | 15 +++ keyboards/lily58/keymaps/paulomp90/keymap.c | 117 ++++++++++++++++-- keyboards/lily58/keymaps/paulomp90/rules.mk | 12 +- 5 files changed, 183 insertions(+), 28 deletions(-) create mode 100644 keyboards/lily58/keymaps/paulomp90/features/custom_shift_keys.c create mode 100644 keyboards/lily58/keymaps/paulomp90/features/custom_shift_keys.h diff --git a/keyboards/lily58/keymaps/paulomp90/config.h b/keyboards/lily58/keymaps/paulomp90/config.h index eb272065ea4f..5d5550e38c7f 100644 --- a/keyboards/lily58/keymaps/paulomp90/config.h +++ b/keyboards/lily58/keymaps/paulomp90/config.h @@ -23,11 +23,9 @@ along with this program. If not, see . /* Select hand configuration */ #define MASTER_LEFT -// #define MASTER_RIGHT -// #define EE_HANDS #define QUICK_TAP_TERM 0 -#define TAPPING_TERM 100 +#define TAPPING_TERM 150 #undef RGBLED_NUM #define RGBLIGHT_EFFECT_BREATHING @@ -46,11 +44,4 @@ along with this program. If not, see . #define RGBLIGHT_SAT_STEP 17 #define RGBLIGHT_VAL_STEP 17 -#define TAP_CODE_DELAY 10 - -// Underglow -/* -#undef RGBLED_NUM -#define RGBLED_NUM 14 // Number of LEDs -#define RGBLIGHT_SLEEP -*/ +#define TAP_CODE_DELAY 10 \ No newline at end of file diff --git a/keyboards/lily58/keymaps/paulomp90/features/custom_shift_keys.c b/keyboards/lily58/keymaps/paulomp90/features/custom_shift_keys.c new file mode 100644 index 000000000000..e27940b6da3e --- /dev/null +++ b/keyboards/lily58/keymaps/paulomp90/features/custom_shift_keys.c @@ -0,0 +1,54 @@ +// Copyright 2021-2023 Google LLC. +// SPDX-License-Identifier: Apache-2.0 + +#include "custom_shift_keys.h" + +bool process_custom_shift_keys(uint16_t keycode, keyrecord_t *record) { + static uint16_t registered_keycode = KC_NO; + + // If a custom shift key is registered, then this event is either + // releasing it or manipulating another key at the same time. Either way, + // we release the currently registered key. + if (registered_keycode != KC_NO) { + unregister_code16(registered_keycode); + registered_keycode = KC_NO; + } + + if (record->event.pressed) { // Press event. + const uint8_t mods = get_mods(); +#ifndef NO_ACTION_ONESHOT + if ((mods | get_weak_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT) { +#else + if ((mods | get_weak_mods()) & MOD_MASK_SHIFT) { // Shift is held. +#endif // NO_ACTION_ONESHOT + // Continue default handling if this is a tap-hold key being held. + if ((IS_QK_MOD_TAP(keycode) || IS_QK_LAYER_TAP(keycode)) && + record->tap.count == 0) { + return true; + } + + // Search for a custom shift key whose keycode is `keycode`. + for (int i = 0; i < NUM_CUSTOM_SHIFT_KEYS; ++i) { + if (keycode == custom_shift_keys[i].keycode) { + registered_keycode = custom_shift_keys[i].shifted_keycode; + if (IS_QK_MODS(registered_keycode) && // Should key be shifted? + (QK_MODS_GET_MODS(registered_keycode) & MOD_LSFT) != 0) { + register_code16(registered_keycode); // If so, press directly. + } else { + // If not, cancel shift mods, press the key, and restore mods. + del_weak_mods(MOD_MASK_SHIFT); +#ifndef NO_ACTION_ONESHOT + del_oneshot_mods(MOD_MASK_SHIFT); +#endif // NO_ACTION_ONESHOT + unregister_mods(MOD_MASK_SHIFT); + register_code16(registered_keycode); + set_mods(mods); + } + return false; + } + } + } + } + + return true; // Continue with default handling. +} diff --git a/keyboards/lily58/keymaps/paulomp90/features/custom_shift_keys.h b/keyboards/lily58/keymaps/paulomp90/features/custom_shift_keys.h new file mode 100644 index 000000000000..69f9b8621451 --- /dev/null +++ b/keyboards/lily58/keymaps/paulomp90/features/custom_shift_keys.h @@ -0,0 +1,15 @@ +// Copyright 2021 Google LLC. +// SPDX-License-Identifier: Apache-2.0 + +#pragma once +#include QMK_KEYBOARD_H + +typedef struct { + uint16_t keycode; + uint16_t shifted_keycode; +} custom_shift_key_t; + +extern const custom_shift_key_t custom_shift_keys[]; +extern uint8_t NUM_CUSTOM_SHIFT_KEYS; + +bool process_custom_shift_keys(uint16_t keycode, keyrecord_t *record); \ No newline at end of file diff --git a/keyboards/lily58/keymaps/paulomp90/keymap.c b/keyboards/lily58/keymaps/paulomp90/keymap.c index dc8396999f9f..9b2e6a381048 100644 --- a/keyboards/lily58/keymaps/paulomp90/keymap.c +++ b/keyboards/lily58/keymaps/paulomp90/keymap.c @@ -1,5 +1,6 @@ #include QMK_KEYBOARD_H #include "keymap_portuguese.h" +#include "features/custom_shift_keys.h" enum layer_number { _QWERTY = 0, @@ -8,6 +9,36 @@ enum layer_number { _ADJUST, }; +//----------------------------- +// tap dance shifts + +typedef struct { + bool is_press_action; + int state; +} tap; + +enum { + SINGLE_TAP = 1, + SINGLE_HOLD = 2, +}; + +//Tap dance enums +enum { + LEFT_SHIFT = 0, + RIGHT_SHIFT = 1 +}; +//--------------------- +//Shifted values + + + +const custom_shift_key_t custom_shift_keys[] = { + {KC_BSPC , KC_DEL}, // Shift . is ? +}; +uint8_t NUM_CUSTOM_SHIFT_KEYS = + sizeof(custom_shift_keys) / sizeof(custom_shift_key_t); + +//---------------------- #define RAISE MO(_RAISE) #define LOWER MO(_LOWER) @@ -19,33 +50,33 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------| |------+------+------+------+------+------| * | Tab | Q | W | E | R | T | | Y | U | I | O | P | +* | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * |LShift| A | S | D | F | G |-------. ,-------| H | J | K | L | Ç | ~ | - * |------+------+------+------+------+------| DEL | | BACK |------+------+------+------+------+------| + * |LShift| A | S | D | F | G |-------. ,-------| H | J | K | L | Ç | BACK | + * |------+------+------+------+------+------| <> | | ´` |------+------+------+------+------+------| * |LCTRL | Z | X | C | V | B |-------| |-------| N | M | , | . | - |Shift| * `-----------------------------------------/ / \ \-----------------------------------------' - * | Alt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | \| | + * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | RAlt | * | | | |/ / \ \ | | | | * `-------------------''-------' '------''--------------------' */ [_QWERTY] = LAYOUT( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_EQL, - KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_DEL, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, - KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_ENT, RAISE, KC_RGUI, KC_BSLS + TD(LEFT_SHIFT), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_BSPC, + KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_GRV, KC_RBRC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TD(RIGHT_SHIFT), + KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_ENT, RAISE, KC_RGUI, KC_RALT ), -/* LOWER+ +/* LOWER * ,-----------------------------------------. ,-----------------------------------------. * | | | | | | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| * | | BRG- | BRG+ | VOL- | VOL+ | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | MUTE | PREV | PLAY | NEXT | |-------. ,-------| | | <> | ºª | ´` | | + * | | MUTE | PREV | PLAY | NEXT | |-------. ,-------| | | \| | ºª | ~^ | | * |------+------+------+------+------+------| | | |------+------+------+------+------+------| * | | | | | | |-------| |-------| | | | | | | * `-----------------------------------------/ / \ \-----------------------------------------' - * | Alt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | \| | + * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | RAlt | * | | | |/ / \ \ | | | | * `-------------------''-------' '------''--------------------' */ @@ -53,7 +84,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_LOWER] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______,_______, _______, _______, _______, KC_BRID, KC_BRIU, KC_VOLD, KC_VOLU, _______, _______, _______, _______, _______, _______, _______, - _______, KC_MUTE, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_GRV, KC_LBRC, KC_RBRC, _______, + _______, KC_MUTE, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_BSLS, KC_LBRC, KC_QUOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), @@ -68,7 +99,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------| | | |------+------+------+------+------+------| * | | | | | | |-------| |-------| | | | | | | * `-----------------------------------------/ / \ \-----------------------------------------' - * | Alt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | \| | + * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | RAlt | * | | | |/ / \ \ | | | | * `-------------------''-------' '------''--------------------' */ @@ -91,7 +122,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------| | | |------+------+------+------+------+------| * | MODE | HUE- | SAT- | VAL- | | |-------| |-------| | | | | | | * `-----------------------------------------/ / \ \-----------------------------------------' - * | Alt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | \| | + * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | RAlt | * | | | |/ / \ \ | | | | * `----------------------------' '------''--------------------' */ @@ -146,6 +177,7 @@ bool oled_task_user(void) { #endif // OLED_ENABLE bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!process_custom_shift_keys(keycode, record)) { return false; } if (record->event.pressed) { #ifdef OLED_ENABLE set_keylog(keycode, record); @@ -154,3 +186,64 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return true; } + + +//--------------------------------- +// Tap dance shifts + +int cur_dance (tap_dance_state_t *state) { + if (state->count == 1) { + if (state->pressed) return SINGLE_HOLD; + else return SINGLE_TAP; + } + else return 0; +} + +static tap lshifttap_state = { + .is_press_action = true, + .state = 0 +}; + +static tap rshifttap_state = { + .is_press_action = true, + .state = 0 +}; + +void lshift_finished (tap_dance_state_t *state, void *user_data) { + lshifttap_state.state = cur_dance(state); + switch (lshifttap_state.state) { + case SINGLE_TAP: register_code16(LALT(KC_LEFT)); break; + case SINGLE_HOLD: register_code(KC_LSFT); break; + } +} + +void lshift_reset (tap_dance_state_t *state, void *user_data) { + switch (lshifttap_state.state) { + case SINGLE_TAP: unregister_code16(LALT(KC_LEFT)); break; + case SINGLE_HOLD: unregister_code(KC_LSFT); break; + } + lshifttap_state.state = 0; +} + +void rshift_finished (tap_dance_state_t *state, void *user_data) { + rshifttap_state.state = cur_dance(state); + switch (rshifttap_state.state) { + case SINGLE_TAP: register_code16(LALT(KC_RGHT)); break; + case SINGLE_HOLD: register_code(KC_RSFT); break; + } +} + +void rshift_reset (tap_dance_state_t *state, void *user_data) { + switch (rshifttap_state.state) { + case SINGLE_TAP: unregister_code16(LALT(KC_RGHT)); break; + case SINGLE_HOLD: unregister_code(KC_RSFT); break; + } + rshifttap_state.state = 0; +} + +tap_dance_action_t tap_dance_actions[] = { + [LEFT_SHIFT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lshift_finished, lshift_reset), + [RIGHT_SHIFT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, rshift_finished, rshift_reset), +}; + +//----------------- \ No newline at end of file diff --git a/keyboards/lily58/keymaps/paulomp90/rules.mk b/keyboards/lily58/keymaps/paulomp90/rules.mk index d8f1b67e8d6a..d44a7268eeb9 100644 --- a/keyboards/lily58/keymaps/paulomp90/rules.mk +++ b/keyboards/lily58/keymaps/paulomp90/rules.mk @@ -1,20 +1,22 @@ BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite -MOUSEKEY_ENABLE = no # Mouse keys +# MOUSEKEY_ENABLE = no # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = no # Console for debug -COMMAND_ENABLE = no # Commands for debug and configuration +# CONSOLE_ENABLE = no # Console for debug +# COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = no BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -AUDIO_ENABLE = no # Audio output +# AUDIO_ENABLE = no # Audio output RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -SWAP_HANDS_ENABLE = no # Enable one-hand typing +# SWAP_HANDS_ENABLE = no # Enable one-hand typing OLED_ENABLE= yes # OLED display +TAP_DANCE_ENABLE = yes # If you want to change the display of OLED, you need to change here SRC += ./lib/rgb_state_reader.c \ ./lib/layer_state_reader.c \ ./lib/logo_reader.c \ ./lib/keylogger.c \ + features/custom_shift_keys.c \ # ./lib/mode_icon_reader.c \ # ./lib/host_led_state_reader.c \ # ./lib/timelogger.c \ From 29c03c523a62ce7c9cbd0e355fa5d336f87b3833 Mon Sep 17 00:00:00 2001 From: Paulo Pereira Date: Mon, 3 Apr 2023 16:51:41 +0100 Subject: [PATCH 05/10] remove some code --- keyboards/lily58/keymaps/paulomp90/config.h | 22 -- keyboards/lily58/keymaps/paulomp90/keymap.c | 362 +++++++++---------- keyboards/lily58/keymaps/paulomp90/readme.md | 4 +- keyboards/lily58/keymaps/paulomp90/rules.mk | 9 - 4 files changed, 178 insertions(+), 219 deletions(-) diff --git a/keyboards/lily58/keymaps/paulomp90/config.h b/keyboards/lily58/keymaps/paulomp90/config.h index 5d5550e38c7f..d516f9711e9e 100644 --- a/keyboards/lily58/keymaps/paulomp90/config.h +++ b/keyboards/lily58/keymaps/paulomp90/config.h @@ -1,27 +1,5 @@ -/* -This is the c configuration file for the keymap - -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert - -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 . -*/ - #pragma once -/* Select hand configuration */ - #define MASTER_LEFT #define QUICK_TAP_TERM 0 diff --git a/keyboards/lily58/keymaps/paulomp90/keymap.c b/keyboards/lily58/keymaps/paulomp90/keymap.c index 9b2e6a381048..0d1690fa59fe 100644 --- a/keyboards/lily58/keymaps/paulomp90/keymap.c +++ b/keyboards/lily58/keymaps/paulomp90/keymap.c @@ -3,247 +3,235 @@ #include "features/custom_shift_keys.h" enum layer_number { - _QWERTY = 0, - _LOWER, - _RAISE, - _ADJUST, + _QWERTY = 0, + _LOWER, + _RAISE, + _ADJUST, }; -//----------------------------- -// tap dance shifts - +/* tap dance shifts */ typedef struct { - bool is_press_action; - int state; + bool is_press_action; + int state; } tap; enum { - SINGLE_TAP = 1, - SINGLE_HOLD = 2, -}; - -//Tap dance enums -enum { - LEFT_SHIFT = 0, - RIGHT_SHIFT = 1 + SINGLE_TAP = 1, + SINGLE_HOLD = 2, }; -//--------------------- -//Shifted values - +enum { LEFT_SHIFT = 0, RIGHT_SHIFT = 1 }; const custom_shift_key_t custom_shift_keys[] = { - {KC_BSPC , KC_DEL}, // Shift . is ? + {KC_BSPC, KC_DEL}, }; -uint8_t NUM_CUSTOM_SHIFT_KEYS = - sizeof(custom_shift_keys) / sizeof(custom_shift_key_t); -//---------------------- +uint8_t NUM_CUSTOM_SHIFT_KEYS = sizeof(custom_shift_keys) / sizeof(custom_shift_key_t); + #define RAISE MO(_RAISE) #define LOWER MO(_LOWER) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* QWERTY - * ,-----------------------------------------. ,-----------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | '? | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | | Y | U | I | O | P | +* | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * |LShift| A | S | D | F | G |-------. ,-------| H | J | K | L | Ç | BACK | - * |------+------+------+------+------+------| <> | | ´` |------+------+------+------+------+------| - * |LCTRL | Z | X | C | V | B |-------| |-------| N | M | , | . | - |Shift| - * `-----------------------------------------/ / \ \-----------------------------------------' - * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | RAlt | - * | | | |/ / \ \ | | | | - * `-------------------''-------' '------''--------------------' - */ - [_QWERTY] = LAYOUT( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_EQL, - TD(LEFT_SHIFT), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_BSPC, - KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_GRV, KC_RBRC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TD(RIGHT_SHIFT), - KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_ENT, RAISE, KC_RGUI, KC_RALT -), - -/* LOWER - * ,-----------------------------------------. ,-----------------------------------------. - * | | | | | | | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | BRG- | BRG+ | VOL- | VOL+ | | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | MUTE | PREV | PLAY | NEXT | |-------. ,-------| | | \| | ºª | ~^ | | - * |------+------+------+------+------+------| | | |------+------+------+------+------+------| - * | | | | | | |-------| |-------| | | | | | | - * `-----------------------------------------/ / \ \-----------------------------------------' - * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | RAlt | - * | | | |/ / \ \ | | | | - * `-------------------''-------' '------''--------------------' - */ - -[_LOWER] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______,_______, _______, _______, - _______, KC_BRID, KC_BRIU, KC_VOLD, KC_VOLU, _______, _______, _______, _______, _______, _______, _______, - _______, KC_MUTE, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_BSLS, KC_LBRC, KC_QUOT, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______ -), - -/* RAISE - * ,-----------------------------------------. ,-----------------------------------------. - * | | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | F1 | | | | | | | | | Up | | | F12 | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | End | Home | PGDN | PGUP | |-------. ,-------| | Left | Down |Right | | | - * |------+------+------+------+------+------| | | |------+------+------+------+------+------| - * | | | | | | |-------| |-------| | | | | | | - * `-----------------------------------------/ / \ \-----------------------------------------' - * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | RAlt | - * | | | |/ / \ \ | | | | - * `-------------------''-------' '------''--------------------' - */ - -[_RAISE] = LAYOUT( - _______, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, - KC_F1, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_UP, XXXXXXX, _______, KC_F12, - _______, KC_END, KC_HOME, KC_PGDN, KC_PGUP, _______, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______ -), - -/* ADJUST - * ,-----------------------------------------. ,-----------------------------------------. - * | | | | | | | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | | | | | | | | | | | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * |RGB ON| HUE+ | SAT+ | VAL+ | | |-------. ,-------| | | | | | | - * |------+------+------+------+------+------| | | |------+------+------+------+------+------| - * | MODE | HUE- | SAT- | VAL- | | |-------| |-------| | | | | | | - * `-----------------------------------------/ / \ \-----------------------------------------' - * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | RAlt | - * | | | |/ / \ \ | | | | - * `----------------------------' '------''--------------------' - */ - [_ADJUST] = LAYOUT( - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - _______, _______, _______, _______, _______, _______, _______, _______ - ) + /* QWERTY + * ,-----------------------------------------. ,-----------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | '? | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | +* | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |LShift| A | S | D | F | G |-------. ,-------| H | J | K | L | Ç | BACK | + * |------+------+------+------+------+------| <> | | ´` |------+------+------+------+------+------| + * |LCTRL | Z | X | C | V | B |-------| |-------| N | M | , | . | - |Shift| + * `-----------------------------------------/ / \ \-----------------------------------------' + * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | RAlt | + * | | | |/ / \ \ | | | | + * `-------------------''-------' '------''--------------------' + */ + [_QWERTY] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_EQL, + TD(LEFT_SHIFT), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_BSPC, + KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_GRV, KC_RBRC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TD(RIGHT_SHIFT), + KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_ENT, RAISE, KC_RGUI, KC_RALT + ), + + /* LOWER + * ,-----------------------------------------. ,-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | BRG- | BRG+ | VOL- | VOL+ | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | MUTE | PREV | PLAY | NEXT | |-------. ,-------| | | \| | ºª | ~^ | | + * |------+------+------+------+------+------| | | |------+------+------+------+------+------| + * | | | | | | |-------| |-------| | | | | | | + * `-----------------------------------------/ / \ \-----------------------------------------' + * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | RAlt | + * | | | |/ / \ \ | | | | + * `-------------------''-------' '------''--------------------' + */ + + [_LOWER] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______,_______, _______, _______, + _______, KC_BRID, KC_BRIU, KC_VOLD, KC_VOLU, _______, _______, _______, _______, _______, _______, _______, + _______, KC_MUTE, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_BSLS, KC_LBRC, KC_QUOT, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + + /* RAISE + * ,-----------------------------------------. ,-----------------------------------------. + * | | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | F1 | | | | | | | | | Up | | | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | End | Home | PGDN | PGUP | |-------. ,-------| | Left | Down |Right | | | + * |------+------+------+------+------+------| | | |------+------+------+------+------+------| + * | | | | | | |-------| |-------| | | | | | | + * `-----------------------------------------/ / \ \-----------------------------------------' + * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | RAlt | + * | | | |/ / \ \ | | | | + * `-------------------''-------' '------''--------------------' + */ + + [_RAISE] = LAYOUT( + _______, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, + KC_F1, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_UP, XXXXXXX, _______, KC_F12, + _______, KC_END, KC_HOME, KC_PGDN, KC_PGUP, _______, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + + /* ADJUST + * ,-----------------------------------------. ,-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |RGB ON| HUE+ | SAT+ | VAL+ | | |-------. ,-------| | | | | | | + * |------+------+------+------+------+------| | | |------+------+------+------+------+------| + * | MODE | HUE- | SAT- | VAL- | | |-------| |-------| | | | | | | + * `-----------------------------------------/ / \ \-----------------------------------------' + * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | RAlt | + * | | | |/ / \ \ | | | | + * `----------------------------' '------''--------------------' + */ + + [_ADJUST] = LAYOUT( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, _______, _______, _______, _______, _______, _______, _______ + ) }; layer_state_t layer_state_set_user(layer_state_t state) { - return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); } -//SSD1306 OLED update loop, make sure to enable OLED_ENABLE=yes in rules.mk +// SSD1306 OLED update loop, make sure to enable OLED_ENABLE=yes in rules.mk #ifdef OLED_ENABLE oled_rotation_t oled_init_user(oled_rotation_t rotation) { - if (!is_keyboard_master()) - return OLED_ROTATION_180; // flips the display 180 degrees if offhand - return rotation; + if (!is_keyboard_master()) return OLED_ROTATION_180; // flips the display 180 degrees if offhand + return rotation; } // When you add source files to SRC in rules.mk, you can use functions. const char *read_layer_state(void); const char *read_logo(void); -void set_keylog(uint16_t keycode, keyrecord_t *record); +void set_keylog(uint16_t keycode, keyrecord_t *record); const char *read_keylog(void); const char *read_keylogs(void); -// const char *read_mode_icon(bool swap); -// const char *read_host_led_state(void); -// void set_timelog(void); -// const char *read_timelog(void); - bool oled_task_user(void) { - if (is_keyboard_master()) { - // If you want to change the display of OLED, you need to change here - oled_write_ln(read_layer_state(), false); - oled_write_ln(read_keylog(), false); - oled_write_ln(read_keylogs(), false); - //oled_write_ln(read_mode_icon(keymap_config.swap_lalt_lgui), false); - //oled_write_ln(read_host_led_state(), false); - //oled_write_ln(read_timelog(), false); - } else { - oled_write(read_logo(), false); - } + if (is_keyboard_master()) { + oled_write_ln(read_layer_state(), false); + oled_write_ln(read_keylog(), false); + oled_write_ln(read_keylogs(), false); + } else { + oled_write(read_logo(), false); + } return false; } #endif // OLED_ENABLE bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (!process_custom_shift_keys(keycode, record)) { return false; } - if (record->event.pressed) { + if (!process_custom_shift_keys(keycode, record)) { + return false; + } + if (record->event.pressed) { #ifdef OLED_ENABLE - set_keylog(keycode, record); + set_keylog(keycode, record); #endif - // set_timelog(); - } - return true; + } + return true; } - -//--------------------------------- -// Tap dance shifts - -int cur_dance (tap_dance_state_t *state) { - if (state->count == 1) { - if (state->pressed) return SINGLE_HOLD; - else return SINGLE_TAP; - } - else return 0; +/* Tap dance shifts */ +int cur_dance(tap_dance_state_t *state) { + if (state->count == 1) { + if (state->pressed) + return SINGLE_HOLD; + else + return SINGLE_TAP; + } else + return 0; } -static tap lshifttap_state = { - .is_press_action = true, - .state = 0 -}; +static tap lshifttap_state = {.is_press_action = true, .state = 0}; -static tap rshifttap_state = { - .is_press_action = true, - .state = 0 -}; +static tap rshifttap_state = {.is_press_action = true, .state = 0}; -void lshift_finished (tap_dance_state_t *state, void *user_data) { - lshifttap_state.state = cur_dance(state); - switch (lshifttap_state.state) { - case SINGLE_TAP: register_code16(LALT(KC_LEFT)); break; - case SINGLE_HOLD: register_code(KC_LSFT); break; - } +void lshift_finished(tap_dance_state_t *state, void *user_data) { + lshifttap_state.state = cur_dance(state); + switch (lshifttap_state.state) { + case SINGLE_TAP: + register_code16(LALT(KC_LEFT)); + break; + case SINGLE_HOLD: + register_code(KC_LSFT); + break; + } } -void lshift_reset (tap_dance_state_t *state, void *user_data) { - switch (lshifttap_state.state) { - case SINGLE_TAP: unregister_code16(LALT(KC_LEFT)); break; - case SINGLE_HOLD: unregister_code(KC_LSFT); break; - } - lshifttap_state.state = 0; +void lshift_reset(tap_dance_state_t *state, void *user_data) { + switch (lshifttap_state.state) { + case SINGLE_TAP: + unregister_code16(LALT(KC_LEFT)); + break; + case SINGLE_HOLD: + unregister_code(KC_LSFT); + break; + } + lshifttap_state.state = 0; } -void rshift_finished (tap_dance_state_t *state, void *user_data) { - rshifttap_state.state = cur_dance(state); - switch (rshifttap_state.state) { - case SINGLE_TAP: register_code16(LALT(KC_RGHT)); break; - case SINGLE_HOLD: register_code(KC_RSFT); break; - } +void rshift_finished(tap_dance_state_t *state, void *user_data) { + rshifttap_state.state = cur_dance(state); + switch (rshifttap_state.state) { + case SINGLE_TAP: + register_code16(LALT(KC_RGHT)); + break; + case SINGLE_HOLD: + register_code(KC_RSFT); + break; + } } -void rshift_reset (tap_dance_state_t *state, void *user_data) { - switch (rshifttap_state.state) { - case SINGLE_TAP: unregister_code16(LALT(KC_RGHT)); break; - case SINGLE_HOLD: unregister_code(KC_RSFT); break; - } - rshifttap_state.state = 0; +void rshift_reset(tap_dance_state_t *state, void *user_data) { + switch (rshifttap_state.state) { + case SINGLE_TAP: + unregister_code16(LALT(KC_RGHT)); + break; + case SINGLE_HOLD: + unregister_code(KC_RSFT); + break; + } + rshifttap_state.state = 0; } tap_dance_action_t tap_dance_actions[] = { - [LEFT_SHIFT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lshift_finished, lshift_reset), - [RIGHT_SHIFT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, rshift_finished, rshift_reset), + [LEFT_SHIFT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lshift_finished, lshift_reset), + [RIGHT_SHIFT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, rshift_finished, rshift_reset), }; - -//----------------- \ No newline at end of file diff --git a/keyboards/lily58/keymaps/paulomp90/readme.md b/keyboards/lily58/keymaps/paulomp90/readme.md index e546668bb302..967bd0cb0a8e 100644 --- a/keyboards/lily58/keymaps/paulomp90/readme.md +++ b/keyboards/lily58/keymaps/paulomp90/readme.md @@ -2,4 +2,6 @@ Lily58 is 6×4+5keys column-staggered split keyboard. -Add portuguese include \ No newline at end of file +- Add portuguese include +- Add custom shift behaviour, when tap move by 1 word left <> right, when held act as shift. +idea taken from [here](https://getreuer.info/posts/keyboards/custom-shift-keys/index.html). \ No newline at end of file diff --git a/keyboards/lily58/keymaps/paulomp90/rules.mk b/keyboards/lily58/keymaps/paulomp90/rules.mk index d44a7268eeb9..1ab43bc750d5 100644 --- a/keyboards/lily58/keymaps/paulomp90/rules.mk +++ b/keyboards/lily58/keymaps/paulomp90/rules.mk @@ -1,13 +1,4 @@ -BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite -# MOUSEKEY_ENABLE = no # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control -# CONSOLE_ENABLE = no # Console for debug -# COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = no -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -# AUDIO_ENABLE = no # Audio output -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -# SWAP_HANDS_ENABLE = no # Enable one-hand typing OLED_ENABLE= yes # OLED display TAP_DANCE_ENABLE = yes From 3b6c2d38dd99afb4ce4d53b96d4d1509768af0e3 Mon Sep 17 00:00:00 2001 From: Paulo Pereira Date: Mon, 3 Apr 2023 17:25:49 +0100 Subject: [PATCH 06/10] Add keymap image --- keyboards/lily58/keymaps/paulomp90/readme.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/keyboards/lily58/keymaps/paulomp90/readme.md b/keyboards/lily58/keymaps/paulomp90/readme.md index 967bd0cb0a8e..9ab72cd0b2c5 100644 --- a/keyboards/lily58/keymaps/paulomp90/readme.md +++ b/keyboards/lily58/keymaps/paulomp90/readme.md @@ -1,7 +1,10 @@ # Paulo Lily58 -Lily58 is 6×4+5keys column-staggered split keyboard. +Lily58 is 6×4 column-staggered split keyboard. + +![Keymap first layer](https://i.postimg.cc/HWcgcxb8/lily58.png "Keymap first layer") - Add portuguese include - Add custom shift behaviour, when tap move by 1 word left <> right, when held act as shift. -idea taken from [here](https://getreuer.info/posts/keyboards/custom-shift-keys/index.html). \ No newline at end of file +idea taken from [here](https://getreuer.info/posts/keyboards/custom-shift-keys/index.html). + From 42e53e6e415620d31d7c44195a7a326a6c577385 Mon Sep 17 00:00:00 2001 From: Paulo Pereira Date: Tue, 4 Apr 2023 20:31:45 +0100 Subject: [PATCH 07/10] Apply suggestion and some improvements --- keyboards/lily58/keymaps/paulomp90/config.h | 16 +++++ .../paulomp90/features/custom_shift_keys.c | 17 ++++- .../paulomp90/features/custom_shift_keys.h | 18 ++++- keyboards/lily58/keymaps/paulomp90/keymap.c | 70 +++++++++++-------- keyboards/lily58/keymaps/paulomp90/rules.mk | 1 + 5 files changed, 88 insertions(+), 34 deletions(-) diff --git a/keyboards/lily58/keymaps/paulomp90/config.h b/keyboards/lily58/keymaps/paulomp90/config.h index d516f9711e9e..7c67aa4bc252 100644 --- a/keyboards/lily58/keymaps/paulomp90/config.h +++ b/keyboards/lily58/keymaps/paulomp90/config.h @@ -1,3 +1,19 @@ +/* Copyright 2023 Paulo Pereira + * + * 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 3 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 . + */ + #pragma once #define MASTER_LEFT diff --git a/keyboards/lily58/keymaps/paulomp90/features/custom_shift_keys.c b/keyboards/lily58/keymaps/paulomp90/features/custom_shift_keys.c index e27940b6da3e..f2e091c0b9dc 100644 --- a/keyboards/lily58/keymaps/paulomp90/features/custom_shift_keys.c +++ b/keyboards/lily58/keymaps/paulomp90/features/custom_shift_keys.c @@ -1,5 +1,18 @@ -// Copyright 2021-2023 Google LLC. -// SPDX-License-Identifier: Apache-2.0 +/* Copyright 2023 Paulo Pereira + * + * 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 3 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 . + */ #include "custom_shift_keys.h" diff --git a/keyboards/lily58/keymaps/paulomp90/features/custom_shift_keys.h b/keyboards/lily58/keymaps/paulomp90/features/custom_shift_keys.h index 69f9b8621451..2097f2bb7ea3 100644 --- a/keyboards/lily58/keymaps/paulomp90/features/custom_shift_keys.h +++ b/keyboards/lily58/keymaps/paulomp90/features/custom_shift_keys.h @@ -1,5 +1,19 @@ -// Copyright 2021 Google LLC. -// SPDX-License-Identifier: Apache-2.0 +/* Copyright 2023 Paulo Pereira + * + * 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 3 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 . + */ + #pragma once #include QMK_KEYBOARD_H diff --git a/keyboards/lily58/keymaps/paulomp90/keymap.c b/keyboards/lily58/keymaps/paulomp90/keymap.c index 0d1690fa59fe..e3f7ad45c83c 100644 --- a/keyboards/lily58/keymaps/paulomp90/keymap.c +++ b/keyboards/lily58/keymaps/paulomp90/keymap.c @@ -1,3 +1,19 @@ +/* Copyright 2023 Paulo Pereira + * + * 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 3 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 . + */ + #include QMK_KEYBOARD_H #include "keymap_portuguese.h" #include "features/custom_shift_keys.h" @@ -41,7 +57,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------| |------+------+------+------+------+------| * |LShift| A | S | D | F | G |-------. ,-------| H | J | K | L | Ç | BACK | * |------+------+------+------+------+------| <> | | ´` |------+------+------+------+------+------| - * |LCTRL | Z | X | C | V | B |-------| |-------| N | M | , | . | - |Shift| + * |LCTRL | Z | X | C | V | B |-------| |-------| N | M | ,; | .: | _- |Shift| * `-----------------------------------------/ / \ \-----------------------------------------' * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | RAlt | * | | | |/ / \ \ | | | | @@ -52,54 +68,52 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_EQL, TD(LEFT_SHIFT), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_BSPC, KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_GRV, KC_RBRC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TD(RIGHT_SHIFT), - KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_ENT, RAISE, KC_RGUI, KC_RALT + KC_LALT, KC_LGUI, TL_LOWR, KC_SPC, KC_ENT, TL_UPPR, KC_RGUI, KC_RALT ), /* LOWER * ,-----------------------------------------. ,-----------------------------------------. * | | | | | | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | BRG- | BRG+ | VOL- | VOL+ | | | | | | | | | + * | | F1 | F2 | F3 | F4 | F5 | | PgUp | HOME | Up | END | ºª | | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | MUTE | PREV | PLAY | NEXT | |-------. ,-------| | | \| | ºª | ~^ | | + * | | F6 | F7 | F8 | F9 | F10 |-------. ,-------| PgDn | Left | Down |Right | ~^ | | * |------+------+------+------+------+------| | | |------+------+------+------+------+------| - * | | | | | | |-------| |-------| | | | | | | + * | | F11 | F12 | << | >|| | >> |-------| |-------| | Vol+ | Vol- | Mute | \| | | * `-----------------------------------------/ / \ \-----------------------------------------' * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | RAlt | * | | | |/ / \ \ | | | | * `-------------------''-------' '------''--------------------' */ - [_LOWER] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______,_______, _______, _______, - _______, KC_BRID, KC_BRIU, KC_VOLD, KC_VOLU, _______, _______, _______, _______, _______, _______, _______, - _______, KC_MUTE, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_BSLS, KC_LBRC, KC_QUOT, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_LBRC, _______, + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_QUOT, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, KC_VOLD, KC_MUTE, KC_BSLS, _______, + _______, _______, _______, _______, _______, _______, _______, _______ ), /* RAISE * ,-----------------------------------------. ,-----------------------------------------. - * | | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | | + * | | | | | | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | F1 | | | | | | | | | Up | | | F12 | + * | | 1 | 2 | 3 | 4 | 5 | | PgUp | HOME | Up | END | ºª | | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | End | Home | PGDN | PGUP | |-------. ,-------| | Left | Down |Right | | | + * | | 6 | 7 | 8 | 9 | 0 |-------. ,-------| PgDn | Left | Down |Right | ~^ | | * |------+------+------+------+------+------| | | |------+------+------+------+------+------| - * | | | | | | |-------| |-------| | | | | | | + * | | | | << | >|| | >> |-------| |-------| | Vol+ | Vol- | Mute | \| | | * `-----------------------------------------/ / \ \-----------------------------------------' * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | RAlt | * | | | |/ / \ \ | | | | * `-------------------''-------' '------''--------------------' */ - [_RAISE] = LAYOUT( - _______, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, - KC_F1, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_UP, XXXXXXX, _______, KC_F12, - _______, KC_END, KC_HOME, KC_PGDN, KC_PGUP, _______, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______ - ), + _______, _______, _______, _______, _______, _______, _______, _______, _______,_______, _______, _______, + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_LBRC, _______, + _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_QUOT, _______, + _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_VOLU, KC_VOLD, KC_MUTE, KC_BSLS, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), /* ADJUST * ,-----------------------------------------. ,-----------------------------------------. @@ -107,9 +121,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------| |------+------+------+------+------+------| * | | | | | | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * |RGB ON| HUE+ | SAT+ | VAL+ | | |-------. ,-------| | | | | | | + * |RGB ON| HUE+ | SAT+ | VAL+ | | BRG+ |-------. ,-------| | | | | | | * |------+------+------+------+------+------| | | |------+------+------+------+------+------| - * | MODE | HUE- | SAT- | VAL- | | |-------| |-------| | | | | | | + * | MODE | HUE- | SAT- | VAL- | | BRG- |-------| |-------| | | | | | | * `-----------------------------------------/ / \ \-----------------------------------------' * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | RAlt | * | | | |/ / \ \ | | | | @@ -119,16 +133,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJUST] = LAYOUT( XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, KC_BRIU, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, KC_BRID, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______ ) }; -layer_state_t layer_state_set_user(layer_state_t state) { - return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); -} - // SSD1306 OLED update loop, make sure to enable OLED_ENABLE=yes in rules.mk #ifdef OLED_ENABLE diff --git a/keyboards/lily58/keymaps/paulomp90/rules.mk b/keyboards/lily58/keymaps/paulomp90/rules.mk index 1ab43bc750d5..d7bfc9739429 100644 --- a/keyboards/lily58/keymaps/paulomp90/rules.mk +++ b/keyboards/lily58/keymaps/paulomp90/rules.mk @@ -1,6 +1,7 @@ EXTRAKEY_ENABLE = yes # Audio control and System control OLED_ENABLE= yes # OLED display TAP_DANCE_ENABLE = yes +TRI_LAYER_ENABLE = yes # If you want to change the display of OLED, you need to change here SRC += ./lib/rgb_state_reader.c \ From 63212207cc9a2ea2c3cd6ad00b88d6f42c6ebfda Mon Sep 17 00:00:00 2001 From: Paulo Pereira Date: Tue, 4 Apr 2023 22:01:19 +0100 Subject: [PATCH 08/10] update stuff --- keyboards/lily58/keymaps/paulomp90/keymap.c | 92 +++++++++++++-------- 1 file changed, 58 insertions(+), 34 deletions(-) diff --git a/keyboards/lily58/keymaps/paulomp90/keymap.c b/keyboards/lily58/keymaps/paulomp90/keymap.c index e3f7ad45c83c..57546d70faff 100644 --- a/keyboards/lily58/keymaps/paulomp90/keymap.c +++ b/keyboards/lily58/keymaps/paulomp90/keymap.c @@ -31,10 +31,13 @@ typedef struct { int state; } tap; -enum { - SINGLE_TAP = 1, - SINGLE_HOLD = 2, -}; +typedef enum { + TD_NONE, + TD_UNKNOWN, + TD_SINGLE_TAP, + TD_SINGLE_HOLD, + TD_DOUBLE_TAP +} td_state_t; enum { LEFT_SHIFT = 0, RIGHT_SHIFT = 1 }; @@ -44,9 +47,6 @@ const custom_shift_key_t custom_shift_keys[] = { uint8_t NUM_CUSTOM_SHIFT_KEYS = sizeof(custom_shift_keys) / sizeof(custom_shift_key_t); -#define RAISE MO(_RAISE) -#define LOWER MO(_LOWER) - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* QWERTY @@ -73,23 +73,23 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* LOWER * ,-----------------------------------------. ,-----------------------------------------. - * | | | | | | | | | | | | | | + * | | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | F1 | F2 | F3 | F4 | F5 | | PgUp | HOME | Up | END | ºª | | + * | F1 | | | | | | | PgUp | HOME | Up | END | ºª | F12 | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | F6 | F7 | F8 | F9 | F10 |-------. ,-------| PgDn | Left | Down |Right | ~^ | | + * | | | | | | |-------. ,-------| PgDn | Left | Down |Right | ~^ | | * |------+------+------+------+------+------| | | |------+------+------+------+------+------| - * | | F11 | F12 | << | >|| | >> |-------| |-------| | Vol+ | Vol- | Mute | \| | | + * | | | | << | >|| | >> |-------| |-------| | Vol+ | Vol- | Mute | \| | | * `-----------------------------------------/ / \ \-----------------------------------------' * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | RAlt | * | | | |/ / \ \ | | | | * `-------------------''-------' '------''--------------------' */ [_LOWER] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_LBRC, _______, - KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_QUOT, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, KC_VOLD, KC_MUTE, KC_BSLS, _______, + _______, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, + KC_F1, _______, _______, _______, _______, _______, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_LBRC, KC_F12, + _______, _______, _______, _______, _______, _______, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_QUOT, _______, + _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_VOLU, KC_VOLD, KC_MUTE, KC_BSLS, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), @@ -179,66 +179,90 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } /* Tap dance shifts */ -int cur_dance(tap_dance_state_t *state) { +td_state_t cur_dance(tap_dance_state_t *state) { if (state->count == 1) { - if (state->pressed) - return SINGLE_HOLD; - else - return SINGLE_TAP; - } else - return 0; + if (state->interrupted || !state->pressed) { + return TD_SINGLE_TAP; + } else { + return TD_SINGLE_HOLD; + } + } else if (state->count == 2) { + return TD_DOUBLE_TAP; + } + + return TD_UNKNOWN; } -static tap lshifttap_state = {.is_press_action = true, .state = 0}; +static tap lshifttap_state = {.is_press_action = true, .state = TD_NONE}; -static tap rshifttap_state = {.is_press_action = true, .state = 0}; +static tap rshifttap_state = {.is_press_action = true, .state = TD_NONE}; void lshift_finished(tap_dance_state_t *state, void *user_data) { lshifttap_state.state = cur_dance(state); + switch (lshifttap_state.state) { - case SINGLE_TAP: + case TD_SINGLE_TAP: register_code16(LALT(KC_LEFT)); break; - case SINGLE_HOLD: + case TD_SINGLE_HOLD: register_code(KC_LSFT); break; + case TD_DOUBLE_TAP: + tap_code16(LALT(KC_LEFT)); + register_code16(LALT(KC_LEFT)); + break; + default: + break; } } void lshift_reset(tap_dance_state_t *state, void *user_data) { switch (lshifttap_state.state) { - case SINGLE_TAP: + case TD_SINGLE_TAP: unregister_code16(LALT(KC_LEFT)); break; - case SINGLE_HOLD: + case TD_SINGLE_HOLD: unregister_code(KC_LSFT); break; + case TD_DOUBLE_TAP: + unregister_code16(LALT(KC_LEFT)); + break; } - lshifttap_state.state = 0; + lshifttap_state.state = TD_NONE; } void rshift_finished(tap_dance_state_t *state, void *user_data) { rshifttap_state.state = cur_dance(state); + switch (rshifttap_state.state) { - case SINGLE_TAP: + case TD_SINGLE_TAP: register_code16(LALT(KC_RGHT)); break; - case SINGLE_HOLD: + case TD_SINGLE_HOLD: register_code(KC_RSFT); break; + case TD_DOUBLE_TAP: + tap_code16(LALT(KC_RGHT)); + register_code16(LALT(KC_RGHT)); + break; + default: + break; } } void rshift_reset(tap_dance_state_t *state, void *user_data) { switch (rshifttap_state.state) { - case SINGLE_TAP: + case TD_SINGLE_TAP: unregister_code16(LALT(KC_RGHT)); break; - case SINGLE_HOLD: + case TD_SINGLE_HOLD: unregister_code(KC_RSFT); break; + case TD_DOUBLE_TAP: + unregister_code16(LALT(KC_RGHT)); + break; } - rshifttap_state.state = 0; + rshifttap_state.state = TD_NONE; } tap_dance_action_t tap_dance_actions[] = { From a7b64da5b9713d05c54c0ca4f07725847a6c9aa2 Mon Sep 17 00:00:00 2001 From: Paulo Pereira Date: Fri, 7 Apr 2023 08:17:46 +0100 Subject: [PATCH 09/10] Remove unnecessary rgb options --- keyboards/lily58/keymaps/paulomp90/config.h | 18 ------------------ keyboards/lily58/keymaps/paulomp90/keymap.c | 21 +++++++-------------- 2 files changed, 7 insertions(+), 32 deletions(-) diff --git a/keyboards/lily58/keymaps/paulomp90/config.h b/keyboards/lily58/keymaps/paulomp90/config.h index 7c67aa4bc252..fa4b54b4c472 100644 --- a/keyboards/lily58/keymaps/paulomp90/config.h +++ b/keyboards/lily58/keymaps/paulomp90/config.h @@ -20,22 +20,4 @@ #define QUICK_TAP_TERM 0 #define TAPPING_TERM 150 - -#undef RGBLED_NUM -#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 -#define RGBLIGHT_EFFECT_TWINKLE -#define RGBLED_NUM 27 -#define RGBLIGHT_LIMIT_VAL 120 -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 -#define RGBLIGHT_VAL_STEP 17 - #define TAP_CODE_DELAY 10 \ No newline at end of file diff --git a/keyboards/lily58/keymaps/paulomp90/keymap.c b/keyboards/lily58/keymaps/paulomp90/keymap.c index 57546d70faff..af0fafb33739 100644 --- a/keyboards/lily58/keymaps/paulomp90/keymap.c +++ b/keyboards/lily58/keymaps/paulomp90/keymap.c @@ -41,12 +41,6 @@ typedef enum { enum { LEFT_SHIFT = 0, RIGHT_SHIFT = 1 }; -const custom_shift_key_t custom_shift_keys[] = { - {KC_BSPC, KC_DEL}, -}; - -uint8_t NUM_CUSTOM_SHIFT_KEYS = sizeof(custom_shift_keys) / sizeof(custom_shift_key_t); - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* QWERTY @@ -77,8 +71,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------| |------+------+------+------+------+------| * | F1 | | | | | | | PgUp | HOME | Up | END | ºª | F12 | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | | | | |-------. ,-------| PgDn | Left | Down |Right | ~^ | | - * |------+------+------+------+------+------| | | |------+------+------+------+------+------| + * | | | | | | |-------. ,-------| PgDn | Left | Down |Right | ~^ | DEL | + * |------+------+------+------+------+------| <> | | ´` |------+------+------+------+------+------| * | | | | << | >|| | >> |-------| |-------| | Vol+ | Vol- | Mute | \| | | * `-----------------------------------------/ / \ \-----------------------------------------' * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE | RGUI | RAlt | @@ -88,7 +82,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_LOWER] = LAYOUT( _______, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, KC_F1, _______, _______, _______, _______, _______, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_LBRC, KC_F12, - _______, _______, _______, _______, _______, _______, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_QUOT, _______, + _______, _______, _______, _______, _______, _______, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_QUOT, KC_DEL, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_VOLU, KC_VOLD, KC_MUTE, KC_BSLS, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), @@ -166,15 +160,14 @@ bool oled_task_user(void) { } #endif // OLED_ENABLE + bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (!process_custom_shift_keys(keycode, record)) { - return false; - } if (record->event.pressed) { -#ifdef OLED_ENABLE + #ifdef OLED_ENABLE set_keylog(keycode, record); -#endif + #endif } + return true; } From b5ee9678b3181d4ac8bc9d4d2ebbef46ed38244d Mon Sep 17 00:00:00 2001 From: Paulo Pereira Date: Wed, 12 Apr 2023 17:02:50 +0100 Subject: [PATCH 10/10] Update keyboards/lily58/keymaps/paulomp90/config.h Co-authored-by: Drashna Jaelre --- keyboards/lily58/keymaps/paulomp90/config.h | 1 - 1 file changed, 1 deletion(-) diff --git a/keyboards/lily58/keymaps/paulomp90/config.h b/keyboards/lily58/keymaps/paulomp90/config.h index fa4b54b4c472..b2cfbdd69c93 100644 --- a/keyboards/lily58/keymaps/paulomp90/config.h +++ b/keyboards/lily58/keymaps/paulomp90/config.h @@ -16,7 +16,6 @@ #pragma once -#define MASTER_LEFT #define QUICK_TAP_TERM 0 #define TAPPING_TERM 150