diff options
author | Jack Humbert <jack.humb@gmail.com> | 2016-05-15 01:07:48 -0400 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2016-05-15 01:07:48 -0400 |
commit | e2aa980ad5d92f76dadf1de9dbadb9eacbddd5df (patch) | |
tree | 4c535a6f2fb20e064e6f95e2f8c628c3c11b1153 | |
parent | fde477a927edc6b4207a6968d44aeed021e8b300 (diff) |
cleans up default keymaps (olkb)
-rw-r--r-- | keyboard/atomic/atomic.h | 6 | ||||
-rw-r--r-- | keyboard/planck/keymaps/default/keymap.c | 86 | ||||
-rw-r--r-- | keyboard/preonic/keymaps/default/keymap.c | 85 | ||||
-rw-r--r-- | keyboard/preonic/preonic.h | 14 |
4 files changed, 7 insertions, 184 deletions
diff --git a/keyboard/atomic/atomic.h b/keyboard/atomic/atomic.h index 2d6b4c6cb5..456c3fbdf8 100644 --- a/keyboard/atomic/atomic.h +++ b/keyboard/atomic/atomic.h @@ -1,11 +1,7 @@ #ifndef ATOMIC_H #define ATOMIC_H -#include "matrix.h" -#include "keymap_common.h" -#ifdef BACKLIGHT_ENABLE - #include "backlight.h" -#endif +#include "quantum.h" #include <stddef.h> #include <avr/io.h> diff --git a/keyboard/planck/keymaps/default/keymap.c b/keyboard/planck/keymaps/default/keymap.c index 56f20a3b99..79bf62436a 100644 --- a/keyboard/planck/keymaps/default/keymap.c +++ b/keyboard/planck/keymaps/default/keymap.c @@ -19,8 +19,7 @@ extern keymap_config_t keymap_config; #define _DVORAK 2 #define _LOWER 3 #define _RAISE 4 -#define _MUSIC 5 -#define _PLOVER 6 +#define _PLOVER 5 #define _ADJUST 16 // Macro name shortcuts @@ -30,12 +29,6 @@ extern keymap_config_t keymap_config; #define LOWER M(_LOWER) #define RAISE M(_RAISE) #define M_BL 5 -#define AUD_OFF M(6) -#define AUD_ON M(7) -#define MUS_OFF M(8) -#define MUS_ON M(9) -#define VC_IN M(10) -#define VC_DE M(11) #define PLOVER M(12) #define EXT_PLV M(13) #define TOG_OUT M(14) @@ -136,16 +129,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} }, -/* Music (reserved for process_action_user) - * - */ -[_MUSIC] = { - {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, LOWER, XXXXXXX, XXXXXXX, RAISE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX} -}, - /* Plover layer (http://opensteno.org) * ,-----------------------------------------------------------------------------------. * | # | # | # | # | # | # | # | # | # | # | # | # | @@ -178,8 +161,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_ADJUST] = { {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, - {_______, _______, _______, AUD_ON, AUD_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______}, - {_______, VC_DE, VC_IN, MUS_ON, MUS_OFF, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______}, + {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} } @@ -205,7 +188,6 @@ float tone_colemak[][2] = SONG(COLEMAK_SOUND); float tone_plover[][2] = SONG(PLOVER_SOUND); float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); -float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); float goodbye[][2] = SONG(GOODBYE_SOUND); #endif @@ -270,53 +252,6 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) unregister_code(KC_RSFT); } break; - case 6: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - audio_off(); - #endif - } - break; - case 7: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - audio_on(); - PLAY_NOTE_ARRAY(tone_startup, false, 0); - #endif - } - break; - case 8: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - layer_off(_MUSIC); - stop_all_notes(); - #endif - } - break; - case 9: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(music_scale, false, 0); - layer_on(_MUSIC); - #endif - } - break; - case 10: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - voice_iterate(); - PLAY_NOTE_ARRAY(music_scale, false, 0); - #endif - } - break; - case 11: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - voice_deiterate(); - PLAY_NOTE_ARRAY(music_scale, false, 0); - #endif - } - break; case 12: if (record->event.pressed) { #ifdef AUDIO_ENABLE @@ -366,19 +301,4 @@ void play_goodbye_tone() PLAY_NOTE_ARRAY(goodbye, false, 0); _delay_ms(150); } - -uint8_t starting_note = 0x0C; -int offset = 0; - -void process_action_user(keyrecord_t *record) { - - if (IS_LAYER_ON(_MUSIC)) { - if (record->event.pressed) { - 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); - } else { - 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))); - } - } - -} #endif diff --git a/keyboard/preonic/keymaps/default/keymap.c b/keyboard/preonic/keymaps/default/keymap.c index b3aa14dcbe..f808ab1ce4 100644 --- a/keyboard/preonic/keymaps/default/keymap.c +++ b/keyboard/preonic/keymaps/default/keymap.c @@ -14,7 +14,6 @@ #define _DVORAK 2 #define _LOWER 3 #define _RAISE 4 -#define _MUSIC 5 #define _ADJUST 16 // Macro name shortcuts @@ -24,12 +23,6 @@ #define LOWER M(_LOWER) #define RAISE M(_RAISE) #define M_BL 5 -#define AUD_OFF M(6) -#define AUD_ON M(7) -#define MUS_OFF M(8) -#define MUS_ON M(9) -#define VC_IN M(10) -#define VC_DE M(11) // Fillers to make layering more clear #define _______ KC_TRNS @@ -142,17 +135,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} }, -/* Music (reserved for process_action_user) - * - */ -[_MUSIC] = { - {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, XXXXXXX, XXXXXXX, LOWER, XXXXXXX, XXXXXXX, RAISE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX} -}, - /* Adjust (Lower + Raise) * ,-----------------------------------------------------------------------------------. * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | @@ -169,8 +151,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJUST] = { {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}, {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, - {_______, _______, _______, AUD_ON, AUD_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______}, - {_______, VC_DE, VC_IN, MUS_ON, MUS_OFF, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______}, + {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} } @@ -193,7 +175,6 @@ float tone_qwerty[][2] = SONG(QWERTY_SOUND); float tone_dvorak[][2] = SONG(DVORAK_SOUND); float tone_colemak[][2] = SONG(COLEMAK_SOUND); -float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); float goodbye[][2] = SONG(GOODBYE_SOUND); #endif @@ -257,53 +238,6 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) unregister_code(KC_RSFT); } break; - case 6: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - audio_off(); - #endif - } - break; - case 7: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - audio_on(); - PLAY_NOTE_ARRAY(start_up, false, 0); - #endif - } - break; - case 8: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - layer_off(_MUSIC); - stop_all_notes(); - #endif - } - break; - case 9: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(music_scale, false, 0); - layer_on(_MUSIC); - #endif - } - break; - case 10: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - voice_iterate(); - PLAY_NOTE_ARRAY(music_scale, false, 0); - #endif - } - break; - case 11: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - voice_deiterate(); - PLAY_NOTE_ARRAY(music_scale, false, 0); - #endif - } - break; } return MACRO_NONE; }; @@ -318,21 +252,6 @@ void matrix_init_user(void) { #ifdef AUDIO_ENABLE -uint8_t starting_note = 0x0C; -int offset = 0; - -void process_action_user(keyrecord_t *record) { - - if (IS_LAYER_ON(_MUSIC)) { - if (record->event.pressed) { - 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); - } else { - 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))); - } - } - -} - void play_goodbye_tone() { PLAY_NOTE_ARRAY(goodbye, false, 0); diff --git a/keyboard/preonic/preonic.h b/keyboard/preonic/preonic.h index 2406a11d7e..feb8797744 100644 --- a/keyboard/preonic/preonic.h +++ b/keyboard/preonic/preonic.h @@ -1,19 +1,7 @@ #ifndef PREONIC_H #define PREONIC_H -#include "matrix.h" -#include "keymap_common.h" -#ifdef BACKLIGHT_ENABLE - #include "backlight.h" -#endif -#ifdef RGBLIGHT_ENABLE - #include "rgblight.h" -#endif -#include <stddef.h> -#include <avr/io.h> -#ifdef MIDI_ENABLE - #include <keymap_midi.h> -#endif +#include "quantum.h" #define PREONIC_MIT( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ |