summaryrefslogtreecommitdiff
path: root/keyboards/atreus
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/atreus')
-rw-r--r--keyboards/atreus/keymaps/xyverz/keymap.c68
-rw-r--r--keyboards/atreus/keymaps/xyverz/readme.md12
2 files changed, 29 insertions, 51 deletions
diff --git a/keyboards/atreus/keymaps/xyverz/keymap.c b/keyboards/atreus/keymaps/xyverz/keymap.c
index fe1ca295d8..7653206ae5 100644
--- a/keyboards/atreus/keymaps/xyverz/keymap.c
+++ b/keyboards/atreus/keymaps/xyverz/keymap.c
@@ -3,8 +3,6 @@
// Preonic keyboards by Jack Humbert.
#include QMK_KEYBOARD_H
-#include "action_layer.h"
-#include "eeconfig.h"
extern keymap_config_t keymap_config;
@@ -12,13 +10,16 @@ extern keymap_config_t keymap_config;
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
-#define _DVORAK 0
-#define _QWERTY 1
-#define _COLEMAK 2
-#define _DVORMAC 3
-#define _LOWER 4
-#define _RAISE 5
-#define _ADJUST 16
+
+enum layer_names {
+ _DVORAK,
+ _QWERTY,
+ _COLEMAK,
+ _DVORMAC,
+ _LOWER,
+ _RAISE,
+ _ADJUST
+};
enum planck_keycodes {
DVORAK = SAFE_RANGE,
@@ -27,7 +28,7 @@ enum planck_keycodes {
DVORMAC,
LOWER,
RAISE,
- BACKLIT
+ ADJUST
};
// Adding macros to make the keymaps below much easier to read.
@@ -37,6 +38,9 @@ enum planck_keycodes {
#define ALTENT ALT_T(KC_ENT)
#define ESCTRL CTL_T(KC_ESC)
#define TABALT ALT_T(KC_TAB)
+#define ADJUST MO(_ADJUST)
+#define LOWER MO(_LOWER)
+#define RAISE MO(_RAISE)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Dvorak Layer
@@ -159,57 +163,31 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
};
-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:
+ case DVORAK:
if (record->event.pressed) {
- persistent_default_layer_set(1UL<<_QWERTY);
+ set_single_persistent_default_layer(_DVORAK);
}
return false;
- break;
case COLEMAK:
if (record->event.pressed) {
- persistent_default_layer_set(1UL<<_COLEMAK);
+ set_single_persistent_default_layer(_COLEMAK);
}
return false;
- break;
- case DVORAK:
+ case QWERTY:
if (record->event.pressed) {
- persistent_default_layer_set(1UL<<_DVORAK);
+ set_single_persistent_default_layer(_QWERTY);
}
return false;
- break;
case DVORMAC:
if (record->event.pressed) {
- persistent_default_layer_set(1UL<<_DVORMAC);
+ set_single_persistent_default_layer(_DVORMAC);
}
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;
-};
+} \ No newline at end of file
diff --git a/keyboards/atreus/keymaps/xyverz/readme.md b/keyboards/atreus/keymaps/xyverz/readme.md
index ec7d836c17..aa44f01dae 100644
--- a/keyboards/atreus/keymaps/xyverz/readme.md
+++ b/keyboards/atreus/keymaps/xyverz/readme.md
@@ -9,7 +9,7 @@ to a final go with this.
I'm using MOD_TAP quite a bit in this keymap. On all layers, R4 pinky keys use mod-tap and are SHIFT when held
and their normal keys when tapped. In addition, ESC and TAB are also set as Ctrl and ALT respectively when held,
-and Enter/ALT on the right thumb key for all layers.
+and Enter/ALT on the right thumb key for all alpha layers.
I've enabled persistent keymaps for Qwerty, Dvorak and Colemak layers, similar to the default Planck layouts.
@@ -44,7 +44,7 @@ Control.
| Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | ' | \ |
`----------------------------------' `----------------------------------'
-### Keymap 2: Colemak layer
+### Layer 2: Colemak layer
,----------------------------------. ,----------------------------------.
| Q | W | F | P | G | | J | L | U | Y | L |
@@ -56,7 +56,7 @@ Control.
| Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | ' | \ |
`----------------------------------' `----------------------------------'
-### Keymap 3: Dvorak for Mac layout
+### Layer 3: Dvorak for Mac layer
,----------------------------------. ,----------------------------------.
| ' | , | . | P | Y | | F | G | C | R | L |
@@ -68,7 +68,7 @@ Control.
| Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | / | \ |
`----------------------------------' `----------------------------------'
-### Keymap 4: LOWER layer
+### Layer 4: LOWER layer
,----------------------------------. ,----------------------------------.
| ! | @ | # | $ | % | | ^ | & | * | ( | ) |
@@ -81,7 +81,7 @@ Control.
`----------------------------------' `----------------------------------'
-### Keymap 5: RAISE layer
+### Layer 5: RAISE layer
,----------------------------------. ,----------------------------------.
| 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 |
@@ -93,7 +93,7 @@ Control.
| ` | | | | Del |------'`------| Ins | | | | |
`----------------------------------' `----------------------------------'
-### Keymap 6: ADJUST layer
+### Layer 6: ADJUST layer
,----------------------------------. ,----------------------------------.
| F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 |