2 Copyright 2016 Julien Pecqueur <julien@peclu.net>
3 Copyright 2016 Felix Uhl <ifreilicht@gmail.com>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
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/>.
17 #include QMK_KEYBOARD_H
19 #define ONESHOT_TAP_TOGGLE 2
20 #define ONESHOT_TIMEOUT 1
22 //uncomment to activate dead keys
23 //#define DONT_REVIVE_DEADKEYS 1
25 //Function keycodes for better readability
28 //GamingMode Lock (disables SpaceFn and OneShot LShift)
31 #define KC_SPACEFN KC_FN0
32 #define KC_OSLS KC_FN3
33 #define KC_GMLK KC_FN1
34 #define KC_FUNC KC_FN2
35 #define MICMUTE RCTL(KC_LCTL)
54 #define LANGUAGE GERMAN
56 enum custom_keycodes {
85 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
86 /* Layout 0: Default Layer
87 * ,-----------------------------------------------------------.
88 * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \|Del|
89 * |-----------------------------------------------------------|
90 * |Tab | Q| W| E| R| T| Z| U| I| O| P| [| ]|BckSp|
91 * |-----------------------------------------------------------|
92 * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return |
93 * |-----------------------------------------------------------|
94 * |Shift | Y| X| C| V| B| N| M| ,| .| /| Up |RSft|
95 * |-----------------------------------------------------------|
96 * |Fn2 |Gui |Alt | SpaceFn |Alt |Left|Down|Right|
97 * `-----------------------------------------------------------'
100 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_BSLS, KC_DEL, \
101 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Z, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \
102 KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \
103 KC_LSFT, KC_NUBS, KC_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_RSFT, \
104 KC_FUNC, KC_LGUI, KC_LALT, KC_SPACEFN, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT
107 /* Layout 1: Gaming Layer, SpaceFn disabled
108 * ,-----------------------------------------------------------.
109 * | | | | | | | | | | | | | | | |
110 * |-----------------------------------------------------------|
111 * | | | | | | | | | | | | | | |
112 * |-----------------------------------------------------------|
113 * | | | | | | | | | | | | | |
114 * |-----------------------------------------------------------|
115 * | | | | | | | | | | | | |Fn1 |
116 * |-----------------------------------------------------------|
117 * | |RSft| | Space | | | | |
118 * `-----------------------------------------------------------'
121 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
122 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
123 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
124 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_GMLK, \
125 _______, KC_RSFT, _______, KC_SPC, _______, _______, _______, _______
128 /* Layout 2: Function Layer
129 * MicMute requires special software to be installed. Check readme.md for more information
130 * ,-----------------------------------------------------------.
131 * |` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|RES|
132 * |-----------------------------------------------------------|
133 * | | | | |Prv|Ply|Nxt| � | | � | |Prt|Slk|Pau |
134 * |-----------------------------------------------------------|
135 * | | � | � | |Vl-|Mut|Vl+| | | | | |PEnt |
136 * |-----------------------------------------------------------|
137 * | | | | |MicMut|Cal| | | | |Pau |PUp |Fn1 |
138 * |-----------------------------------------------------------|
139 * | | | | | |Home|PDn |End |
140 * `-----------------------------------------------------------'
143 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_INS, RESET, \
144 _______, _______, KC_CM_W, KC_CM_E, KC_MPRV, KC_MPLY, KC_MNXT, KC_CM_U, KC_CM_I, KC_CM_O, KC_CM_P, KC_PSCR, KC_SLCK, KC_PAUS, \
145 _______, KC_CM_A, KC_CM_S, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, KC_CM_K, KC_CM_L, _______, _______, _______, KC_PENT, \
146 _______, _______, KC_CM_Y, _______, KC_CM_C, MICMUTE, KC_CALC, KC_CM_N, KC_CM_M, _______, _______, _______, KC_PGUP, KC_GMLK, \
147 _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END
152 * Fn action definition
154 const uint16_t PROGMEM fn_actions[] = {
155 [F_SPACEFN] = ACTION_LAYER_TAP_KEY(2, KC_SPACE), // SpaceFn layout 1
156 [F_GMLK] = ACTION_LAYER_TOGGLE(1), // Disable SpaceFn and Oneshot Shift
157 [F_FUNC] = ACTION_LAYER_MOMENTARY(2), // SpaceFn layout 1
158 [F_OSLS] = ACTION_MODS_ONESHOT(MOD_LSFT) // Oneshot Leftshift
161 void matrix_init_user(void) {
165 void matrix_scan_user(void) {
169 bool process_german(uint16_t keycode, keyrecord_t *record) {
170 uint16_t send_code = 0;
171 if (record->event.pressed) {
187 if (send_code == 0) {
191 register_code(KC_RALT);
192 register_code(send_code);
193 unregister_code(send_code);
194 unregister_code(KC_RALT);
201 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
203 #ifndef DONT_REVIVE_DEADKEYS
204 bool shift_active = keyboard_report->mods & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_LSFT));
205 bool altgr_active = keyboard_report->mods & (MOD_BIT(KC_RALT));
206 if ((keycode == KC_QUOT && !altgr_active) ||
208 (keycode == KC_6 && shift_active))
210 if (record->event.pressed) {
211 register_code(keycode);
212 unregister_code(keycode);
213 register_code(KC_SPACE);
214 unregister_code(KC_SPACE);
219 #if LANGUAGE == GERMAN
220 return process_german(keycode, record);
226 void led_set_user(uint8_t usb_led) {