summaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2022-11-05 17:05:19 +0000
committerGitHub <noreply@github.com>2022-11-05 17:05:19 +0000
commit69fa02c37d296273c47a5cc0767ca9e6b7170a47 (patch)
treecb8fb58957f8ebdb166a5e68db4ea522452f7c89 /quantum
parentfd4c3f46fb31c6b095607706808a58ba068536bf (diff)
Align audio keycode names (#18962)
* Align audio keycode names * Update docs * Update quantum
Diffstat (limited to 'quantum')
-rw-r--r--quantum/keycodes.h53
-rw-r--r--quantum/process_keycode/process_audio.c10
-rw-r--r--quantum/process_keycode/process_clicky.c16
-rw-r--r--quantum/process_keycode/process_music.c8
-rw-r--r--quantum/quantum_keycodes_legacy.h12
5 files changed, 60 insertions, 39 deletions
diff --git a/quantum/keycodes.h b/quantum/keycodes.h
index 2ef94f5d3e..ec07648ab5 100644
--- a/quantum/keycodes.h
+++ b/quantum/keycodes.h
@@ -563,21 +563,21 @@ enum qk_keycode_defines {
QK_PROGRAMMABLE_BUTTON_30 = 0x745D,
QK_PROGRAMMABLE_BUTTON_31 = 0x745E,
QK_PROGRAMMABLE_BUTTON_32 = 0x745F,
- AU_ON = 0x7480,
- AU_OFF = 0x7481,
- AU_TOG = 0x7482,
- CLICKY_TOGGLE = 0x748A,
- CLICKY_ENABLE = 0x748B,
- CLICKY_DISABLE = 0x748C,
- CLICKY_UP = 0x748D,
- CLICKY_DOWN = 0x748E,
- CLICKY_RESET = 0x748F,
- MU_ON = 0x7490,
- MU_OFF = 0x7491,
- MU_TOG = 0x7492,
- MU_MOD = 0x7493,
- MUV_IN = 0x7494,
- MUV_DE = 0x7495,
+ QK_AUDIO_ON = 0x7480,
+ QK_AUDIO_OFF = 0x7481,
+ QK_AUDIO_TOGGLE = 0x7482,
+ QK_AUDIO_CLICKY_TOGGLE = 0x748A,
+ QK_AUDIO_CLICKY_ON = 0x748B,
+ QK_AUDIO_CLICKY_OFF = 0x748C,
+ QK_AUDIO_CLICKY_UP = 0x748D,
+ QK_AUDIO_CLICKY_DOWN = 0x748E,
+ QK_AUDIO_CLICKY_RESET = 0x748F,
+ QK_MUSIC_ON = 0x7490,
+ QK_MUSIC_OFF = 0x7491,
+ QK_MUSIC_TOGGLE = 0x7492,
+ QK_MUSIC_MODE_NEXT = 0x7493,
+ QK_AUDIO_VOICE_NEXT = 0x7494,
+ QK_AUDIO_VOICE_PREVIOUS = 0x7495,
QK_STENO_BOLT = 0x74F0,
QK_STENO_GEMINI = 0x74F1,
QK_STENO_COMB = 0x74F2,
@@ -992,12 +992,21 @@ enum qk_keycode_defines {
PB_30 = QK_PROGRAMMABLE_BUTTON_30,
PB_31 = QK_PROGRAMMABLE_BUTTON_31,
PB_32 = QK_PROGRAMMABLE_BUTTON_32,
- CK_TOGG = CLICKY_TOGGLE,
- CK_ON = CLICKY_ENABLE,
- CK_OFF = CLICKY_DISABLE,
- CK_UP = CLICKY_UP,
- CK_DOWN = CLICKY_DOWN,
- CK_RST = CLICKY_RESET,
+ AU_ON = QK_AUDIO_ON,
+ AU_OFF = QK_AUDIO_OFF,
+ AU_TOGG = QK_AUDIO_TOGGLE,
+ CK_TOGG = QK_AUDIO_CLICKY_TOGGLE,
+ CK_ON = QK_AUDIO_CLICKY_ON,
+ CK_OFF = QK_AUDIO_CLICKY_OFF,
+ CK_UP = QK_AUDIO_CLICKY_UP,
+ CK_DOWN = QK_AUDIO_CLICKY_DOWN,
+ CK_RST = QK_AUDIO_CLICKY_RESET,
+ MU_ON = QK_MUSIC_ON,
+ MU_OFF = QK_MUSIC_OFF,
+ MU_TOGG = QK_MUSIC_TOGGLE,
+ MU_NEXT = QK_MUSIC_MODE_NEXT,
+ AU_NEXT = QK_AUDIO_VOICE_NEXT,
+ AU_PREV = QK_AUDIO_VOICE_PREVIOUS,
MC_0 = QK_MACRO_0,
MC_1 = QK_MACRO_1,
MC_2 = QK_MACRO_2,
@@ -1139,7 +1148,7 @@ enum qk_keycode_defines {
#define IS_SEQUENCER_KEYCODE(code) ((code) >= SQ_ON && (code) <= SQ_SCLR)
#define IS_JOYSTICK_KEYCODE(code) ((code) >= QK_JOYSTICK_BUTTON_0 && (code) <= QK_JOYSTICK_BUTTON_31)
#define IS_PROGRAMMABLE_BUTTON_KEYCODE(code) ((code) >= QK_PROGRAMMABLE_BUTTON_1 && (code) <= QK_PROGRAMMABLE_BUTTON_32)
-#define IS_AUDIO_KEYCODE(code) ((code) >= AU_ON && (code) <= MUV_DE)
+#define IS_AUDIO_KEYCODE(code) ((code) >= QK_AUDIO_ON && (code) <= QK_AUDIO_VOICE_PREVIOUS)
#define IS_STENO_KEYCODE(code) ((code) >= QK_STENO_BOLT && (code) <= QK_STENO_COMB_MAX)
#define IS_MACRO_KEYCODE(code) ((code) >= QK_MACRO_0 && (code) <= QK_MACRO_31)
#define IS_BACKLIGHT_KEYCODE(code) ((code) >= BL_ON && (code) <= BL_BRTG)
diff --git a/quantum/process_keycode/process_audio.c b/quantum/process_keycode/process_audio.c
index e7fe453308..03b0af9277 100644
--- a/quantum/process_keycode/process_audio.c
+++ b/quantum/process_keycode/process_audio.c
@@ -16,17 +16,17 @@ float compute_freq_for_midi_note(uint8_t note) {
}
bool process_audio(uint16_t keycode, keyrecord_t *record) {
- if (keycode == AU_ON && record->event.pressed) {
+ if (keycode == QK_AUDIO_ON && record->event.pressed) {
audio_on();
return false;
}
- if (keycode == AU_OFF && record->event.pressed) {
+ if (keycode == QK_AUDIO_OFF && record->event.pressed) {
audio_off();
return false;
}
- if (keycode == AU_TOG && record->event.pressed) {
+ if (keycode == QK_AUDIO_TOGGLE && record->event.pressed) {
if (is_audio_on()) {
audio_off();
} else {
@@ -35,13 +35,13 @@ bool process_audio(uint16_t keycode, keyrecord_t *record) {
return false;
}
- if (keycode == MUV_IN && record->event.pressed) {
+ if (keycode == QK_AUDIO_VOICE_NEXT && record->event.pressed) {
voice_iterate();
PLAY_SONG(voice_change_song);
return false;
}
- if (keycode == MUV_DE && record->event.pressed) {
+ if (keycode == QK_AUDIO_VOICE_PREVIOUS && record->event.pressed) {
voice_deiterate();
PLAY_SONG(voice_change_song);
return false;
diff --git a/quantum/process_keycode/process_clicky.c b/quantum/process_keycode/process_clicky.c
index 9795734984..b662a3f2f4 100644
--- a/quantum/process_keycode/process_clicky.c
+++ b/quantum/process_keycode/process_clicky.c
@@ -82,31 +82,31 @@ bool is_clicky_on(void) {
}
bool process_clicky(uint16_t keycode, keyrecord_t *record) {
- if (keycode == CLICKY_TOGGLE && record->event.pressed) {
+ if (keycode == QK_AUDIO_CLICKY_TOGGLE && record->event.pressed) {
clicky_toggle();
}
- if (keycode == CLICKY_ENABLE && record->event.pressed) {
+ if (keycode == QK_AUDIO_CLICKY_ON && record->event.pressed) {
clicky_on();
}
- if (keycode == CLICKY_DISABLE && record->event.pressed) {
+ if (keycode == QK_AUDIO_CLICKY_OFF && record->event.pressed) {
clicky_off();
}
- if (keycode == CLICKY_RESET && record->event.pressed) {
+ if (keycode == QK_AUDIO_CLICKY_RESET && record->event.pressed) {
clicky_freq_reset();
}
- if (keycode == CLICKY_UP && record->event.pressed) {
+ if (keycode == QK_AUDIO_CLICKY_UP && record->event.pressed) {
clicky_freq_up();
}
- if (keycode == CLICKY_DOWN && record->event.pressed) {
+ if (keycode == QK_AUDIO_CLICKY_DOWN && record->event.pressed) {
clicky_freq_down();
}
if (audio_config.enable && audio_config.clicky_enable) {
- if (record->event.pressed) { // Leave this separate so it's easier to add upstroke sound
- if (keycode != AU_OFF && keycode != AU_TOG) { // DO NOT PLAY if audio will be disabled, and causes issuse on ARM
+ if (record->event.pressed) { // Leave this separate so it's easier to add upstroke sound
+ if (keycode != QK_AUDIO_ON && keycode != QK_AUDIO_OFF) { // DO NOT PLAY if audio will be disabled, and causes issuse on ARM
clicky_play();
}
}
diff --git a/quantum/process_keycode/process_music.c b/quantum/process_keycode/process_music.c
index eeec0c28a4..950aec22f9 100644
--- a/quantum/process_keycode/process_music.c
+++ b/quantum/process_keycode/process_music.c
@@ -101,17 +101,17 @@ void music_all_notes_off(void) {
}
bool process_music(uint16_t keycode, keyrecord_t *record) {
- if (keycode == MU_ON && record->event.pressed) {
+ if (keycode == QK_MUSIC_ON && record->event.pressed) {
music_on();
return false;
}
- if (keycode == MU_OFF && record->event.pressed) {
+ if (keycode == QK_MUSIC_OFF && record->event.pressed) {
music_off();
return false;
}
- if (keycode == MU_TOG && record->event.pressed) {
+ if (keycode == QK_MUSIC_TOGGLE && record->event.pressed) {
if (music_activated) {
music_off();
} else {
@@ -139,7 +139,7 @@ bool process_music(uint16_t keycode, keyrecord_t *record) {
return false;
}
- if (keycode == MU_MOD && record->event.pressed) {
+ if (keycode == QK_MUSIC_MODE_NEXT && record->event.pressed) {
music_mode_cycle();
return false;
}
diff --git a/quantum/quantum_keycodes_legacy.h b/quantum/quantum_keycodes_legacy.h
index 8f325251bc..44044ec625 100644
--- a/quantum/quantum_keycodes_legacy.h
+++ b/quantum/quantum_keycodes_legacy.h
@@ -123,6 +123,18 @@
#define KC_RAPC QK_SPACE_CADET_RIGHT_ALT_PARENTHESIS_CLOSE
#define KC_SFTENT QK_SPACE_CADET_RIGHT_SHIFT_ENTER
+#define AU_TOG QK_AUDIO_TOGGLE
+#define CLICKY_TOGGLE QK_AUDIO_CLICKY_TOGGLE
+#define CLICKY_ENABLE QK_AUDIO_CLICKY_ON
+#define CLICKY_DISABLE QK_AUDIO_CLICKY_OFF
+#define CLICKY_UP QK_AUDIO_CLICKY_UP
+#define CLICKY_DOWN QK_AUDIO_CLICKY_DOWN
+#define CLICKY_RESET QK_AUDIO_CLICKY_RESET
+#define MU_TOG QK_MUSIC_TOGGLE
+#define MU_MOD QK_MUSIC_MODE_NEXT
+#define MUV_IN QK_AUDIO_VOICE_NEXT
+#define MUV_DE QK_AUDIO_VOICE_PREVIOUS
+
#define TERM_ON _Static_assert(false, "The Terminal feature has been removed from QMK. Please remove use of TERM_ON/TERM_OFF from your keymap.")
#define TERM_OFF _Static_assert(false, "The Terminal feature has been removed from QMK.. Please remove use of TERM_ON/TERM_OFF from your keymap.")
// #define RESET _Static_assert(false, "The RESET keycode has been removed from QMK.. Please remove use from your keymap.")