aboutsummaryrefslogtreecommitdiff
path: root/keyboard
diff options
context:
space:
mode:
Diffstat (limited to 'keyboard')
-rw-r--r--keyboard/atomic/atomic.c7
-rw-r--r--keyboard/atomic/atomic.h2
-rw-r--r--keyboard/gh60_rev_c/gh60.c7
-rw-r--r--keyboard/gh60_rev_c/gh60.h2
-rw-r--r--keyboard/planck/keymaps/experimental/keymap.c48
-rw-r--r--keyboard/planck/planck.c8
-rw-r--r--keyboard/planck/planck.h16
-rw-r--r--keyboard/preonic/preonic.c8
-rw-r--r--keyboard/preonic/preonic.h2
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))
14void process_action_user(keyrecord_t *record) { 14bool 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
48void process_action_kb(keyrecord_t *record) { 49bool 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
55void led_set_kb(uint8_t usb_led) { 56void 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
30void matrix_init_user(void); 30void matrix_init_user(void);
31void matrix_scan_user(void); 31void matrix_scan_user(void);
32void process_action_user(keyrecord_t *record); 32bool process_action_user(keyrecord_t *record);
33void led_set_user(uint8_t usb_led); 33void led_set_user(uint8_t usb_led);
34void backlight_init_ports(void); 34void 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))
15void process_action_user(keyrecord_t *record) { 15bool 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
38void process_action_kb(keyrecord_t *record) { 39bool 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
45void led_set_kb(uint8_t usb_led) { 46void 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
76void matrix_init_user(void); 76void matrix_init_user(void);
77void matrix_scan_user(void); 77void matrix_scan_user(void);
78void process_action_user(keyrecord_t *record); 78bool process_action_user(keyrecord_t *record);
79void led_set_user(uint8_t usb_led); 79void 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
11extern keymap_config_t keymap_config; 12extern 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
363void 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
369uint8_t starting_note = 0x0C; 371LEADER_EXTERNS();
370int offset = 0;
371 372
372void process_action_user(keyrecord_t *record) { 373#define LEADER_TIMEOUT 300
373 374
374 if (IS_LAYER_ON(_MUSIC)) { 375void 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))
7void matrix_scan_user(void) {} 7void matrix_scan_user(void) {}
8 8
9__attribute__ ((weak)) 9__attribute__ ((weak))
10void process_action_user(keyrecord_t *record) {} 10bool process_action_user(keyrecord_t *record) {
11 return true;
12}
11 13
12__attribute__ ((weak)) 14__attribute__ ((weak))
13void led_set_user(uint8_t usb_led) {} 15void 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
35void process_action_kb(keyrecord_t *record) { 37bool process_action_kb(keyrecord_t *record) {
36 process_action_user(record); 38 return process_action_user(record);
37} 39}
38 40
39void led_set_kb(uint8_t usb_led) { 41void 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
44void matrix_init_user(void); 32void matrix_init_user(void);
45void matrix_scan_user(void); 33void matrix_scan_user(void);
46void process_action_user(keyrecord_t *record); 34bool process_action_user(keyrecord_t *record);
47 35
48void led_set_user(uint8_t usb_led); 36void led_set_user(uint8_t usb_led);
49void backlight_init_ports(void); 37void 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))
14void process_action_user(keyrecord_t *record) { 14bool process_action_user(keyrecord_t *record) {
15 15 return true;
16}; 16};
17 17
18void matrix_init_kb(void) { 18void 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
39void process_action_kb(keyrecord_t *record) { 39bool 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
48void matrix_init_user(void); 48void matrix_init_user(void);
49void matrix_scan_user(void); 49void matrix_scan_user(void);
50void process_action_kb(keyrecord_t *record); 50bool process_action_kb(keyrecord_t *record);
51 51
52#endif 52#endif