summaryrefslogtreecommitdiff
path: root/keyboards/helix/rev2/keymaps/five_rows/keymap.c
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2022-05-18 17:33:52 +0000
committerQMK Bot <hello@qmk.fm>2022-05-18 17:33:52 +0000
commit3904a6afbe41e35c231dc449e3e2fa839d7b35a9 (patch)
treee8df23b2fd6eb582c0f71e077b349d32557487cc /keyboards/helix/rev2/keymaps/five_rows/keymap.c
parent6503987c84994b2c6b5229db8b91c14d8bd11e41 (diff)
parent33d568e29b454e5ead83b9e7216bd807549cc9b6 (diff)
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'keyboards/helix/rev2/keymaps/five_rows/keymap.c')
-rw-r--r--keyboards/helix/rev2/keymaps/five_rows/keymap.c93
1 files changed, 60 insertions, 33 deletions
diff --git a/keyboards/helix/rev2/keymaps/five_rows/keymap.c b/keyboards/helix/rev2/keymaps/five_rows/keymap.c
index 2b3f6233c1..d992425de7 100644
--- a/keyboards/helix/rev2/keymaps/five_rows/keymap.c
+++ b/keyboards/helix/rev2/keymaps/five_rows/keymap.c
@@ -16,7 +16,54 @@
#include QMK_KEYBOARD_H
-#include "layer_number.h"
+#include "key_blocks.h"
+#include "layer_number_util.h"
+
+#ifdef ENABLE_COLEMAK
+# define COLEMAK_Colemak (COLEMAK, " Colemak"),
+#else
+# define COLEMAK_Colemak
+#endif
+#ifdef ENABLE_DVORAK
+# define DVORAK_Dvorak (DVORAK, " Dvorak"),
+#else
+# define DVORAK_Dvorak
+#endif
+#ifdef ENABLE_EUCALYN
+# define EUCALYN_Eucalyn (EUCALYN, " Eucalyn"),
+#else
+# define EUCALYN_Eucalyn
+#endif
+
+#define LAYER_NAME_LIST \
+ (QWERTY, " Qwerty"), \
+ COLEMAK_Colemak \
+ DVORAK_Dvorak \
+ EUCALYN_Eucalyn \
+ (KEYPAD, " Keypad"), \
+ (AUX, ":AUX"), \
+ (KAUX, ":00"), \
+ (LOWER, ":Func"), \
+ (RAISE, ":Extra"), \
+ (PADFUNC, ":PadFunc"), \
+ (ADJUST, ":Adjust")
+
+enum layer_number {
+ // _QWERTY, _COLEMAK, ...
+ MAP(BUILD_LAYER_ENUM_NUMBER, LAYER_NAME_LIST)
+};
+
+#ifdef OLED_ENABLE
+// static const char QWERTY_name[] PROGMEM = " Qwerty"; ...
+MAP(BUILD_LAYER_NAME_STR, LAYER_NAME_LIST)
+
+const char *layer_names[] = {
+ // [_QWERTY] = QWERTY_name, ...
+ MAP(BUILD_LAYER_NAME_TABLE, LAYER_NAME_LIST)
+};
+#endif
+
+const size_t num_of_layer_names = GET_ITEM_COUNT(LAYER_NAME_LIST);
extern keymap_config_t keymap_config;
@@ -44,8 +91,6 @@ enum custom_keycodes {
#define ____ _______
#define KC_ADJ MO(_ADJUST)
-#define _1_____2_____3_____4_____5 KC_1, KC_2, KC_3, KC_4, KC_5
-#define _6_____7_____8_____9_____0 KC_6, KC_7, KC_8, KC_9, KC_0
#define LOWER__LOWER__CAPS__LALT__LGUI__SPC__RABS \
KC_LOWER, KC_LOWER, KC_CAPS, KC_LALT, KC_LGUI, KC_SPC, LT(_RAISE,KC_BSPC)
#define RAEN___SPC___RGUI__RALT__APP___LOWER__LOWER \
@@ -56,12 +101,6 @@ enum custom_keycodes {
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty */
-#define Q_____W_____E_____R_____T KC_Q, KC_W, KC_E, KC_R, KC_T
-#define Y_____U_____I_____O_____P KC_Y, KC_U, KC_I, KC_O, KC_P
-#define A_____S_____D_____F_____G KC_A, KC_S, KC_D, KC_F, KC_G
-#define H_____J_____K_____L____SCLN KC_H, KC_J, KC_K, KC_L, KC_SCLN
-#define Z_____X_____C_____V_____B KC_Z, KC_X, KC_C, KC_V, KC_B
-#define N_____M____COMM__DOT___SLSH KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH
/* ,-----------------------------------. ,-----------------------------------.
* | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BS |
* |-----+-----+-----+-----+-----+-----| |-----+-----+-----+-----+-----+-----|
@@ -83,12 +122,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
/* Colemak */
-#define Q_____W_____F_____P_____G KC_Q, KC_W, KC_F, KC_P, KC_G
-#define J_____L_____U_____Y____SCLN KC_J, KC_L, KC_U, KC_Y, KC_SCLN
-#define A_____R_____S_____T_____D KC_A, KC_R, KC_S, KC_T, KC_D
-#define H_____N_____E_____I_____O KC_H, KC_N, KC_E, KC_I, KC_O
-#define Z_____X_____C_____V_____B KC_Z, KC_X, KC_C, KC_V, KC_B
-#define K_____M____COMM__DOT___SLSH KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH
/* ,-----------------------------------. ,-----------------------------------.
* | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BS |
* |-----+-----+-----+-----+-----+-----| |-----+-----+-----+-----+-----+-----|
@@ -101,6 +134,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |Lower|Lower|Caps | Alt | GUI |Space| BS |Enter|Space| GUI | Alt |Menu |Lower|Lower|
* `-----------------------------------------------------------------------------------'
*/
+#ifdef ENABLE_COLEMAK
[_COLEMAK] = LAYOUT_wrapper(
KC_ESC, _1_____2_____3_____4_____5, _6_____7_____8_____9_____0, KC_BSPC,
KC_TAB, Q_____W_____F_____P_____G, J_____L_____U_____Y____SCLN, KC_BSLS,
@@ -108,14 +142,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LSFT, Z_____X_____C_____V_____B, GRV__QUOT, K_____M____COMM__DOT___SLSH, KC_RSFT,
LOWER__LOWER__CAPS__LALT__LGUI__SPC__RABS, RAEN___SPC___RGUI__RALT__APP___LOWER__LOWER
),
+#endif
/* Dvorak */
-#define QUOT_COMM___DOT____P_____Y KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y
-#define F_____G_____C_____R_____L KC_F, KC_G, KC_C, KC_R, KC_L
-#define A_____O_____E_____U_____I KC_A, KC_O, KC_E, KC_U, KC_I
-#define D_____H_____T_____N_____S KC_D, KC_H, KC_T, KC_N, KC_S
-#define SCLN___Q_____J_____K_____X KC_SCLN, KC_Q, KC_J, KC_K, KC_X
-#define B_____M_____W_____V_____Z KC_B, KC_M, KC_W, KC_V, KC_Z
#define GRV__SLSH KC_GRV, KC_SLSH
/* ,-----------------------------------. ,-----------------------------------.
* | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BS |
@@ -129,6 +158,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |Lower|Lower|Caps | Alt | GUI |Space| BS |Enter|Space| GUI | Alt |Menu |Lower|Lower|
* `-----------------------------------------------------------------------------------'
*/
+#ifdef ENABLE_DVORAK
[_DVORAK] = LAYOUT_wrapper(
KC_ESC, _1_____2_____3_____4_____5, _6_____7_____8_____9_____0, KC_BSPC,
KC_TAB, QUOT_COMM___DOT____P_____Y, F_____G_____C_____R_____L, KC_BSLS,
@@ -136,14 +166,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LSFT, SCLN___Q_____J_____K_____X, GRV__SLSH, B_____M_____W_____V_____Z, KC_RSFT,
LOWER__LOWER__CAPS__LALT__LGUI__SPC__RABS, RAEN___SPC___RGUI__RALT__APP___LOWER__LOWER
),
+#endif
/* Eucalyn (http://eucalyn.hatenadiary.jp/entry/about-eucalyn-layout) */
-#define Q_____W___COMM___DOT__SCLN KC_Q, KC_W, KC_COMM, KC_DOT, KC_SCLN
-#define M_____R_____D_____Y_____P KC_M, KC_R, KC_D, KC_Y, KC_P
-#define A_____O_____E_____I_____U KC_A, KC_O, KC_E, KC_I, KC_U
-#define G_____T_____K_____S_____N KC_G, KC_T, KC_K, KC_S, KC_N
-#define Z_____X_____C_____V_____F KC_Z, KC_X, KC_C, KC_V, KC_F
-#define B_____H_____J_____L____SLSH KC_B, KC_H, KC_J, KC_L, KC_SLSH
/* ,-----------------------------------. ,-----------------------------------.
* | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BS |
* |-----+-----+-----+-----+-----+-----| |-----+-----+-----+-----+-----+-----|
@@ -156,6 +181,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |Lower|Lower|Caps | Alt | GUI |Space| BS |Enter|Space| GUI | Alt |Menu |Lower|Lower|
* `-----------------------------------------------------------------------------------'
*/
+#ifdef ENABLE_EUCALYN
[_EUCALYN] = LAYOUT_wrapper(
KC_ESC, _1_____2_____3_____4_____5, _6_____7_____8_____9_____0, KC_BSPC,
KC_TAB, Q_____W___COMM___DOT__SCLN, M_____R_____D_____Y_____P, KC_BSLS,
@@ -163,6 +189,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LSFT, Z_____X_____C_____V_____F, GRV__QUOT, B_____H_____J_____L____SLSH, KC_RSFT,
LOWER__LOWER__CAPS__LALT__LGUI__SPC__RABS, RAEN___SPC___RGUI__RALT__APP___LOWER__LOWER
),
+#endif
/* Keypad */
#define KP_TAB__PSLS_PAST KC_TAB, KC_PSLS, KC_PAST
@@ -246,8 +273,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
/* Lower */
-#define F1____F2____F3____F4____F5 KC_F1, KC_F2, KC_F3, KC_F4, KC_F5
-#define F6____F7____F8____F9____F10 KC_F6, KC_F7, KC_F8, KC_F9, KC_F10
#define XXXX__PAUS__SLCK___INS XXXX, KC_PAUS, KC_SLCK, KC_INS
#define XXXX___INS__SLCK__PAUS__XXXX XXXX, KC_INS, KC_SLCK, KC_PAUS, XXXX
#define ADJ___ADJ KC_ADJ, KC_ADJ
@@ -383,21 +408,27 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return false;
break;
case COLEMAK:
+#ifdef ENABLE_COLEMAK
if (record->event.pressed) {
update_base_layer(_COLEMAK);
}
+#endif
return false;
break;
case DVORAK:
+#ifdef ENABLE_DVORAK
if (record->event.pressed) {
update_base_layer(_DVORAK);
}
+#endif
return false;
break;
case EUCALYN:
+#ifdef ENABLE_EUCALYN
if (record->event.pressed) {
update_base_layer(_EUCALYN);
}
+#endif
return false;
break;
case KEYPAD:
@@ -447,7 +478,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
return true;
}
-
-void matrix_init_user(void) {
- INIT_HELIX_OLED(); /* define in layer_number.h */
-}