aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames <32029516+broken-username@users.noreply.github.com>2017-10-23 12:26:52 -0600
committerJack Humbert <jack.humb@gmail.com>2017-10-23 08:26:52 -1000
commitc2b8a47604106af17b37fbe54d7dac02493bba68 (patch)
tree02a266a28bdb8c30dd95881b807a19b6b2973c9e
parent07ec609fadee47df505b9cfbc7d4a019a265d730 (diff)
downloadqmk_firmware-c2b8a47604106af17b37fbe54d7dac02493bba68.tar.gz
qmk_firmware-c2b8a47604106af17b37fbe54d7dac02493bba68.zip
Some finishing touches on space_oddity (#1892)
* Add verbose comments, ASCII layout pictures, and re-word readme.md * Fix omission of F(2) on the third layer.
-rw-r--r--keyboards/handwired/space_oddity/keymaps/default/keymap.c87
-rw-r--r--keyboards/handwired/space_oddity/readme.md6
2 files changed, 87 insertions, 6 deletions
diff --git a/keyboards/handwired/space_oddity/keymaps/default/keymap.c b/keyboards/handwired/space_oddity/keymaps/default/keymap.c
index 26be16fbd..4230cdf8d 100644
--- a/keyboards/handwired/space_oddity/keymaps/default/keymap.c
+++ b/keyboards/handwired/space_oddity/keymaps/default/keymap.c
@@ -17,7 +17,7 @@
17 17
18#include "space_oddity.h" 18#include "space_oddity.h"
19 19
20// Planck keycodes needed for dynamic macros 20// Planck keycodes needed for dynamic macros.
21enum planck_keycodes { 21enum planck_keycodes {
22 22
23 QWERTY = SAFE_RANGE, 23 QWERTY = SAFE_RANGE,
@@ -25,7 +25,7 @@ enum planck_keycodes {
25 25
26}; 26};
27 27
28// Tap Dance 28// Tap Dance initializer.
29enum { 29enum {
30 30
31 SFT_CAPS = 0, 31 SFT_CAPS = 0,
@@ -36,12 +36,14 @@ enum {
36 36
37#define MOUSE_LAYER 2 37#define MOUSE_LAYER 2
38 38
39// Toggle MOUSE_LAYER. Additional layers can be added for additional layouts or other special functions.
39const uint16_t PROGMEM fn_actions[] = { 40const uint16_t PROGMEM fn_actions[] = {
40 41
41 [2] = ACTION_LAYER_TOGGLE(MOUSE_LAYER), 42 [2] = ACTION_LAYER_TOGGLE(MOUSE_LAYER),
42 43
43}; 44};
44 45
46// Tap dance actions - double tap for Caps Lock.
45qk_tap_dance_action_t tap_dance_actions[] = { 47qk_tap_dance_action_t tap_dance_actions[] = {
46 48
47 [SFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS), 49 [SFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS),
@@ -50,6 +52,29 @@ qk_tap_dance_action_t tap_dance_actions[] = {
50 52
51const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 53const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
52 54
55 /* Here is an ASCII version of the base layout. Note that Dynamic Macros 1 and 2 are considered Macro 5 and Macro 6.
56
57 ___________________________________________________________________________________
58 | | | | | | Dynamic | Dynamic |
59 | Macro 0 | Macro 1 | Macro 2 | Macro 3 | Macro 4 | Macro 1 | Macro 2 |
60 |___________|___________|___________|___________|___________|___________|___________|
61 | | | | | | | | | | | | |
62 | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | BKSP |
63 |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________|
64 | | | | | | | | | | | | |
65 | TAB | Q | W | E | R | T | Y | U | I | O | P | - |
66 |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________|
67 | | | | | | | | | | | | |
68 |ESC (CTL_T)| A | S | D | F | G | H | J | K | L | ; | ' |
69 |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________|
70 | | | | | | | | | | | | |
71 | SHFT | Z | X | C | V | B | N | M | , | . | / |SHFT(ENT)|
72 |_________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_________|
73 | | | | | | | ALT | HYP | LT 1| LT 2|
74 | M2 | M1 | GUI | ALT | CTRL | SPC |(LFT)|(RGT)| (UP)|(DWN)|
75 |_____|_____|_____|_____|___________|___________|_____|_____|_____|_____|
76 */
77
53 KEYMAP( 78 KEYMAP(
54 M(0), M(1), M(2), M(3), M(4), DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, 79 M(0), M(1), M(2), M(3), M(4), DYN_MACRO_PLAY1, DYN_MACRO_PLAY2,
55 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, 80 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
@@ -57,6 +82,31 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
57 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, 82 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,
58 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), 83 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),
59 MO(2), MO(1), KC_LGUI, KC_RALT, KC_LCTRL, KC_SPC, ALT_T(KC_LEFT), ALL_T(KC_RGHT), LT(1, KC_UP), LT(2, KC_DOWN)), 84 MO(2), MO(1), KC_LGUI, KC_RALT, KC_LCTRL, KC_SPC, ALT_T(KC_LEFT), ALL_T(KC_RGHT), LT(1, KC_UP), LT(2, KC_DOWN)),
85
86 /* Function layer.
87 Blank keys correspond to the KC_TRNS keycode.
88
89 ___________________________________________________________________________________
90 | | | | | | DYN REC | DYN REC |
91 | Macro 7 | | | | | 1 | 2 |
92 |___________|___________|___________|___________|___________|___________|___________|
93 | DYN REC | | | | | | | | | | | |
94 | STOP | F1 | F2 | F3 | F4 | F5 | [ | 7 | 8 | 9 | * | DEL |
95 |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________|
96 | | | | | | | | | | | | |
97 | | F6 | F7 | F8 | F9 | F10 | ] | 4 | 5 | 6 | + | = |
98 |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________|
99 | | | | | | | | | | | | |
100 | \ | F11 | F12 | F13 | F14 | F15 | { | 1 | 2 | 3 | - | | |
101 |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________|
102 | | | | | | | | | | | | |
103 | | F16 | F17 | F18 | F19 | F20 | } | 0 | , | . | / | |
104 |_________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_________|
105 | | | | | | | | | | |
106 | | | | | | | | | | |
107 |_____|_____|_____|_____|___________|___________|_____|_____|_____|_____|
108
109 */
60 110
61 KEYMAP( 111 KEYMAP(
62 M(7), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DYN_REC_START1, DYN_REC_START2, 112 M(7), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DYN_REC_START1, DYN_REC_START2,
@@ -65,6 +115,30 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
65 KC_BSLS, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_LCBR, KC_P1, KC_P2, KC_P3, KC_MINS, KC_PIPE, 115 KC_BSLS, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_LCBR, KC_P1, KC_P2, KC_P3, KC_MINS, KC_PIPE,
66 KC_TRNS, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_RCBR, KC_P0, KC_COMM, KC_DOT, KC_SLSH, KC_TRNS, 116 KC_TRNS, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_RCBR, KC_P0, KC_COMM, KC_DOT, KC_SLSH, KC_TRNS,
67 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), 117 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
118
119 /* Mouse layer.
120
121 ___________________________________________________________________________________
122 | | | | | | | |
123 | | | | | | | |
124 |___________|___________|___________|___________|___________|___________|___________|
125 | | | | MS | | | | | | | | |
126 | | | | UP | | | | | | | | |
127 |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________|
128 | | | MS | MS | MS | | | | | | | |
129 | | | LFT | DWN | RGT | | | MS1 | MS3 | MS2 | | |
130 |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________|
131 | | | | | | | | | | | | |
132 | | | | | | | | | | | | |
133 |___________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|___________|
134 | | | | | | | | | | | | |
135 | |RESET| | | | | | | | | | |
136 |_________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_________|
137 | | | | | | | | | | |
138 | | | | | | | | | | F(2)|
139 |_____|_____|_____|_____|___________|___________|_____|_____|_____|_____|
140
141 */
68 142
69 KEYMAP( 143 KEYMAP(
70 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 144 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
@@ -75,6 +149,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
75 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(2)) 149 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(2))
76}; 150};
77 151
152// Simple macro ideas follow. Each of them is designed to give you a quick way to create pairs of
153// delimiters and then position the cursor between them, much like Emacs' ParEdit does. This way,
154// you can have some convenient coding "helpers" even when not using Emacs. It is also nice for
155// LaTeX editing.
156//
157// Customize to your heart's content!
78const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { 158const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
79 159
80 switch (id) { 160 switch (id) {
@@ -95,7 +175,8 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
95 SEND_STRING("{}"SS_TAP(X_LEFT)); 175 SEND_STRING("{}"SS_TAP(X_LEFT));
96 } 176 }
97 break; 177 break;
98 178
179 // Probably something only Lisp users will appreciate...
99 case 7: 180 case 7:
100 if (record->event.pressed) { 181 if (record->event.pressed) {
101 SEND_STRING("(lambda ())"SS_TAP(X_LEFT)SS_TAP(X_LEFT)); 182 SEND_STRING("(lambda ())"SS_TAP(X_LEFT)SS_TAP(X_LEFT));
diff --git a/keyboards/handwired/space_oddity/readme.md b/keyboards/handwired/space_oddity/readme.md
index 1dadcb8a9..07ec957fa 100644
--- a/keyboards/handwired/space_oddity/readme.md
+++ b/keyboards/handwired/space_oddity/readme.md
@@ -5,7 +5,7 @@ This firmware is for an Emacs-focused handwired custom keyboard using an Arduino
5 5
6As originally designed, the top row consists of 2u keys which are used for user-defined macros. The keys for Shift and Enter are 1.75u. 6As originally designed, the top row consists of 2u keys which are used for user-defined macros. The keys for Shift and Enter are 1.75u.
7 7
8Some simple example macros are included. To add your own, simply add the number of the macro you want in the appropriate section. 8Some simple example macros are included. To add your own, just add the number of the macro you want in the appropriate section.
9 9
10A picture of the finished product can be found here: https://imgur.com/dE9Y4XK 10A picture of the finished product can be found here: https://imgur.com/dE9Y4XK
11 11
@@ -17,9 +17,9 @@ The following pins are used:
17 17
18## Compiling and loading the firmware 18## Compiling and loading the firmware
19 19
20To build the firmware, run `make handwired/space-oddity` from the toplevel directory. 20To build the firmware, run `make handwired/space_oddity` from the toplevel directory.
21 21
22On GNU/Linux, you can flash the default layout onto the microcontroller by using `avrdude -p atmega32u4 -P /dev/ttyACM0 -c avr109 -U flash:w:handwired_space_oddity_default.hex`. Note that the device name under `/dev` may be different. 22On GNU/Linux, you can flash the default layout onto the microcontroller by using `avrdude -p atmega32u4 -P /dev/ttyACM0 -c avr109 -U flash:w:handwired_space_oddity_default.hex`. Note that the device name under `/dev` may be different.
23 23
24 24
25This design was conceived by James Taylor. Any requests for further information and/or tips for building your own are welcome! \ No newline at end of file 25This design was conceived by James Taylor. Any requests for further information, suggestions, and/or tips for building your own are welcome! \ No newline at end of file