1 /* Keymap for Space Oddity Keyboard
2 Copyright (C) 2017 James Taylor
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (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.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <https://www.gnu.org/licenses/>.
18 #include QMK_KEYBOARD_H
20 // Custom keycodes needed for dynamic macros.
21 enum custom_keycodes {
32 // Tap Dance initializer.
39 #include "dynamic_macro.h"
41 // Tap dance actions - double tap for Caps Lock.
42 qk_tap_dance_action_t tap_dance_actions[] = {
44 [SFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS),
48 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
50 /* Here is an ASCII version of the base layout. Note that Dynamic Macros 1 and 2 are considered Macro 5 and Macro 6.
52 * ___________________________________________________________________________________
53 * | | | | | | Dynamic | Dynamic |
54 * | () | [] | {} | NO OP | NO OP | Macro 1 | Macro 2 |
55 * |___________|___________|___________|___________|___________|___________|___________|
56 * | | | | | | | | | | | | |
57 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | BKSP |
58 * |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________|
59 * | | | | | | | | | | | | |
60 * | TAB | Q | W | E | R | T | Y | U | I | O | P | - |
61 * |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________|
62 * | | | | | | | | | | | | |
63 * |ESC (CTL_T)| A | S | D | F | G | H | J | K | L | ; | ' |
64 * |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________|
65 * | | | | | | | | | | | | |
66 * | SHFT | Z | X | C | V | B | N | M | , | . | / |SHFT(ENT)|
67 * |_________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_________|
68 * | | | | | | | ALT | HYP | LT 1| LT 2|
69 * |MO(2)|MO(1)| GUI | ALT | CTRL | SPC |(LFT)|(RGT)| (UP)|(DWN)|
70 * |_____|_____|_____|_____|___________|___________|_____|_____|_____|_____|
74 PAIR_PR, PAIR_BR, PAIR_CB, XXXXXXX, XXXXXXX, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, \
75 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
76 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, \
77 CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
78 TD(SFT_CAPS), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT), \
79 MO(2), MO(1), KC_LGUI, KC_RALT, KC_LCTL, KC_SPC, ALT_T(KC_LEFT), ALL_T(KC_RGHT), LT(1, KC_UP), LT(2, KC_DOWN) \
83 * Blank keys correspond to the KC_TRNS keycode.
85 * ___________________________________________________________________________________
86 * | | | | | | DYN REC | DYN REC |
87 * | LAMBDA | | | | | 1 | 2 |
88 * |___________|___________|___________|___________|___________|___________|___________|
89 * | DYN REC | | | | | | | | | | | |
90 * | STOP | F1 | F2 | F3 | F4 | F5 | [ | 7 | 8 | 9 | * | DEL |
91 * |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________|
92 * | | | | | | | | | | | | |
93 * | | F6 | F7 | F8 | F9 | F10 | ] | 4 | 5 | 6 | + | = |
94 * |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________|
95 * | | | | | | | | | | | | |
96 * | \ | F11 | F12 | F13 | F14 | F15 | { | 1 | 2 | 3 | - | | |
97 * |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________|
98 * | | | | | | | | | | | | |
99 * | | F16 | F17 | F18 | F19 | F20 | } | 0 | , | . | / | |
100 * |_________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_________|
101 * | | | | | | | | | | |
102 * | | | | | | | | | | |
103 * |_____|_____|_____|_____|___________|___________|_____|_____|_____|_____|
108 LAMBDA, _______, _______, _______, _______, DYN_REC_START1, DYN_REC_START2, \
109 DYN_REC_STOP, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LBRC, KC_P7, KC_P8, KC_P9, KC_ASTR, KC_DEL, \
110 _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_RBRC, KC_P4, KC_P5, KC_P6, KC_PLUS, KC_EQL, \
111 KC_BSLS, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_LCBR, KC_P1, KC_P2, KC_P3, KC_MINS, KC_PIPE, \
112 _______, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_RCBR, KC_P0, KC_COMM, KC_DOT, KC_SLSH, _______, \
113 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
118 * ___________________________________________________________________________________
121 * |___________|___________|___________|___________|___________|___________|___________|
122 * | | | | MS | | | | | | | | |
123 * | | | | UP | | | | | | | | |
124 * |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________|
125 * | | | MS | MS | MS | | | | | | | |
126 * | | | LFT | DWN | RGT | | | MS1 | MS3 | MS2 | | |
127 * |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________|
128 * | | | | | | | | | | | | |
129 * | | | | | | | | | | | | |
130 * |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________|
131 * | | | | | | | | | | | | |
132 * | |RESET| | | | | | | | | | |
133 * |_________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_________|
134 * | | | | | | | | | | |
135 * | | | | | | | | | | F(2)|
136 * |_____|_____|_____|_____|___________|___________|_____|_____|_____|_____|
141 _______, _______, _______, _______, _______, _______, _______, \
142 _______, _______, _______, KC_MS_U, _______, _______, _______, _______, _______, _______, _______, _______, \
143 _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, KC_BTN1, KC_BTN3, KC_BTN2, _______, _______, \
144 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
145 _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
146 _______, _______, _______, _______, _______, _______, _______, _______, _______, TG(2) \
150 void matrix_init_user(void) {
153 void matrix_scan_user(void) {
156 // Simple macro ideas follow. Each of them is designed to give you a quick way to create pairs of
157 // delimiters and then position the cursor between them, much like Emacs' ParEdit does. This way,
158 // you can have some convenient coding "helpers" even when not using Emacs. It is also nice for
161 // Customize to your heart's content!
162 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
164 if (!process_record_dynamic_macro(keycode, record)) {
171 if (record->event.pressed) {
172 SEND_STRING("()"SS_TAP(X_LEFT));
177 if (record->event.pressed) {
178 SEND_STRING("[]"SS_TAP(X_LEFT));
183 if (record->event.pressed) {
184 SEND_STRING("{}"SS_TAP(X_LEFT));
188 // Probably something only Lisp users will appreciate...
190 if (record->event.pressed) {
191 SEND_STRING("(lambda ())"SS_TAP(X_LEFT)SS_TAP(X_LEFT));
199 void led_set_user(uint8_t usb_led) {
201 if (usb_led & (1 << USB_LED_NUM_LOCK)) {
207 if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
213 if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
219 if (usb_led & (1 << USB_LED_COMPOSE)) {
225 if (usb_led & (1 << USB_LED_KANA)) {