summaryrefslogtreecommitdiffstats
path: root/users/alfrdmalr/alfrdmalr.c
diff options
context:
space:
mode:
Diffstat (limited to 'users/alfrdmalr/alfrdmalr.c')
-rw-r--r--users/alfrdmalr/alfrdmalr.c59
1 files changed, 55 insertions, 4 deletions
diff --git a/users/alfrdmalr/alfrdmalr.c b/users/alfrdmalr/alfrdmalr.c
index 39d2b62e00..18ce8bad7c 100644
--- a/users/alfrdmalr/alfrdmalr.c
+++ b/users/alfrdmalr/alfrdmalr.c
@@ -35,10 +35,61 @@ void matrix_scan_user(void) {
SEQ_FIVE_KEYS(KC_R, KC_E, KC_S, KC_E, KC_T) {
reset_keyboard();
}
- // minimize window (Windows)
- SEQ_THREE_KEYS(KC_M, KC_I, KC_N) {
- SEND_STRING(SS_LALT(" ")"n");
- }
leader_end();
}
+}
+
+bool syml_pressed = false;
+bool symr_pressed = false;
+bool settings_active = false;
+bool symbols_active = false;
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ switch(keycode) {
+ case SYML:
+ if (record->event.pressed) {
+ syml_pressed = true;
+ } else {
+ syml_pressed = false;
+ }
+ break;
+ case SYMR:
+ if (record->event.pressed) {
+ symr_pressed = true;
+ } else {
+ symr_pressed = false;
+ }
+ break;
+ }
+
+ // trilayer-esque behavior. If both SYMBOL layer keys are held, then the
+ // settings layer is open. If only one is held, SYMBOL is active.
+ if (syml_pressed && symr_pressed) {
+ layer_on(_SETTINGS);
+ settings_active = true;
+ } else if (syml_pressed || symr_pressed) {
+ if (settings_active) {
+ layer_off(_SETTINGS);
+ settings_active = false;
+ }
+ layer_on(_SYMBOL);
+ symbols_active = true;
+ } else {
+ if (symbols_active) {
+ layer_off(_SYMBOL);
+ symbols_active = false;
+ }
+ }
+
+ return true;
+}
+
+// allow access to the settings layer to turn music mode back off
+bool music_mask_user(uint16_t keycode) {
+ switch (keycode) {
+ case SYML:
+ case SYMR:
+ return false;
+ default:
+ return true;
+ }
} \ No newline at end of file