aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian L Lange <p3lim@users.noreply.github.com>2021-07-20 03:48:00 +0200
committerGitHub <noreply@github.com>2021-07-19 18:48:00 -0700
commit1105f2eb47e79a7a4ce8d31dd1f6d7b09afccb2d (patch)
treee5bf00139c6865f3b3098351f7cf1dce9d48979d
parent5ee5280fa1e1c73a283f1939b1abe898dfac0300 (diff)
downloadqmk_firmware-1105f2eb47e79a7a4ce8d31dd1f6d7b09afccb2d.tar.gz
qmk_firmware-1105f2eb47e79a7a4ce8d31dd1f6d7b09afccb2d.zip
[Keymap] Update bface p3lim keymap (#13582)
-rw-r--r--keyboards/winkeyless/bface/keymaps/p3lim/README.md13
-rw-r--r--keyboards/winkeyless/bface/keymaps/p3lim/keymap.c86
-rw-r--r--keyboards/winkeyless/bface/keymaps/p3lim/rules.mk1
3 files changed, 70 insertions, 30 deletions
diff --git a/keyboards/winkeyless/bface/keymaps/p3lim/README.md b/keyboards/winkeyless/bface/keymaps/p3lim/README.md
index 81f99ec96..94e84e7f2 100644
--- a/keyboards/winkeyless/bface/keymaps/p3lim/README.md
+++ b/keyboards/winkeyless/bface/keymaps/p3lim/README.md
@@ -2,13 +2,20 @@
2 2
3![](https://user-images.githubusercontent.com/26496/61170794-bf8a2c80-a56e-11e9-893f-f1766e7a9a04.png) 3![](https://user-images.githubusercontent.com/26496/61170794-bf8a2c80-a56e-11e9-893f-f1766e7a9a04.png)
4 4
5My layout using the winkeyless b.face X2 PCB. The keys indicated with a gray color was not supported by the layout so a custom one was made. 5My layout using the winkeyless b.face X2 PCB.
6 6
7### Building & Flashing 7### Building & Flashing
8 8
9- Hold <kbd>LCTRL</kbd> while connecting to put in flashing mode 9- Set up QMK
10- Follow instructions in the main _bface_ directory 10 - `pip install --user qmk`
11 - `qmk setup`
12- Add udev rules if on Linux
13 - Follow the docs: <https://docs.qmk.fm/#/faq_build?id=linux-udev-rules>
14- Build and flash
15 - `qmk flash -kb winkeyless/bface -km p3lim`
16- Hold bottom-left key while connecting to put in flashing mode
11 17
12### Layout notes 18### Layout notes
13 19
20The keys indicated with a gray color in the image above was not supported by the layout so a custom matrix was made.
14The two additional keys were on pins 22+41 and 22+42, C3+B1 and C3+B2, which is mapped to col 10 row 1 and col 10 row 2 in the matrix. 21The two additional keys were on pins 22+41 and 22+42, C3+B1 and C3+B2, which is mapped to col 10 row 1 and col 10 row 2 in the matrix.
diff --git a/keyboards/winkeyless/bface/keymaps/p3lim/keymap.c b/keyboards/winkeyless/bface/keymaps/p3lim/keymap.c
index 0ec124529..f702810f9 100644
--- a/keyboards/winkeyless/bface/keymaps/p3lim/keymap.c
+++ b/keyboards/winkeyless/bface/keymaps/p3lim/keymap.c
@@ -1,5 +1,5 @@
1/* 1/*
2Copyright 2019 Adrian L Lange <legal@p3lim.net> 2Copyright 2019-2021 Adrian L Lange <legal@p3lim.net>
3 3
4This program is free software: you can redistribute it and/or modify 4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by 5it under the terms of the GNU General Public License as published by
@@ -16,7 +16,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17 17
18#include QMK_KEYBOARD_H 18#include QMK_KEYBOARD_H
19#include "quantum.h"
20 19
21#define LAYOUT_p3lim(\ 20#define LAYOUT_p3lim(\
22 K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, \ 21 K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, \
@@ -37,13 +36,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
37 36
38enum my_keycodes { 37enum my_keycodes {
39 C_ESC0 = SAFE_RANGE, // layer 0 esc 38 C_ESC0 = SAFE_RANGE, // layer 0 esc
40 C_ESC1 // layer 1 esc 39 C_ESC1, // layer 1 esc
40 C_NO1, // æ, requires RCTL to be a compose key in software
41 C_NO2, // ø, requires RCTL to be a compose key in software
42 C_NO3 // å, requires RCTL to be a compose key in software
41}; 43};
42 44
43// use compiler macros for simpler stuff 45// use compiler macros for simpler stuff
44#define C_NO1 RALT(KC_QUOT)
45#define C_NO2 RALT(KC_SCLN)
46#define C_NO3 RALT(KC_LBRC)
47#define C_KVM1 LCA(KC_1) 46#define C_KVM1 LCA(KC_1)
48#define C_KVM2 LCA(KC_2) 47#define C_KVM2 LCA(KC_2)
49#define C_KVM3 LCA(KC_3) 48#define C_KVM3 LCA(KC_3)
@@ -77,7 +76,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
77 * |-----------------------------------------------------------------------------------------+ 76 * |-----------------------------------------------------------------------------------------+
78 * | Caps | Home| Up | End | PgUp| | | | | | | | | | 77 * | Caps | Home| Up | End | PgUp| | | | | | | | | |
79 * |---------------------------------------------------------------------------------| | 78 * |---------------------------------------------------------------------------------| |
80 * | | Left| Down|Right| PgDn| | | | | | | | | | 79 * | | Left| Down|Right| PgDn|PrtSc| | | | | | | | |
81 * |-----------------------------------------------------------------------------------------+ 80 * |-----------------------------------------------------------------------------------------+
82 * | | KVM1| KVM2| KVM3| KVM4| | | | | | | | | 81 * | | KVM1| KVM2| KVM3| KVM4| | | | | | | | |
83 * |-----------------------------------------------------------------------------------------+ 82 * |-----------------------------------------------------------------------------------------+
@@ -87,7 +86,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
87 [1] = LAYOUT_p3lim( 86 [1] = LAYOUT_p3lim(
88 C_ESC1, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, 87 C_ESC1, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,
89 KC_CAPS, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, _______, _______, _______, _______, _______, _______, _______, 88 KC_CAPS, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, _______, _______, _______, _______, _______, _______, _______,
90 _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, _______, _______, _______, _______, _______, _______, _______, 89 _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_PSCR, _______, _______, _______, _______, _______, _______, _______, _______,
91 _______, C_KVM1, C_KVM2, C_KVM3, C_KVM4, _______, _______, _______, _______, _______, _______, _______, _______, 90 _______, C_KVM1, C_KVM2, C_KVM3, C_KVM4, _______, _______, _______, _______, _______, _______, _______, _______,
92 _______, _______, _______, _______, KC_NO, _______, _______ 91 _______, _______, _______, _______, KC_NO, _______, _______
93 ), 92 ),
@@ -123,32 +122,65 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
123 */ 122 */
124}; 123};
125 124
125static bool grave_esc_shifted = false;
126
126bool process_record_user(uint16_t keycode, keyrecord_t *record){ 127bool process_record_user(uint16_t keycode, keyrecord_t *record){
128 const uint8_t mods = get_mods();
129 uint8_t shifted = mods & MOD_MASK_SHIFT;
130
127 switch(keycode){ 131 switch(keycode){
128 case C_ESC0: // layer 0 132 case C_ESC0: // layer 0
129 if(record->event.pressed){ 133 if(record->event.pressed){
130 if(get_mods() & MOD_MASK_SHIFT) 134 grave_esc_shifted = shifted;
131 register_code(KC_GRAVE); 135 register_code(shifted ? KC_GRAVE : KC_ESCAPE);
132 else 136 } else
133 register_code(KC_ESCAPE); 137 unregister_code(grave_esc_shifted ? KC_GRAVE : KC_ESCAPE);
134 } else {
135 if(get_mods() & MOD_MASK_SHIFT)
136 unregister_code(KC_GRAVE);
137 else
138 unregister_code(KC_ESCAPE);
139 }
140 return false; 138 return false;
141 case C_ESC1: // layer 1 139 case C_ESC1: // layer 1
142 if(record->event.pressed){ 140 if(record->event.pressed){
143 if(get_mods() & MOD_MASK_SHIFT) 141 grave_esc_shifted = shifted;
144 register_code(KC_ESCAPE); 142 register_code(shifted ? KC_ESCAPE : KC_GRAVE);
145 else 143 } else
146 register_code(KC_GRAVE); 144 unregister_code(grave_esc_shifted ? KC_ESCAPE : KC_GRAVE);
147 } else { 145 return false;
148 if(get_mods() & MOD_MASK_SHIFT) 146 case C_NO1: // æ
149 unregister_code(KC_ESCAPE); 147 if(record->event.pressed){
150 else 148 // we use shift for A and E to make it capitalized, no need to handle it here
151 unregister_code(KC_GRAVE); 149 tap_code(KC_RCTL);
150 tap_code(KC_A);
151 tap_code(KC_E);
152 }
153 return false;
154 case C_NO2: // ø
155 // the "/" symbol can't be shifted, so we have to deal with that
156 if(record->event.pressed){
157 if(shifted){
158 unregister_code(KC_LSFT); // reset the shift state, I always use LSFT personally
159 tap_code(KC_RCTL);
160 tap_code(KC_SLSH);
161 tap_code16(S(KC_O));
162 register_code(KC_LSFT); // enable the shift state again to keep state consistent
163 } else {
164 tap_code(KC_RCTL);
165 tap_code(KC_SLSH);
166 tap_code(KC_O);
167 }
168 }
169 return false;
170 case C_NO3: // å
171 // the "o" symbol can't be shifted, so we have to deal with that
172 if(record->event.pressed){
173 if(shifted){
174 unregister_code(KC_LSFT); // reset the shift state, I always use LSFT personally
175 tap_code(KC_RCTL);
176 tap_code(KC_O);
177 tap_code16(S(KC_A));
178 register_code(KC_LSFT); // enable the shift state again to keep state consistent
179 } else {
180 tap_code(KC_RCTL);
181 tap_code(KC_O);
182 tap_code(KC_A);
183 }
152 } 184 }
153 return false; 185 return false;
154 } 186 }
diff --git a/keyboards/winkeyless/bface/keymaps/p3lim/rules.mk b/keyboards/winkeyless/bface/keymaps/p3lim/rules.mk
new file mode 100644
index 000000000..e0ed6f0c2
--- /dev/null
+++ b/keyboards/winkeyless/bface/keymaps/p3lim/rules.mk
@@ -0,0 +1 @@
RGBLIGHT_ENABLE = no