diff options
| author | Drashna Jaelre <drashna@live.com> | 2018-10-01 18:00:14 -0700 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2018-10-01 21:00:14 -0400 |
| commit | 1512a6bfd48fb75619a1f77394d41bdca7ea28b1 (patch) | |
| tree | 54aea79710b4101b9fce20d4ff43d60eda24242b /users/drashna/drashna.c | |
| parent | f5ae3760c6be7e927fba74aca4a0cf21a44113af (diff) | |
| download | qmk_firmware-1512a6bfd48fb75619a1f77394d41bdca7ea28b1.tar.gz qmk_firmware-1512a6bfd48fb75619a1f77394d41bdca7ea28b1.zip | |
Keymap: Update to drashna keymaps and userspace (#3992)
* Enabled unicode support and send_unicode function
* Unicode cleanup
* More unicode tweaking
* Update EEPROM stuff
* Account for keyboard macros
* Switch Equal to Plus on Ergodox
* more tweaks
* Minor Unicode tweaks
* Correct matrix printing for keylogger
* Fix unicode functions
* Fix unicode mode set since it actually uses EEPROM
* Re-add DISABLE_LEADER
* Ergodox is easier to hit the tapping term, fix that
* Fix stupid type on unicode mode check
* Preliminary CRKBD/HeliDox support
* Fixes to Helidox
* Cleanup userspace from old merge stuff
* Remove CCCV sounds
* Make Mode NOEEPROM Again
Diffstat (limited to 'users/drashna/drashna.c')
| -rw-r--r-- | users/drashna/drashna.c | 75 |
1 files changed, 37 insertions, 38 deletions
diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 9489fb456..aad9fab61 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c | |||
| @@ -21,6 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 21 | 21 | ||
| 22 | userspace_config_t userspace_config; | 22 | userspace_config_t userspace_config; |
| 23 | 23 | ||
| 24 | uint16_t copy_paste_timer; | ||
| 24 | // Helper Functions | 25 | // Helper Functions |
| 25 | 26 | ||
| 26 | 27 | ||
| @@ -131,7 +132,7 @@ void led_set_keymap(uint8_t usb_led) {} | |||
| 131 | // Call user matrix init, set default RGB colors and then | 132 | // Call user matrix init, set default RGB colors and then |
| 132 | // call the keymap's init function | 133 | // call the keymap's init function |
| 133 | void matrix_init_user(void) { | 134 | void matrix_init_user(void) { |
| 134 | userspace_config.raw = eeprom_read_byte(EECONFIG_USERSPACE); | 135 | userspace_config.raw = eeprom_read_dword(EECONFIG_USERSPACE); |
| 135 | 136 | ||
| 136 | 137 | ||
| 137 | #ifdef BOOTLOADER_CATERINA | 138 | #ifdef BOOTLOADER_CATERINA |
| @@ -143,7 +144,9 @@ void matrix_init_user(void) { | |||
| 143 | #endif | 144 | #endif |
| 144 | 145 | ||
| 145 | #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) | 146 | #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) |
| 146 | set_unicode_input_mode(UC_WINC); | 147 | if (eeprom_read_byte(EECONFIG_UNICODEMODE) != UC_WIN) { |
| 148 | set_unicode_input_mode(UC_WIN); | ||
| 149 | } | ||
| 147 | #endif //UNICODE_ENABLE | 150 | #endif //UNICODE_ENABLE |
| 148 | matrix_init_keymap(); | 151 | matrix_init_keymap(); |
| 149 | } | 152 | } |
| @@ -173,17 +176,12 @@ void shutdown_user (void) { | |||
| 173 | shutdown_keymap(); | 176 | shutdown_keymap(); |
| 174 | } | 177 | } |
| 175 | 178 | ||
| 176 | void suspend_power_down_user(void) | 179 | void suspend_power_down_user(void) { |
| 177 | { | ||
| 178 | suspend_power_down_keymap(); | 180 | suspend_power_down_keymap(); |
| 179 | } | 181 | } |
| 180 | 182 | ||
| 181 | void suspend_wakeup_init_user(void) | 183 | void suspend_wakeup_init_user(void) { |
| 182 | { | ||
| 183 | suspend_wakeup_init_keymap(); | 184 | suspend_wakeup_init_keymap(); |
| 184 | #ifdef KEYBOARD_ergodox_ez | ||
| 185 | wait_ms(10); | ||
| 186 | #endif | ||
| 187 | } | 185 | } |
| 188 | 186 | ||
| 189 | 187 | ||
| @@ -216,7 +214,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 216 | 214 | ||
| 217 | // If console is enabled, it will print the matrix position and status of each key pressed | 215 | // If console is enabled, it will print the matrix position and status of each key pressed |
| 218 | #ifdef KEYLOGGER_ENABLE | 216 | #ifdef KEYLOGGER_ENABLE |
| 219 | xprintf("KL: row: %u, column: %u, pressed: %u\n", record->event.key.col, record->event.key.row, record->event.pressed); | 217 | #if defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_iris_rev2) |
| 218 | xprintf("KL: col: %u, row: %u, pressed: %u\n", record->event.key.row, record->event.key.col, record->event.pressed); | ||
| 219 | #else | ||
| 220 | xprintf("KL: col: %u, row: %u, pressed: %u\n", record->event.key.col, record->event.key.row, record->event.pressed); | ||
| 221 | #endif | ||
| 220 | #endif //KEYLOGGER_ENABLE | 222 | #endif //KEYLOGGER_ENABLE |
| 221 | 223 | ||
| 222 | switch (keycode) { | 224 | switch (keycode) { |
| @@ -249,7 +251,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 249 | case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader | 251 | case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader |
| 250 | if (!record->event.pressed) { | 252 | if (!record->event.pressed) { |
| 251 | send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP | 253 | send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP |
| 252 | #if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU)) | 254 | #if defined(__ARM__) |
| 255 | ":dfu-util" | ||
| 256 | #elif defined(BOOTLOADER_DFU) | ||
| 253 | ":dfu" | 257 | ":dfu" |
| 254 | #elif defined(BOOTLOADER_HALFKAY) | 258 | #elif defined(BOOTLOADER_HALFKAY) |
| 255 | ":teensy" | 259 | ":teensy" |
| @@ -291,7 +295,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 291 | // to save on firmware space, since it's limited. | 295 | // to save on firmware space, since it's limited. |
| 292 | #ifdef MACROS_ENABLED | 296 | #ifdef MACROS_ENABLED |
| 293 | case KC_OVERWATCH: // Toggle's if we hit "ENTER" or "BACKSPACE" to input macros | 297 | case KC_OVERWATCH: // Toggle's if we hit "ENTER" or "BACKSPACE" to input macros |
| 294 | if (record->event.pressed) { userspace_config.is_overwatch ^= 1; eeprom_update_byte(EECONFIG_USERSPACE, userspace_config.raw); } | 298 | if (record->event.pressed) { userspace_config.is_overwatch ^= 1; eeprom_update_dword(EECONFIG_USERSPACE, userspace_config.raw); } |
| 295 | #ifdef RGBLIGHT_ENABLE | 299 | #ifdef RGBLIGHT_ENABLE |
| 296 | userspace_config.is_overwatch ? rgblight_mode_noeeprom(17) : rgblight_mode_noeeprom(18); | 300 | userspace_config.is_overwatch ? rgblight_mode_noeeprom(17) : rgblight_mode_noeeprom(18); |
| 297 | #endif //RGBLIGHT_ENABLE | 301 | #endif //RGBLIGHT_ENABLE |
| @@ -342,45 +346,40 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
| 342 | register_code(KC_LCTL); | 346 | register_code(KC_LCTL); |
| 343 | tap(KC_C); | 347 | tap(KC_C); |
| 344 | unregister_code(KC_LCTL); | 348 | unregister_code(KC_LCTL); |
| 345 | #ifdef AUDIO_ENABLE | ||
| 346 | PLAY_SONG(tone_copy); | ||
| 347 | #endif | ||
| 348 | } else { // Tap, paste | 349 | } else { // Tap, paste |
| 349 | register_code(KC_LCTL); | 350 | register_code(KC_LCTL); |
| 350 | tap(KC_V); | 351 | tap(KC_V); |
| 351 | unregister_code(KC_LCTL); | 352 | unregister_code(KC_LCTL); |
| 352 | #ifdef AUDIO_ENABLE | ||
| 353 | PLAY_SONG(tone_paste); | ||
| 354 | #endif | ||
| 355 | } | 353 | } |
| 356 | } | 354 | } |
| 357 | return false; | 355 | return false; |
| 358 | break; | 356 | break; |
| 359 | #ifdef UNICODE_ENABLE | 357 | #ifdef UNICODE_ENABLE |
| 360 | case UC_FLIP: // (╯°□°) ︵ ━┻ | 358 | case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻ |
| 361 | if (record->event.pressed) { | 359 | if (record->event.pressed) { |
| 362 | register_code(KC_RSFT); | 360 | send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B"); |
| 363 | tap(KC_9); | ||
| 364 | unregister_code(KC_RSFT); | ||
| 365 | process_unicode((0x256F | QK_UNICODE), record); // Arm | ||
| 366 | process_unicode((0x00B0 | QK_UNICODE), record); // Eye | ||
| 367 | process_unicode((0x25A1 | QK_UNICODE), record); // Mouth | ||
| 368 | process_unicode((0x00B0 | QK_UNICODE), record); // Eye | ||
| 369 | register_code(KC_RSFT); | ||
| 370 | tap(KC_0); | ||
| 371 | unregister_code(KC_RSFT); | ||
| 372 | process_unicode((0x256F | QK_UNICODE), record); // Arm | ||
| 373 | tap(KC_SPC); | ||
| 374 | process_unicode((0x0361 | QK_UNICODE), record); // Flippy | ||
| 375 | tap(KC_SPC); | ||
| 376 | process_unicode((0x253B | QK_UNICODE), record); // Table | ||
| 377 | process_unicode((0x2501 | QK_UNICODE), record); // Table | ||
| 378 | process_unicode((0x253B | QK_UNICODE), record); // Table | ||
| 379 | } | 361 | } |
| 380 | return false; | 362 | return false; |
| 381 | break; | 363 | break; |
| 382 | #endif // UNICODE_ENABLE | 364 | case UC_TABL: // ┬─┬ノ( º _ ºノ) |
| 383 | 365 | if (record->event.pressed) { | |
| 366 | send_unicode_hex_string("252C 2500 252C 30CE 0028 0020 00BA 0020 005F 0020 00BA 30CE 0029"); | ||
| 367 | } | ||
| 368 | return false; | ||
| 369 | break; | ||
| 370 | case UC_SHRG: // ¯\_(ツ)_/¯ | ||
| 371 | if (record->event.pressed) { | ||
| 372 | send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF"); | ||
| 373 | } | ||
| 374 | return false; | ||
| 375 | break; | ||
| 376 | case UC_DISA: // ಠ_ಠ | ||
| 377 | if (record->event.pressed) { | ||
| 378 | send_unicode_hex_string("0CA0 005F 0CA0"); | ||
| 379 | } | ||
| 380 | return false; | ||
| 381 | break; | ||
| 382 | #endif | ||
| 384 | } | 383 | } |
| 385 | return process_record_keymap(keycode, record) && | 384 | return process_record_keymap(keycode, record) && |
| 386 | #ifdef RGBLIGHT_ENABLE | 385 | #ifdef RGBLIGHT_ENABLE |
