summaryrefslogtreecommitdiff
path: root/keyboards/thevankeyboards/minivan/keymaps/xyverz/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/thevankeyboards/minivan/keymaps/xyverz/keymap.c')
-rw-r--r--keyboards/thevankeyboards/minivan/keymaps/xyverz/keymap.c84
1 files changed, 20 insertions, 64 deletions
diff --git a/keyboards/thevankeyboards/minivan/keymaps/xyverz/keymap.c b/keyboards/thevankeyboards/minivan/keymaps/xyverz/keymap.c
index 059b7eb46e..f5649573d8 100644
--- a/keyboards/thevankeyboards/minivan/keymaps/xyverz/keymap.c
+++ b/keyboards/thevankeyboards/minivan/keymaps/xyverz/keymap.c
@@ -1,24 +1,8 @@
#include QMK_KEYBOARD_H
-extern keymap_config_t keymap_config;
+enum layer_names { _QWERTY, _COLEMAK, _DVORAK, _LOWER, _RAISE, _ADJUST };
-enum planck_layers {
- _QWERTY,
- _COLEMAK,
- _DVORAK,
- _LOWER,
- _RAISE,
- _ADJUST
-};
-
-enum planck_keycodes {
- DVORAK = SAFE_RANGE,
- QWERTY,
- COLEMAK,
- LOWER,
- RAISE,
- ADJUST
-};
+enum custom_keycodes { QWERTY = SAFE_RANGE, COLEMAK, DVORAK, LOWER, RAISE, ADJUST };
// Aliases for some other things I want to try out
#define RAI_ESC LT(_RAISE, KC_ESC)
@@ -26,6 +10,7 @@ enum planck_keycodes {
#define LOW_MIN LT(_LOWER, KC_MINS) // Same as above, but for Dvorak layer
#define GUIBSPC GUI_T(KC_BSPC)
+// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_DVORAK] = LAYOUT( /* 0: Dvorak */
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH,
@@ -69,52 +54,23 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_HOME, KC_END, _______, _______, _______, _______, KC_PGUP, KC_PGDN
)
};
+// clang-format on
-void persistent_default_layer_set(uint16_t default_layer) {
- eeconfig_update_default_layer(default_layer);
- default_layer_set(default_layer);
-}
+layer_state_t layer_state_set_user(layer_state_t state) { return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); };
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
- switch (keycode) {
- case QWERTY:
- if (record->event.pressed) {
- persistent_default_layer_set(1UL<<_QWERTY);
- }
- return false;
- break;
- case COLEMAK:
- if (record->event.pressed) {
- persistent_default_layer_set(1UL<<_COLEMAK);
- }
- return false;
- break;
- case DVORAK:
- if (record->event.pressed) {
- persistent_default_layer_set(1UL<<_DVORAK);
- }
- return false;
- break;
- case LOWER:
- if (record->event.pressed) {
- layer_on(_LOWER);
- update_tri_layer(_LOWER, _RAISE, _ADJUST);
- } else {
- layer_off(_LOWER);
- update_tri_layer(_LOWER, _RAISE, _ADJUST);
- }
- return false;
- break;
- case RAISE:
- if (record->event.pressed) {
- layer_on(_RAISE);
- update_tri_layer(_LOWER, _RAISE, _ADJUST);
- } else {
- layer_off(_RAISE);
- update_tri_layer(_LOWER, _RAISE, _ADJUST);
- }
- return false;
- break;
- }
- return true;
-}
+ if (record->event.pressed) {
+ switch (keycode) {
+ case QWERTY:
+ set_single_persistent_default_layer(_QWERTY);
+ return false;
+ case COLEMAK:
+ set_single_persistent_default_layer(_COLEMAK);
+ return false;
+ case DVORAK:
+ set_single_persistent_default_layer(_DVORAK);
+ return false;
+ }
+ }
+ return true;
+} \ No newline at end of file