aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy <andys8@users.noreply.github.com>2018-04-28 17:57:53 +0200
committerDrashna Jaelre <drashna@live.com>2018-04-28 08:57:53 -0700
commit19aa2c34e859946edae24108fe7df69c949b124e (patch)
tree92989722f2a76b83829afeb3e9bf05f305e3075c
parent6f37bd6678d6e27251647f1bea6d7746bdf7c79d (diff)
downloadqmk_firmware-19aa2c34e859946edae24108fe7df69c949b124e.tar.gz
qmk_firmware-19aa2c34e859946edae24108fe7df69c949b124e.zip
Add dz60 iso layout with vim-style arrows (#2837)
-rw-r--r--keyboards/dz60/keymaps/iso_vim_arrow/README.md6
-rw-r--r--keyboards/dz60/keymaps/iso_vim_arrow/keymap.c68
-rw-r--r--keyboards/dz60/keymaps/iso_vim_arrow/rules.mk15
3 files changed, 89 insertions, 0 deletions
diff --git a/keyboards/dz60/keymaps/iso_vim_arrow/README.md b/keyboards/dz60/keymaps/iso_vim_arrow/README.md
new file mode 100644
index 000000000..7e4ea7e6c
--- /dev/null
+++ b/keyboards/dz60/keymaps/iso_vim_arrow/README.md
@@ -0,0 +1,6 @@
1# ISO layout with VIM style arrow cluster
2
3This layout is ISO-DE and similar to a standard 60 ISO layout. There are vim style arrow keys on the function layer and in the bottom right corner of the main layer.
4
5![Layout](https://i.imgur.com/Wu8VT43.png)
6
diff --git a/keyboards/dz60/keymaps/iso_vim_arrow/keymap.c b/keyboards/dz60/keymaps/iso_vim_arrow/keymap.c
new file mode 100644
index 000000000..4cdb50560
--- /dev/null
+++ b/keyboards/dz60/keymaps/iso_vim_arrow/keymap.c
@@ -0,0 +1,68 @@
1#include QMK_KEYBOARD_H
2
3#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
4
5const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
6/* ISO VIM arrow
7* ,-----------------------------------------------------------------------------------------.
8* | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ß | ´ | BSPC |
9* |-----------------------------------------------------------------------------------------+
10* | Tab | Q | W | E | R | T | Z | U | I | O | P | P | Ü | * | |
11* |-------------------------------------------------------------------------------------| +
12* | Layer_1 | A | S | D | F | G | H | J | K | L | Ö | Ä | # |Enter |
13* |-----------------------------------------------------------------------------------------+
14* | Shift| < | Y | X | C | V | B | N | M | , | . | . | - | RShift |
15* |-----------------------------------------------------------------------------------------+
16* | LCtrl | LGUI | LAlt | Space | RAlt | Left | Down | Up | Right |
17* `-----------------------------------------------------------------------------------------'
18*/
19 LAYOUT(
20 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, KC_BSPC,
21 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
22 MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
23 KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_NO,
24 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT),
25
26
27 LAYOUT(
28 KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_DEL,
29 KC_NO, KC_NO, KC_NO, KC_NO, RESET, KC_NO, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_PSCR, KC_NO, KC_NO, KC_NO,
30 KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_END, KC_DEL, KC_NO,
31 KC_LSFT, BL_TOGG, KC_APP, KC_PAUS, KC_INS, KC_NO, KC_MPLY, KC_MSTP, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_RSFT, KC_NO,
32 KC_LCTL, KC_LGUI, KC_LALT, KC_BSPC, KC_BSPC, KC_BSPC, KC_DEL, KC_HOME, KC_PGDN, KC_PGUP, KC_END),
33
34};
35
36enum function_id {
37 SHIFT_ESC,
38};
39
40const uint16_t PROGMEM fn_actions[] = {
41 [0] = ACTION_FUNCTION(SHIFT_ESC),
42};
43
44void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
45 static uint8_t shift_esc_shift_mask;
46 switch (id) {
47 case SHIFT_ESC:
48 shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK;
49 if (record->event.pressed) {
50 if (shift_esc_shift_mask) {
51 add_key(KC_GRV);
52 send_keyboard_report();
53 } else {
54 add_key(KC_ESC);
55 send_keyboard_report();
56 }
57 } else {
58 if (shift_esc_shift_mask) {
59 del_key(KC_GRV);
60 send_keyboard_report();
61 } else {
62 del_key(KC_ESC);
63 send_keyboard_report();
64 }
65 }
66 break;
67 }
68}
diff --git a/keyboards/dz60/keymaps/iso_vim_arrow/rules.mk b/keyboards/dz60/keymaps/iso_vim_arrow/rules.mk
new file mode 100644
index 000000000..b5f45d7aa
--- /dev/null
+++ b/keyboards/dz60/keymaps/iso_vim_arrow/rules.mk
@@ -0,0 +1,15 @@
1# Build Options
2# comment out to disable the options.
3#
4BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
5MOUSEKEY_ENABLE = no # Mouse keys(+4700)
6EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
7CONSOLE_ENABLE = no # Console for debug(+400)
8COMMAND_ENABLE = no # Commands for debug and configuration
9SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
10NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
11BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
12AUDIO_ENABLE = no
13RGBLIGHT_ENABLE = no
14AUTO_SHIFT_ENABLE = no # If the time depressed is greater than or equal to the AUTO_SHIFT_TIMEOUT, then a shifted version of the key is emitted. If the time is less than the AUTO_SHIFT_TIMEOUT time, then the normal state is emitted
15TAP_DANCE_ENABLE = no