summaryrefslogtreecommitdiff
path: root/quantum/quantum.c
diff options
context:
space:
mode:
authorThat-Canadian2017-08-13 14:11:25 -0400
committerThat-Canadian2017-08-13 14:11:25 -0400
commit09e5885e45cf37c0651744770cd99b5b744ba894 (patch)
tree1c2c1d85598d7b1332e2e82b6276a49b2dc2d2b0 /quantum/quantum.c
parent48a89ad8649ffe5fa054eccf1b0498f8a0a49b32 (diff)
parent5ad103fa51083cb26d3516e5598b7b2a099b1521 (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'quantum/quantum.c')
-rw-r--r--quantum/quantum.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 0243a7e01..aac1d07a9 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -40,13 +40,12 @@ extern backlight_config_t backlight_config;
#ifndef AG_SWAP_SONG
#define AG_SWAP_SONG SONG(AG_SWAP_SOUND)
#endif
- #ifndef DEFAULT_LAYER_SONGS
- #define DEFAULT_LAYER_SONGS { }
- #endif
float goodbye_song[][2] = GOODBYE_SONG;
float ag_norm_song[][2] = AG_NORM_SONG;
float ag_swap_song[][2] = AG_SWAP_SONG;
- float default_layer_songs[][16][2] = DEFAULT_LAYER_SONGS;
+ #ifdef DEFAULT_LAYER_SONGS
+ float default_layer_songs[][16][2] = DEFAULT_LAYER_SONGS;
+ #endif
#endif
static void do_code16 (uint16_t code, void (*f) (uint8_t)) {
@@ -479,6 +478,13 @@ bool process_record_quantum(keyrecord_t *record) {
void (*method)(uint8_t) = (record->event.pressed) ? &add_key : &del_key;
uint8_t shifted = get_mods() & ((MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)
|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)));
+
+#ifdef GRAVE_ESC_CTRL_OVERRIDE
+ // if CTRL is pressed, ESC is always read as ESC, even if SHIFT or GUI is pressed.
+ // this is handy for the ctrl+shift+esc shortcut on windows, among other things.
+ if (get_mods() & (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)))
+ shifted = 0;
+#endif
method(shifted ? KC_GRAVE : KC_ESCAPE);
send_keyboard_report();
@@ -560,7 +566,7 @@ void send_string_with_delay(const char *str, uint8_t interval) {
}
void set_single_persistent_default_layer(uint8_t default_layer) {
- #ifdef AUDIO_ENABLE
+ #if defined(AUDIO_ENABLE) && defined(DEFAULT_LAYER_SONGS)
PLAY_SONG(default_layer_songs[default_layer]);
#endif
eeconfig_update_default_layer(1U<<default_layer);