diff options
Diffstat (limited to 'keyboard')
| -rw-r--r-- | keyboard/atomic/atomic.c | 7 | ||||
| -rw-r--r-- | keyboard/atomic/atomic.h | 2 | ||||
| -rw-r--r-- | keyboard/gh60_rev_c/gh60.c | 7 | ||||
| -rw-r--r-- | keyboard/gh60_rev_c/gh60.h | 2 | ||||
| -rw-r--r-- | keyboard/planck/keymaps/experimental/keymap.c | 48 | ||||
| -rw-r--r-- | keyboard/planck/planck.c | 8 | ||||
| -rw-r--r-- | keyboard/planck/planck.h | 16 | ||||
| -rw-r--r-- | keyboard/preonic/preonic.c | 8 | ||||
| -rw-r--r-- | keyboard/preonic/preonic.h | 2 |
9 files changed, 52 insertions, 48 deletions
diff --git a/keyboard/atomic/atomic.c b/keyboard/atomic/atomic.c index b4b261457..fa218a48f 100644 --- a/keyboard/atomic/atomic.c +++ b/keyboard/atomic/atomic.c | |||
| @@ -11,8 +11,9 @@ void matrix_scan_user(void) { | |||
| 11 | } | 11 | } |
| 12 | 12 | ||
| 13 | __attribute__ ((weak)) | 13 | __attribute__ ((weak)) |
| 14 | void process_action_user(keyrecord_t *record) { | 14 | bool process_action_user(keyrecord_t *record) { |
| 15 | // leave this function blank - it can be defined in a keymap file | 15 | // leave this function blank - it can be defined in a keymap file |
| 16 | return true; | ||
| 16 | } | 17 | } |
| 17 | 18 | ||
| 18 | __attribute__ ((weak)) | 19 | __attribute__ ((weak)) |
| @@ -45,11 +46,11 @@ void matrix_scan_kb(void) { | |||
| 45 | matrix_scan_user(); | 46 | matrix_scan_user(); |
| 46 | } | 47 | } |
| 47 | 48 | ||
| 48 | void process_action_kb(keyrecord_t *record) { | 49 | bool process_action_kb(keyrecord_t *record) { |
| 49 | // put your per-action keyboard code here | 50 | // put your per-action keyboard code here |
| 50 | // runs for every action, just before processing by the firmware | 51 | // runs for every action, just before processing by the firmware |
| 51 | 52 | ||
| 52 | process_action_user(record); | 53 | return process_action_user(record); |
| 53 | } | 54 | } |
| 54 | 55 | ||
| 55 | void led_set_kb(uint8_t usb_led) { | 56 | void led_set_kb(uint8_t usb_led) { |
diff --git a/keyboard/atomic/atomic.h b/keyboard/atomic/atomic.h index 845a9043e..2d6b4c6cb 100644 --- a/keyboard/atomic/atomic.h +++ b/keyboard/atomic/atomic.h | |||
| @@ -29,7 +29,7 @@ | |||
| 29 | 29 | ||
| 30 | void matrix_init_user(void); | 30 | void matrix_init_user(void); |
| 31 | void matrix_scan_user(void); | 31 | void matrix_scan_user(void); |
| 32 | void process_action_user(keyrecord_t *record); | 32 | bool process_action_user(keyrecord_t *record); |
| 33 | void led_set_user(uint8_t usb_led); | 33 | void led_set_user(uint8_t usb_led); |
| 34 | void backlight_init_ports(void); | 34 | void backlight_init_ports(void); |
| 35 | 35 | ||
diff --git a/keyboard/gh60_rev_c/gh60.c b/keyboard/gh60_rev_c/gh60.c index 8e7219bfe..6da4d8ee3 100644 --- a/keyboard/gh60_rev_c/gh60.c +++ b/keyboard/gh60_rev_c/gh60.c | |||
| @@ -12,8 +12,9 @@ void matrix_scan_user(void) { | |||
| 12 | } | 12 | } |
| 13 | 13 | ||
| 14 | __attribute__ ((weak)) | 14 | __attribute__ ((weak)) |
| 15 | void process_action_user(keyrecord_t *record) { | 15 | bool process_action_user(keyrecord_t *record) { |
| 16 | // leave this function blank - it can be defined in a keymap file | 16 | // leave this function blank - it can be defined in a keymap file |
| 17 | return true; | ||
| 17 | } | 18 | } |
| 18 | 19 | ||
| 19 | __attribute__ ((weak)) | 20 | __attribute__ ((weak)) |
| @@ -35,11 +36,11 @@ void matrix_scan_kb(void) { | |||
| 35 | matrix_scan_user(); | 36 | matrix_scan_user(); |
| 36 | } | 37 | } |
| 37 | 38 | ||
| 38 | void process_action_kb(keyrecord_t *record) { | 39 | bool process_action_kb(keyrecord_t *record) { |
| 39 | // put your per-action keyboard code here | 40 | // put your per-action keyboard code here |
| 40 | // runs for every action, just before processing by the firmware | 41 | // runs for every action, just before processing by the firmware |
| 41 | 42 | ||
| 42 | process_action_user(record); | 43 | return process_action_user(record); |
| 43 | } | 44 | } |
| 44 | 45 | ||
| 45 | void led_set_kb(uint8_t usb_led) { | 46 | void led_set_kb(uint8_t usb_led) { |
diff --git a/keyboard/gh60_rev_c/gh60.h b/keyboard/gh60_rev_c/gh60.h index 2373ad333..95e5e1ebc 100644 --- a/keyboard/gh60_rev_c/gh60.h +++ b/keyboard/gh60_rev_c/gh60.h | |||
| @@ -75,7 +75,7 @@ inline void gh60_wasd_leds_off(void) { DDRF &= ~(1<<7); PORTF &= ~(1<<7); } | |||
| 75 | 75 | ||
| 76 | void matrix_init_user(void); | 76 | void matrix_init_user(void); |
| 77 | void matrix_scan_user(void); | 77 | void matrix_scan_user(void); |
| 78 | void process_action_user(keyrecord_t *record); | 78 | bool process_action_user(keyrecord_t *record); |
| 79 | void led_set_user(uint8_t usb_led); | 79 | void led_set_user(uint8_t usb_led); |
| 80 | 80 | ||
| 81 | #endif | 81 | #endif |
diff --git a/keyboard/planck/keymaps/experimental/keymap.c b/keyboard/planck/keymaps/experimental/keymap.c index fc3ac4a97..8dc158c73 100644 --- a/keyboard/planck/keymaps/experimental/keymap.c +++ b/keyboard/planck/keymaps/experimental/keymap.c | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | #ifdef AUDIO_ENABLE | 6 | #ifdef AUDIO_ENABLE |
| 7 | #include "audio.h" | 7 | #include "audio.h" |
| 8 | #endif | 8 | #endif |
| 9 | |||
| 9 | #include "eeconfig.h" | 10 | #include "eeconfig.h" |
| 10 | 11 | ||
| 11 | extern keymap_config_t keymap_config; | 12 | extern keymap_config_t keymap_config; |
| @@ -78,7 +79,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |||
| 78 | {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, | 79 | {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, |
| 79 | {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, | 80 | {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, |
| 80 | {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, | 81 | {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, |
| 81 | {M(M_BL), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} | 82 | {KC_LEAD, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} |
| 82 | }, | 83 | }, |
| 83 | 84 | ||
| 84 | /* Dvorak | 85 | /* Dvorak |
| @@ -291,7 +292,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) | |||
| 291 | case 8: | 292 | case 8: |
| 292 | if (record->event.pressed) { | 293 | if (record->event.pressed) { |
| 293 | #ifdef AUDIO_ENABLE | 294 | #ifdef AUDIO_ENABLE |
| 294 | layer_off(_MUSIC); | 295 | music_activated = false; |
| 295 | stop_all_notes(); | 296 | stop_all_notes(); |
| 296 | #endif | 297 | #endif |
| 297 | } | 298 | } |
| @@ -300,7 +301,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) | |||
| 300 | if (record->event.pressed) { | 301 | if (record->event.pressed) { |
| 301 | #ifdef AUDIO_ENABLE | 302 | #ifdef AUDIO_ENABLE |
| 302 | PLAY_NOTE_ARRAY(music_scale, false, 0); | 303 | PLAY_NOTE_ARRAY(music_scale, false, 0); |
| 303 | layer_on(_MUSIC); | 304 | music_activated = true; |
| 304 | #endif | 305 | #endif |
| 305 | } | 306 | } |
| 306 | break; | 307 | break; |
| @@ -360,24 +361,35 @@ void matrix_init_user(void) { | |||
| 360 | } | 361 | } |
| 361 | 362 | ||
| 362 | #ifdef AUDIO_ENABLE | 363 | #ifdef AUDIO_ENABLE |
| 363 | void play_goodbye_tone() | 364 | void play_goodbye_tone(void) |
| 364 | { | 365 | { |
| 365 | PLAY_NOTE_ARRAY(goodbye, false, 0); | 366 | PLAY_NOTE_ARRAY(goodbye, false, 0); |
| 366 | _delay_ms(150); | 367 | _delay_ms(150); |
| 367 | } | 368 | } |
| 369 | #endif | ||
| 368 | 370 | ||
| 369 | uint8_t starting_note = 0x0C; | 371 | LEADER_EXTERNS(); |
| 370 | int offset = 0; | ||
| 371 | 372 | ||
| 372 | void process_action_user(keyrecord_t *record) { | 373 | #define LEADER_TIMEOUT 300 |
| 373 | 374 | ||
| 374 | if (IS_LAYER_ON(_MUSIC)) { | 375 | void matrix_scan_user(void) { |
| 375 | if (record->event.pressed) { | 376 | LEADER_DICTIONARY() { |
| 376 | play_note(((double)220.0)*pow(2.0, -4.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row)), 0xF); | 377 | leading = false; |
| 377 | } else { | 378 | leader_end(); |
| 378 | stop_note(((double)220.0)*pow(2.0, -4.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row))); | 379 | |
| 380 | SEQ_ONE_KEY(KC_F) { | ||
| 381 | register_code(KC_S); | ||
| 382 | unregister_code(KC_S); | ||
| 383 | } | ||
| 384 | SEQ_TWO_KEYS(KC_A, KC_S) { | ||
| 385 | register_code(KC_H); | ||
| 386 | unregister_code(KC_H); | ||
| 387 | } | ||
| 388 | SEQ_THREE_KEYS(KC_A, KC_S, KC_D) { | ||
| 389 | register_code(KC_LGUI); | ||
| 390 | register_code(KC_S); | ||
| 391 | unregister_code(KC_S); | ||
| 392 | unregister_code(KC_LGUI); | ||
| 379 | } | 393 | } |
| 380 | } | 394 | } |
| 381 | |||
| 382 | } | 395 | } |
| 383 | #endif | ||
diff --git a/keyboard/planck/planck.c b/keyboard/planck/planck.c index 446353dbf..da7b3a170 100644 --- a/keyboard/planck/planck.c +++ b/keyboard/planck/planck.c | |||
| @@ -7,7 +7,9 @@ __attribute__ ((weak)) | |||
| 7 | void matrix_scan_user(void) {} | 7 | void matrix_scan_user(void) {} |
| 8 | 8 | ||
| 9 | __attribute__ ((weak)) | 9 | __attribute__ ((weak)) |
| 10 | void process_action_user(keyrecord_t *record) {} | 10 | bool process_action_user(keyrecord_t *record) { |
| 11 | return true; | ||
| 12 | } | ||
| 11 | 13 | ||
| 12 | __attribute__ ((weak)) | 14 | __attribute__ ((weak)) |
| 13 | void led_set_user(uint8_t usb_led) {} | 15 | void led_set_user(uint8_t usb_led) {} |
| @@ -32,8 +34,8 @@ void matrix_scan_kb(void) { | |||
| 32 | matrix_scan_user(); | 34 | matrix_scan_user(); |
| 33 | } | 35 | } |
| 34 | 36 | ||
| 35 | void process_action_kb(keyrecord_t *record) { | 37 | bool process_action_kb(keyrecord_t *record) { |
| 36 | process_action_user(record); | 38 | return process_action_user(record); |
| 37 | } | 39 | } |
| 38 | 40 | ||
| 39 | void led_set_kb(uint8_t usb_led) { | 41 | void led_set_kb(uint8_t usb_led) { |
diff --git a/keyboard/planck/planck.h b/keyboard/planck/planck.h index cfd4956bf..8aec6b262 100644 --- a/keyboard/planck/planck.h +++ b/keyboard/planck/planck.h | |||
| @@ -1,19 +1,7 @@ | |||
| 1 | #ifndef PLANCK_H | 1 | #ifndef PLANCK_H |
| 2 | #define PLANCK_H | 2 | #define PLANCK_H |
| 3 | 3 | ||
| 4 | #include "matrix.h" | 4 | #include "quantum.h" |
| 5 | #include "keymap_common.h" | ||
| 6 | #ifdef BACKLIGHT_ENABLE | ||
| 7 | #include "backlight.h" | ||
| 8 | #endif | ||
| 9 | #ifdef RGBLIGHT_ENABLE | ||
| 10 | #include "rgblight.h" | ||
| 11 | #endif | ||
| 12 | #include <stddef.h> | ||
| 13 | #include <avr/io.h> | ||
| 14 | #ifdef MIDI_ENABLE | ||
| 15 | #include <keymap_midi.h> | ||
| 16 | #endif | ||
| 17 | 5 | ||
| 18 | #define PLANCK_MIT( \ | 6 | #define PLANCK_MIT( \ |
| 19 | k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ | 7 | k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ |
| @@ -43,7 +31,7 @@ | |||
| 43 | 31 | ||
| 44 | void matrix_init_user(void); | 32 | void matrix_init_user(void); |
| 45 | void matrix_scan_user(void); | 33 | void matrix_scan_user(void); |
| 46 | void process_action_user(keyrecord_t *record); | 34 | bool process_action_user(keyrecord_t *record); |
| 47 | 35 | ||
| 48 | void led_set_user(uint8_t usb_led); | 36 | void led_set_user(uint8_t usb_led); |
| 49 | void backlight_init_ports(void); | 37 | void backlight_init_ports(void); |
diff --git a/keyboard/preonic/preonic.c b/keyboard/preonic/preonic.c index 211f8d029..13e05c65a 100644 --- a/keyboard/preonic/preonic.c +++ b/keyboard/preonic/preonic.c | |||
| @@ -11,8 +11,8 @@ void matrix_scan_user(void) { | |||
| 11 | }; | 11 | }; |
| 12 | 12 | ||
| 13 | __attribute__ ((weak)) | 13 | __attribute__ ((weak)) |
| 14 | void process_action_user(keyrecord_t *record) { | 14 | bool process_action_user(keyrecord_t *record) { |
| 15 | 15 | return true; | |
| 16 | }; | 16 | }; |
| 17 | 17 | ||
| 18 | void matrix_init_kb(void) { | 18 | void matrix_init_kb(void) { |
| @@ -36,8 +36,8 @@ void matrix_scan_kb(void) { | |||
| 36 | matrix_scan_user(); | 36 | matrix_scan_user(); |
| 37 | }; | 37 | }; |
| 38 | 38 | ||
| 39 | void process_action_kb(keyrecord_t *record) { | 39 | bool process_action_kb(keyrecord_t *record) { |
| 40 | process_action_user(record); | 40 | return process_action_user(record); |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | #ifdef BACKLIGHT_ENABLE | 43 | #ifdef BACKLIGHT_ENABLE |
diff --git a/keyboard/preonic/preonic.h b/keyboard/preonic/preonic.h index 030acdadb..2406a11d7 100644 --- a/keyboard/preonic/preonic.h +++ b/keyboard/preonic/preonic.h | |||
| @@ -47,6 +47,6 @@ | |||
| 47 | 47 | ||
| 48 | void matrix_init_user(void); | 48 | void matrix_init_user(void); |
| 49 | void matrix_scan_user(void); | 49 | void matrix_scan_user(void); |
| 50 | void process_action_kb(keyrecord_t *record); | 50 | bool process_action_kb(keyrecord_t *record); |
| 51 | 51 | ||
| 52 | #endif | 52 | #endif |
