diff options
| author | Noan Mousy <4sstylz@protonmail.ch> | 2019-12-13 15:39:10 +0100 |
|---|---|---|
| committer | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2019-12-13 06:39:10 -0800 |
| commit | 20d3a979f1999fcc27a47e4f32533fb8e8b633a0 (patch) | |
| tree | 5e8168cde7773affb1b10254eb9627d17b2eac48 | |
| parent | 2d1c985ff44ecfe54fe82021e0326b3c7b07db9f (diff) | |
| download | qmk_firmware-20d3a979f1999fcc27a47e4f32533fb8e8b633a0.tar.gz qmk_firmware-20d3a979f1999fcc27a47e4f32533fb8e8b633a0.zip | |
Adding Backlight on the handwired AEK64 keyboard (#7629)
* Implementing backlight with breathing
* Rework of my personal keymap and adding some macros.
| -rw-r--r-- | keyboards/handwired/aek64/config.h | 34 | ||||
| -rw-r--r-- | keyboards/handwired/aek64/keymaps/4sstylz/keycodes.h | 85 | ||||
| -rw-r--r-- | keyboards/handwired/aek64/keymaps/4sstylz/keymap.c | 33 | ||||
| -rw-r--r-- | keyboards/handwired/aek64/rules.mk | 1 |
4 files changed, 116 insertions, 37 deletions
diff --git a/keyboards/handwired/aek64/config.h b/keyboards/handwired/aek64/config.h index 45ce6665b..7d235358c 100644 --- a/keyboards/handwired/aek64/config.h +++ b/keyboards/handwired/aek64/config.h | |||
| @@ -27,27 +27,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 27 | #define PRODUCT AEK64 | 27 | #define PRODUCT AEK64 |
| 28 | #define DESCRIPTION QMK keyboard firmware for AEK64 handwired | 28 | #define DESCRIPTION QMK keyboard firmware for AEK64 handwired |
| 29 | 29 | ||
| 30 | /* Define the backlight */ | ||
| 31 | /*#define BACKLIGHT_ON_STATE 1*/ | ||
| 32 | |||
| 30 | /* key matrix size */ | 33 | /* key matrix size */ |
| 31 | #define MATRIX_ROWS 5 | 34 | #define MATRIX_ROWS 5 |
| 32 | #define MATRIX_COLS 14 | 35 | #define MATRIX_COLS 14 |
| 33 | 36 | ||
| 34 | // Originally made for a Teensy 2++ | 37 | // Originally made for a Teensy 2++ |
| 35 | #define MATRIX_COL_PINS { F0, E6, E7, B0, B1, B2, B3, B4, B5, B6, B7, D0, D1, D2 } | 38 | #define MATRIX_COL_PINS { F0, E6, E7, B0, B1, B2, B3, B4, B5, B6, D3, D0, D1, D2 } |
| 36 | #define MATRIX_ROW_PINS { E0, E1, C0, C1, C2 } | 39 | #define MATRIX_ROW_PINS { E0, E1, C0, C1, C2 } |
| 37 | #define UNUSED_PINS | 40 | #define UNUSED_PINS |
| 38 | 41 | ||
| 39 | /* define if matrix has ghost */ | ||
| 40 | //#define MATRIX_HAS_GHOST | ||
| 41 | |||
| 42 | /* Set 0 if debouncing isn't needed */ | 42 | /* Set 0 if debouncing isn't needed */ |
| 43 | #define DEBOUNCE 5 | 43 | #define DEBOUNCE 5 |
| 44 | 44 | ||
| 45 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | ||
| 46 | // #define LOCKING_SUPPORT_ENABLE | ||
| 47 | |||
| 48 | /* Locking resynchronize hack */ | ||
| 49 | //#define LOCKING_RESYNC_ENABLE | ||
| 50 | |||
| 51 | /* Enable the space-cadet options */ | 45 | /* Enable the space-cadet options */ |
| 52 | #define RSPC_KEYS KC_RSFT, KC_TRNS, KC_PGUP | 46 | #define RSPC_KEYS KC_RSFT, KC_TRNS, KC_PGUP |
| 53 | #define RCPC_KEYS KC_RCTL, KC_TRNS, KC_PGDOWN | 47 | #define RCPC_KEYS KC_RCTL, KC_TRNS, KC_PGDOWN |
| @@ -59,20 +53,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 59 | 53 | ||
| 60 | #define COMBO_COUNT 1 | 54 | #define COMBO_COUNT 1 |
| 61 | 55 | ||
| 62 | /* | 56 | #define BACKLIGHT_PIN B7 |
| 63 | * Feature disable options | 57 | #define BACKLIGHT_BREATHING |
| 64 | * These options are also useful to firmware size reduction. | 58 | #define BACKLIGHT_LEVELS 5 |
| 65 | */ | ||
| 66 | |||
| 67 | /* disable debug print */ | ||
| 68 | //#define NO_DEBUG | ||
| 69 | |||
| 70 | /* disable print */ | ||
| 71 | //#define NO_PRINT | ||
| 72 | |||
| 73 | /* disable action features */ | ||
| 74 | //#define NO_ACTION_LAYER | ||
| 75 | //#define NO_ACTION_TAPPING | ||
| 76 | //#define NO_ACTION_ONESHOT | ||
| 77 | //#define NO_ACTION_MACRO | ||
| 78 | //#define NO_ACTION_FUNCTION | ||
diff --git a/keyboards/handwired/aek64/keymaps/4sstylz/keycodes.h b/keyboards/handwired/aek64/keymaps/4sstylz/keycodes.h new file mode 100644 index 000000000..9898fe0df --- /dev/null +++ b/keyboards/handwired/aek64/keymaps/4sstylz/keycodes.h | |||
| @@ -0,0 +1,85 @@ | |||
| 1 | /* | ||
| 2 | * DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | ||
| 3 | * Version 2, December 2004 | ||
| 4 | * | ||
| 5 | * Copyright (C) 2019 4sStylZ <4sstylz@protonmail.ch> | ||
| 6 | * | ||
| 7 | * Everyone is permitted to copy and distribute verbatim or modified | ||
| 8 | * copies of this license document, and changing it is allowed as long | ||
| 9 | * as the name is changed. | ||
| 10 | * | ||
| 11 | * DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | ||
| 12 | * TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | ||
| 13 | * | ||
| 14 | * 0. You just DO WHAT THE FUCK YOU WANT TO. | ||
| 15 | */ | ||
| 16 | #include QMK_KEYBOARD_H | ||
| 17 | |||
| 18 | /** | ||
| 19 | * Macro for selecting all the text in the document. | ||
| 20 | * Usual shortcut : Ctrl+A. | ||
| 21 | * | ||
| 22 | * @param keyrecord_t *record | ||
| 23 | * | ||
| 24 | * @return void | ||
| 25 | */ | ||
| 26 | void select_all(keyrecord_t *record) { | ||
| 27 | if (record->event.pressed) { | ||
| 28 | register_code(KC_LCTL); | ||
| 29 | tap_code(KC_A); | ||
| 30 | unregister_code(KC_LCTL); | ||
| 31 | } | ||
| 32 | } | ||
| 33 | |||
| 34 | /** | ||
| 35 | * Macro for selecting the current row. | ||
| 36 | * | ||
| 37 | * @param keyrecord_t *record | ||
| 38 | * | ||
| 39 | * @return void | ||
| 40 | */ | ||
| 41 | void select_row(keyrecord_t *record) { | ||
| 42 | if (record->event.pressed) { | ||
| 43 | tap_code(KC_HOME); | ||
| 44 | register_code(KC_LSFT); | ||
| 45 | tap_code(KC_END); | ||
| 46 | unregister_code(KC_LSFT); | ||
| 47 | } | ||
| 48 | } | ||
| 49 | |||
| 50 | /** | ||
| 51 | * Macro for selecting the current word. | ||
| 52 | * Usage : You need to have the cursor into the word or directly at the right. | ||
| 53 | * | ||
| 54 | * | ||
| 55 | * Usual shortcut : Ctrl+A. | ||
| 56 | * | ||
| 57 | * @param keyrecord_t *record | ||
| 58 | * | ||
| 59 | * @return void | ||
| 60 | */ | ||
| 61 | void select_word(keyrecord_t *record) { | ||
| 62 | if (record->event.pressed) { | ||
| 63 | register_code(KC_LCTL); | ||
| 64 | tap_code(KC_LEFT); | ||
| 65 | register_code(KC_LSFT); | ||
| 66 | tap_code(KC_RIGHT); | ||
| 67 | unregister_code(KC_LSFT); | ||
| 68 | unregister_code(KC_LCTL); | ||
| 69 | } | ||
| 70 | } | ||
| 71 | |||
| 72 | /** | ||
| 73 | * Macro for inserting two 0 with keypad. | ||
| 74 | * Be carefull to have the keypad lock enabled | ||
| 75 | * | ||
| 76 | * @param keyrecord_t *record | ||
| 77 | * | ||
| 78 | * @return void | ||
| 79 | */ | ||
| 80 | void insert_00(keyrecord_t *record) { | ||
| 81 | if (record->event.pressed) { | ||
| 82 | tap_code(KC_P0); | ||
| 83 | tap_code(KC_P0); | ||
| 84 | } | ||
| 85 | } | ||
diff --git a/keyboards/handwired/aek64/keymaps/4sstylz/keymap.c b/keyboards/handwired/aek64/keymaps/4sstylz/keymap.c index 65f8354aa..cb62fb001 100644 --- a/keyboards/handwired/aek64/keymaps/4sstylz/keymap.c +++ b/keyboards/handwired/aek64/keymaps/4sstylz/keymap.c | |||
| @@ -1,4 +1,5 @@ | |||
| 1 | #include QMK_KEYBOARD_H | 1 | #include QMK_KEYBOARD_H |
| 2 | #include <keycodes.h> | ||
| 2 | 3 | ||
| 3 | // Implement Super-alt↯tab | 4 | // Implement Super-alt↯tab |
| 4 | // See https://docs.qmk.fm/#/feature_macros?id=super-alt↯tab | 5 | // See https://docs.qmk.fm/#/feature_macros?id=super-alt↯tab |
| @@ -7,7 +8,10 @@ uint16_t alt_tab_timer = 0; | |||
| 7 | 8 | ||
| 8 | // Defining all the custom keycodes. | 9 | // Defining all the custom keycodes. |
| 9 | enum custom_keycodes { | 10 | enum custom_keycodes { |
| 10 | ALT_TAB = SAFE_RANGE | 11 | ALT_TAB = SAFE_RANGE, |
| 12 | SLC_ROW, | ||
| 13 | SLC_ALL, | ||
| 14 | SLC_WRD | ||
| 11 | }; | 15 | }; |
| 12 | 16 | ||
| 13 | const uint16_t PROGMEM lock_combo[] = {KC_J, KC_K, KC_L, KC_SCLN, COMBO_END}; | 17 | const uint16_t PROGMEM lock_combo[] = {KC_J, KC_K, KC_L, KC_SCLN, COMBO_END}; |
| @@ -18,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 18 | /* 0: qwerty | 22 | /* 0: qwerty |
| 19 | * ┌──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬─────────────┐ | 23 | * ┌──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬─────────────┐ |
| 20 | * │ ` Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Bksp │ | 24 | * │ ` Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Bksp │ |
| 21 | * ├─────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼─────┬───────┤ | 25 | * ├──────┴──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼─────┬───────┤ |
| 22 | * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ │ | 26 | * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ │ |
| 23 | * ├─────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼─────┴┐ Enter│ | 27 | * ├─────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼─────┴┐ Enter│ |
| 24 | * │ Layer 2 │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ # │ │ | 28 | * │ Layer 2 │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ # │ │ |
| @@ -40,14 +44,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 40 | KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_LBRC, KC_RBRC, | 44 | KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_LBRC, KC_RBRC, |
| 41 | MO(1) , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT , | 45 | MO(1) , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT , |
| 42 | KC_LSPO , KC_NUBS, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSPC , | 46 | KC_LSPO , KC_NUBS, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSPC , |
| 43 | KC_LCPO , KC_LALT, ALT_TAB, KC_SPC, KC_LGUI, KC_RALT, KC_RCPC | 47 | KC_LCPO , KC_LGUI, KC_LALT, KC_SPC, KC_APP , KC_RALT, KC_RCPC |
| 44 | ), | 48 | ), |
| 45 | 49 | ||
| 46 | /* 1: second layer for media keys and many advanced features ç | 50 | /* 1: second layer for media keys and many advanced features ç |
| 47 | * ┌──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬─────────────┐ | 51 | * ┌──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬─────────────┐ |
| 48 | * │Alt F4│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ │ | 52 | * │Alt F4│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ │ |
| 49 | * ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼─────┬───────┤ | 53 | * ├──────┴──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼─────┬───────┤ |
| 50 | * │ │ │ │PrtScn│ Brt+ │ Brt- │Ctrl A│ Home │ Up │ End │ ‽ │ ↑ │ ⸮ │ │ │ | 54 | * │ │ │PrtScn│ Brt+ │ Brt- │Ctrl A│ Home │ Up │ End │ ‽ │ ↑ │ ⸮ │ │ │ |
| 51 | * ├─────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼─────┴┐ │ | 55 | * ├─────────────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼─────┴┐ │ |
| 52 | * │ │ Cut │ Copy │Paste │ Del │ Del │ Left │ Down │Right │ ← │ ↓ │ → │ │ │ | 56 | * │ │ Cut │ Copy │Paste │ Del │ Del │ Left │ Down │Right │ ← │ ↓ │ → │ │ │ |
| 53 | * ├──────┬──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┴──────┴──────┤ | 57 | * ├──────┬──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┴──────┴──────┤ |
| @@ -57,11 +61,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 57 | * └──────┴──────┴──────┴──────────────────────────────────────────────────────────────┴──────┴──────┴──────┘ | 61 | * └──────┴──────┴──────┴──────────────────────────────────────────────────────────────┴──────┴──────┴──────┘ |
| 58 | */ | 62 | */ |
| 59 | [1] = LAYOUT( \ | 63 | [1] = LAYOUT( \ |
| 60 | LALT(KC_F4), KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , _______, | 64 | LALT(KC_F4), KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_DEL , |
| 61 | _______ , _______ , _______ , KC_PSCR , KC_BRIU , KC_BRID, LCTL(KC_A), KC_HOME, KC_UP , KC_END , UC(0x203D) , UC(0x8593), UC(0x2E2E), | 65 | _______ , _______ , SLC_ALL , SLC_ROW , SLC_WRD , _______, KC_BSPC, KC_HOME, KC_UP , KC_END , KC_BRIU, KC_BRID , KC_PSCR, |
| 62 | _______ , _______ , LSFT(KC_DEL), LCTL(KC_INS), LSFT(KC_INS), KC_DEL , KC_DEL , KC_LEFT, KC_DOWN, KC_RIGHT, UC(0x8592) , UC(0x8595), UC(0x8594), _______, | 66 | _______ , _______ , LSFT(KC_DEL), LCTL(KC_INS), LSFT(KC_INS), KC_DEL , KC_ENT , KC_LEFT, KC_DOWN, KC_RIGHT, BL_TOGG, BL_STEP , BL_BRTG, _______, |
| 63 | _______ , _______ , KC_MUTE , KC_VOLD , KC_VOLU , _______, _______ , _______, _______, _______ , _______ , RESET , _______ , | 67 | _______ , _______ , KC_MUTE , KC_VOLD , KC_VOLU , ALT_TAB, _______, _______, _______, _______ , _______, RESET , _______ , |
| 64 | _______ , _______ , _______ , _______, _______ , _______ , _______ | 68 | _______ , _______ , _______ , _______, _______ , _______, _______ |
| 65 | ) | 69 | ) |
| 66 | }; | 70 | }; |
| 67 | 71 | ||
| @@ -88,6 +92,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 88 | unregister_code(KC_TAB); | 92 | unregister_code(KC_TAB); |
| 89 | } | 93 | } |
| 90 | break; | 94 | break; |
| 95 | case SLC_ALL: | ||
| 96 | select_all(record); | ||
| 97 | break; | ||
| 98 | case SLC_ROW: | ||
| 99 | select_row(record); | ||
| 100 | break; | ||
| 101 | case SLC_WRD: | ||
| 102 | select_word(record); | ||
| 103 | break; | ||
| 91 | } | 104 | } |
| 92 | return true; | 105 | return true; |
| 93 | } | 106 | } |
diff --git a/keyboards/handwired/aek64/rules.mk b/keyboards/handwired/aek64/rules.mk index c02af3dd6..52c306130 100644 --- a/keyboards/handwired/aek64/rules.mk +++ b/keyboards/handwired/aek64/rules.mk | |||
| @@ -25,3 +25,4 @@ UNICODE_ENABLE = yes # Enable support for arrow keys icon on the second layer. | |||
| 25 | COMBO_ENABLE = yes # Enable combo for special function when using multiple keys at once. | 25 | COMBO_ENABLE = yes # Enable combo for special function when using multiple keys at once. |
| 26 | TAP_DANCE_ENABLE = no # Enable use multiple tap | 26 | TAP_DANCE_ENABLE = no # Enable use multiple tap |
| 27 | NKRO_ENABLE = yes | 27 | NKRO_ENABLE = yes |
| 28 | BACKLIGHT_ENABLE = yes | ||
