aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSönke Hahn <soenkehahn@gmail.com>2020-10-17 15:09:03 -0400
committerGitHub <noreply@github.com>2020-10-17 12:09:03 -0700
commitde0153f339a1be8436211bec59f389cedb7b755e (patch)
treeb5d6e57d3c5eb4fd60d2ae468a1178d511c6bc78
parent3633330e1ade1eaf84ddd621f38a6b771eaafad3 (diff)
downloadqmk_firmware-de0153f339a1be8436211bec59f389cedb7b755e.tar.gz
qmk_firmware-de0153f339a1be8436211bec59f389cedb7b755e.zip
[Keymap] moonlander:shahn-neo (#10667)
* basic keys working * more stuff * more stuff * empty upper layers * more stuff * cleanup * more stuff * add the letter 'j' * add '0' to layer 4 * implement umlauts and eszett with menu key as compose key * add comment * renamed layout * change copyright notice * add separate readme file
-rw-r--r--keyboards/moonlander/keymaps/shahn-neo/config.h19
-rw-r--r--keyboards/moonlander/keymaps/shahn-neo/keymap.c121
-rw-r--r--keyboards/moonlander/keymaps/shahn-neo/readme.md16
3 files changed, 156 insertions, 0 deletions
diff --git a/keyboards/moonlander/keymaps/shahn-neo/config.h b/keyboards/moonlander/keymaps/shahn-neo/config.h
new file mode 100644
index 000000000..1fbac3251
--- /dev/null
+++ b/keyboards/moonlander/keymaps/shahn-neo/config.h
@@ -0,0 +1,19 @@
1/* Copyright 2020 Sönke Hahn <SoenkeHahn@gmail.com>
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18
19#define ORYX_CONFIGURATOR
diff --git a/keyboards/moonlander/keymaps/shahn-neo/keymap.c b/keyboards/moonlander/keymaps/shahn-neo/keymap.c
new file mode 100644
index 000000000..27ccdbb62
--- /dev/null
+++ b/keyboards/moonlander/keymaps/shahn-neo/keymap.c
@@ -0,0 +1,121 @@
1/* Copyright 2020 Sönke Hahn <SoenkeHahn@gmail.com>
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include QMK_KEYBOARD_H
18#include "version.h"
19
20enum layers {
21 BASE, // default layer
22 L_3,
23 L_4,
24};
25
26enum custom_keycodes {
27 a_umlaut = ML_SAFE_RANGE,
28 o_umlaut,
29 u_umlaut,
30 eszett,
31};
32
33// clang-format off
34const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
35 [BASE] = LAYOUT_moonlander(
36 XXXXXXX, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , XXXXXXX, XXXXXXX, KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , XXXXXXX,
37 KC_TAB , KC_X , KC_V , KC_L , KC_C , KC_W , XXXXXXX, XXXXXXX, KC_K , KC_H , KC_G , KC_F , KC_Q , eszett ,
38 XXXXXXX, KC_U , KC_I , KC_A , KC_E , KC_O , XXXXXXX, XXXXXXX, KC_S , KC_N , KC_R , KC_T , KC_D , KC_Y ,
39 XXXXXXX, u_umlaut, o_umlaut, a_umlaut, KC_P , KC_Z , KC_B , KC_M , KC_COMM, KC_DOT , KC_J , XXXXXXX,
40 XXXXXXX, XXXXXXX , XXXXXXX , KC_LGUI , MO(L_4), XXXXXXX, XXXXXXX, MO(L_4), KC_RGUI, XXXXXXX, XXXXXXX, XXXXXXX,
41 KC_LCTL, KC_LSFT, MO(L_3), MO(L_3), KC_RSFT, KC_SPC
42 ),
43
44 [L_3] = LAYOUT_moonlander(
45 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
46 XXXXXXX, XXXXXXX, KC_UNDS, KC_LBRC, KC_RBRC, KC_CIRC, XXXXXXX, XXXXXXX, KC_EXLM, KC_LABK, KC_RABK, KC_EQL , KC_AMPR, XXXXXXX,
47 XXXXXXX, KC_BSLS, KC_SLSH, KC_LCBR, KC_RCBR, KC_ASTR, XXXXXXX, XXXXXXX, KC_QUES, KC_LPRN, KC_RPRN, KC_MINS, KC_COLN, KC_AT ,
48 XXXXXXX, KC_HASH, KC_DLR , KC_PIPE, KC_TILD, KC_GRV , KC_PLUS, KC_PERC, KC_DQUO, KC_QUOT, KC_SCLN, XXXXXXX,
49 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
50 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
51 ),
52
53 [L_4] = LAYOUT_moonlander(
54 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
55 XXXXXXX, KC_PGUP, KC_BSPC, KC_UP , KC_DEL , KC_PGDN, XXXXXXX, XXXXXXX, XXXXXXX, KC_7 , KC_8 , KC_9 , XXXXXXX, XXXXXXX,
56 XXXXXXX, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END , XXXXXXX, XXXXXXX, XXXXXXX, KC_4 , KC_5 , KC_6 , XXXXXXX, XXXXXXX,
57 XXXXXXX, KC_ESC , KC_TAB , XXXXXXX, KC_ENT , XXXXXXX, XXXXXXX, KC_1 , KC_2 , KC_3 , XXXXXXX, XXXXXXX,
58 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
59 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_0
60 ),
61};
62
63layer_state_t layer_state_set_user(layer_state_t state) {
64 ML_LED_1(false);
65 ML_LED_2(false);
66 ML_LED_3(false);
67 ML_LED_4(false);
68 ML_LED_5(false);
69 ML_LED_6(false);
70
71 switch (get_highest_layer(state)) {
72 case 1:
73 ML_LED_1(1);
74 ML_LED_4(1);
75 break;
76 case 2:
77 ML_LED_2(1);
78 ML_LED_5(1);
79 break;
80 case 3:
81 ML_LED_3(1);
82 break;
83 case 4:
84 ML_LED_4(1);
85 break;
86 case 5:
87 ML_LED_5(1);
88 break;
89 case 6:
90 ML_LED_6(1);
91 break;
92 default:
93 break;
94 }
95
96 return state;
97}
98
99// only works after executing
100// $ xmodmap -e "keycode 138 = Multi_key"
101#define compose_key SS_TAP(X_MENU)
102
103bool process_record_user(uint16_t keycode, keyrecord_t *record) {
104 if (record->event.pressed) {
105 switch (keycode) {
106 case a_umlaut:
107 SEND_STRING(compose_key "\"a");
108 return false;
109 case o_umlaut:
110 SEND_STRING(compose_key "\"o");
111 return false;
112 case u_umlaut:
113 SEND_STRING(compose_key "\"u");
114 return false;
115 case eszett:
116 SEND_STRING(compose_key "ss");
117 return false;
118 }
119 }
120 return true;
121}
diff --git a/keyboards/moonlander/keymaps/shahn-neo/readme.md b/keyboards/moonlander/keymaps/shahn-neo/readme.md
new file mode 100644
index 000000000..d2c9c8874
--- /dev/null
+++ b/keyboards/moonlander/keymaps/shahn-neo/readme.md
@@ -0,0 +1,16 @@
1# Sönke Hahn's Neo layout for the Moonlander keyboard
2
3This is my personal keyboard layout based on the Neo keyboard layout:
4https://en.wikipedia.org/wiki/Neo_(keyboard_layout)
5This layout is not meant as a general layout for other people using the
6Neo keyboard layout. It's very specific to my personal needs.
7It still might be useful as inspiration to other people who want to
8create a Neo layout.
9
10Some notes:
11
12- I've put the ctrl key, the shift keys and the modifiers to switch to
13 layer 4 in the middle to be operated by the thumbs. I wanted to avoid
14 having to use my pinkies on the outer rows of the keyboard.
15- The umlauts (äöü) and the ß only work on linux when configuring the
16 compose key properly. See `compose_key` in `./keymap.c`.