aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoradiron <adi@adiron.me>2018-03-16 22:36:41 +0200
committerJack Humbert <jack.humb@gmail.com>2018-03-16 16:36:41 -0400
commit04d72590afac2b34641e668b2c8a9f18636764f3 (patch)
tree91f31acd8177123835c989f023dec06ef450dbc0
parent4dc3a01fcb4401c110e10e3e4015ced856dc7055 (diff)
downloadqmk_firmware-04d72590afac2b34641e668b2c8a9f18636764f3.tar.gz
qmk_firmware-04d72590afac2b34641e668b2c8a9f18636764f3.zip
New keymap for XD75re ("adi") (#2530)
* My XD75 keymap * Proper readme for `adi` keymap for xd75re
-rw-r--r--keyboards/xd75/keymaps/adi/config.h25
-rw-r--r--keyboards/xd75/keymaps/adi/keymap.c205
-rw-r--r--keyboards/xd75/keymaps/adi/readme.md21
-rw-r--r--keyboards/xd75/keymaps/adi/rules.mk18
4 files changed, 269 insertions, 0 deletions
diff --git a/keyboards/xd75/keymaps/adi/config.h b/keyboards/xd75/keymaps/adi/config.h
new file mode 100644
index 000000000..244c75c77
--- /dev/null
+++ b/keyboards/xd75/keymaps/adi/config.h
@@ -0,0 +1,25 @@
1/* Copyright 2017 REPLACE_WITH_YOUR_NAME
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#ifndef CONFIG_USER_H
18#define CONFIG_USER_H
19
20#include "../../config.h"
21
22// Disable backlight
23#undef BACKLIGHT_ENABLE
24
25#endif
diff --git a/keyboards/xd75/keymaps/adi/keymap.c b/keyboards/xd75/keymaps/adi/keymap.c
new file mode 100644
index 000000000..d96a21507
--- /dev/null
+++ b/keyboards/xd75/keymaps/adi/keymap.c
@@ -0,0 +1,205 @@
1/* Copyright 2017 REPLACE_WITH_YOUR_NAME
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#include "xd75.h"
17
18// Fillers to make layering more clear
19#define _______ KC_TRNS
20#define ___T___ KC_TRNS
21#define XXXXXXX KC_NO
22
23// Layer shorthand
24#define _QW 0
25#define _LW 1
26#define _RS 2
27#define _FN 3
28#define _ENTFN 4
29#define _MEDIA 5
30#define _MOUSE 6
31
32#define M_BACK 0
33#define M_FWRD 1
34#define M_PTAB 2
35#define M_NTAB 3
36#define M_ZOUT 4
37#define M_ZOIN 5
38#define M_ENTR 6
39#define M_SCRN 7
40#define M_NSPC 8
41#define M_PSPC 9
42
43const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
44
45 [_QW] = { /* QWERTY */
46 { KC_GRAVE,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_BSPC, KC_BSPC },
47 { 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, KC_INSERT },
48 { KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(_MOUSE, KC_SCLN), LT(_MEDIA, KC_QUOT), LT(_ENTFN, KC_ENT), LT(_ENTFN, KC_ENT), KC_PGUP },
49 { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, KC_PGDN },
50 { KC_LCTL, MO(_FN), KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), LT(_ENTFN, KC_ENT), KC_RGUI, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT },
51 },
52
53/* LOWERED
54 */
55
56 [_LW] = { /* LOWERED */
57 { _______, 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_DEL, KC_DEL },
58 { _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, _______, _______, KC_INS },
59 { _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, ___T___, ___T___, _______ },
60 { _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, ___T___, ___T___, KC_PGUP, _______ },
61 { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END },
62 },
63
64/* RAISED
65 */
66
67 [_RS] = { /* RAISED */
68 { _______, 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_DEL, KC_DEL },
69 { _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, KC_INS },
70 { _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, ___T___, ___T___, _______ },
71 { _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, ___T___, ___T___, KC_PGUP, _______ },
72 { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END },
73 },
74
75/* FUNCTION
76 */
77
78 [_FN] = { /* FUNCTION */
79 { RESET, 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_DEL, KC_DEL },
80 { KC_SLCK, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_PAUS, KC_PSCR },
81 { KC_CAPS, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, _______, _______, _______ },
82 { RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, BL_TOGG, BL_INC, BL_DEC, ___T___, ___T___, KC_PGUP, KC_WH_D },
83 { _______ , _______, AG_SWAP, AG_NORM, _______, KC_BTN1, KC_BTN1, _______, AG_NORM, AG_SWAP, _______, _______, KC_HOME, KC_PGDN, KC_END },
84 },
85
86 [_ENTFN] = { /* Enter FN */
87 { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
88 { _______, M(M_PTAB), M(M_NTAB), M(M_PSPC), M(M_NSPC), _______, _______, _______, _______, M(M_ZOUT), M(M_ZOIN), _______, _______, _______, _______ },
89 { _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, _______, _______, _______ },
90 { _______, M(M_BACK), M(M_FWRD), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
91 { _______ , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
92 },
93 [_MEDIA] = { /* Media */
94 { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
95 { _______, KC_SLCK, KC_PAUS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
96 { _______, KC_VOLU, _______, _______, _______, _______, _______, KC_MRWD, KC_MPLY, KC_MFFD, _______, _______, _______, _______, _______ },
97 { _______, KC_VOLD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
98 { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
99 },
100 [_MOUSE] = { /* Mouse */
101 { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
102 { _______, _______, _______, _______, _______, _______, _______, KC_BTN1, KC_BTN2, _______, _______, _______, _______, _______, _______ },
103 { _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, _______, _______, _______, _______, _______ },
104 { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
105 { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
106 },
107};
108
109const uint16_t PROGMEM fn_actions[] = {
110
111};
112
113const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
114{
115 // MACRODOWN only works in this function
116 keyevent_t event = record->event;
117
118 if (!eeconfig_is_enabled()) {
119 eeconfig_init();
120 }
121 bool use_cmd = true; // Use, for example, Cmd-Tab, Cmd-C, Cmd-V, etc.
122 // Compare to MAGIC_SWAP_ALT_GUI and MAGIC_UNSWAP_ALT_GUI configs, set in:
123 // quantum/quantum.c
124 if(keymap_config.swap_lalt_lgui == 1 && keymap_config.swap_ralt_rgui == 1) {
125 use_cmd = false; // ... or, Alt-Tab, Ctrl-C, Ctrl-V, etc.
126 }
127 switch(id) {
128 case M_BACK:
129 /* Command + [ or previous page */
130 if (use_cmd) {
131 return (event.pressed ? MACRO( D(LGUI), T(LBRC), U(LGUI), END ) : MACRO(END));
132 } else {
133 return (event.pressed ? MACRO( D(LALT), T(LEFT), U(LALT), END ) : MACRO(END));
134 }
135 case M_FWRD:
136 /* Command + ] or next page */
137 if (use_cmd) {
138 return (event.pressed ? MACRO( D(LGUI), T(RBRC), U(LGUI), END ) : MACRO(END));
139 } else {
140 return (event.pressed ? MACRO( D(LALT), T(RIGHT), U(LALT), END ) : MACRO(END));
141 }
142 case M_PTAB:
143 /* Command + { or prev tab. */
144 if (use_cmd) {
145 return (event.pressed ? MACRO( D(LGUI), D(RSFT), T(LBRC), U(RSFT), U(LGUI), END ) : MACRO(END));
146 } else {
147 return (event.pressed ? MACRO( D(LCTRL), D(RSFT), T(TAB), U(RSFT), U(LCTRL), END ) : MACRO(END));
148 }
149 case M_NTAB:
150 /* Command + } or next tab*/
151 if (use_cmd) {
152 return (event.pressed ? MACRO( D(LGUI), D(RSFT), T(RBRC), U(RSFT), U(LGUI), END ) : MACRO(END));
153 } else {
154 return (event.pressed ? MACRO( D(LCTRL), T(TAB), U(LCTRL), END ) : MACRO(END));
155 }
156 case M_ZOUT:
157 /* Command + - or Ctrl + -*/
158 if (use_cmd) {
159 return (event.pressed ? MACRO( D(LGUI), T(MINS), U(LGUI), END ) : MACRO(END));
160 } else {
161 return (event.pressed ? MACRO( D(LCTRL), T(MINS), U(LCTRL), END ) : MACRO(END));
162 }
163 break;
164 case M_ZOIN:
165 /* Command + = or Ctrl + =*/
166 if (use_cmd) {
167 return (event.pressed ? MACRO( D(LGUI), T(EQL), U(LGUI), END ) : MACRO(END));
168 } else {
169 return (event.pressed ? MACRO( D(LCTRL), T(EQL), U(LCTRL), END ) : MACRO(END));
170 }
171 break;
172 case M_ENTR:
173 /* Command + Enter or Ctrl + Enter*/
174 if (use_cmd) {
175 return (event.pressed ? MACRO( D(LGUI), T(ENT), U(LGUI), END ) : MACRO(END));
176 } else {
177 return (event.pressed ? MACRO( D(LCTRL), T(ENT), U(LCTRL), END ) : MACRO(END));
178 }
179 case M_SCRN:
180 /* Command + Enter or Ctrl + Enter*/
181 if (use_cmd) {
182 return (event.pressed ? MACRO( D(LGUI), D(LCTRL), D(LSFT), T(4), U(LSFT), U(LGUI), U(LCTRL), END ) : MACRO(END));
183 } else {
184 return (event.pressed ? MACRO( T(PSCR) ) : MACRO(END));
185 }
186 case M_NSPC:
187 /* Next space / desktop */
188 if (use_cmd) {
189 return (event.pressed ? MACRO( D(LCTRL), T(RIGHT), U(LCTRL), END ) : MACRO(END));
190 } else {
191 return (event.pressed ? MACRO( D(LGUI), T(RIGHT), U(LGUI), END ) : MACRO(END));
192 }
193 break;
194 case M_PSPC:
195 /* Previous space / desktop */
196 if (use_cmd) {
197 return (event.pressed ? MACRO( D(LCTRL), T(LEFT), U(LCTRL), END ) : MACRO(END));
198 } else {
199 return (event.pressed ? MACRO( D(LGUI), T(LEFT), U(LGUI), END ) : MACRO(END));
200 }
201 default:
202 break;
203 }
204 return MACRO_NONE;
205};
diff --git a/keyboards/xd75/keymaps/adi/readme.md b/keyboards/xd75/keymaps/adi/readme.md
new file mode 100644
index 000000000..0d481fa53
--- /dev/null
+++ b/keyboards/xd75/keymaps/adi/readme.md
@@ -0,0 +1,21 @@
1# Adi's XD75re Keymap
2
3This is my own (@adiron) keymap. It was originally made for the Planck. Since then a modified layout has expanded to encompass the XD75re as well, which I mostly use.
4
5Below is a summary of the important functions in the keymap. For more, consult the keymap file.
6
7## Multi-use keys
8
9Enter (thumb key) - HJKL become left, down, up, right (VIM movement keys). Q and W become previous and next tab, E and R switch spaces in macOS, A and Z go back and and forward in the browser.
10
11Semicolon - VIM movement keys become mouse. U left click. I right click.
12
13Quote key - JKL are back, pause/play and forward. AZ are volume up and down, Q and W are brightness down and up.
14
15## Misc
16
17Lower + Quote - a Hebrew maqaf (־) in macOS
18
19## AG swap
20
21Macros refer to AG_SWAP to check whether to send the macOS or the Windows shortcut. Very useful to me since I alternate between the two.
diff --git a/keyboards/xd75/keymaps/adi/rules.mk b/keyboards/xd75/keymaps/adi/rules.mk
new file mode 100644
index 000000000..d4e08cfb2
--- /dev/null
+++ b/keyboards/xd75/keymaps/adi/rules.mk
@@ -0,0 +1,18 @@
1# Copyright 2013 Jun Wako <wakojun@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
16ifndef QUANTUM_DIR
17 include ../../../../Makefile
18endif