forked from qmk/qmk_firmware
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Keymap] Various enhancements for dshields user space and keymaps. (q…
…mk#6816) - Add oneshot mod/layer unlocking - Fix Planck rev 3 backlight breathing - Fix Planck rev 6 build with arm gcc 9.2.0 - General code clean up
- Loading branch information
1 parent
0f9e265
commit 00abe5d
Showing
6 changed files
with
54 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,31 @@ | ||
extern keymap_config_t keymap_config; | ||
#include "quantum.h" | ||
#include "dshields.h" | ||
|
||
/* uncomment to reset | ||
void matrix_init_user(void) { | ||
eeconfig_init(); | ||
}; | ||
*/ | ||
extern bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t *record); | ||
|
||
bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
if (!process_record_dynamic_macro(keycode, record)) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
// work in progress | ||
uint32_t layer_state_set_user(uint32_t state) { | ||
switch (biton32(state)) { | ||
case DEF: | ||
set_all_leds_to(0,0,0); | ||
break; | ||
case FUN: | ||
// TODO light the fn keys | ||
// set_led_to(?, 0, 128, 0); | ||
// set_led_to(?, 0, 128, 0); | ||
break; | ||
if (keycode == KC_ESC && record->event.pressed) { | ||
bool rc = true; | ||
uint8_t mods = 0; | ||
if ((mods = get_oneshot_mods()) && !has_oneshot_mods_timed_out()) { | ||
clear_oneshot_mods(); | ||
unregister_mods(mods); | ||
rc = false; | ||
} | ||
if ((mods = get_oneshot_locked_mods())) { | ||
clear_oneshot_locked_mods(); | ||
unregister_mods(mods); | ||
rc = false; | ||
} | ||
if (is_oneshot_layer_active()) { | ||
layer_clear(); | ||
rc = false; | ||
} | ||
return rc; | ||
} | ||
return state; | ||
return true; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters