aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/gherkin/keymaps/wanleg/config.h61
-rw-r--r--keyboards/gherkin/keymaps/wanleg/keymap.c221
-rw-r--r--keyboards/gherkin/keymaps/wanleg/readme.md12
-rw-r--r--keyboards/gherkin/keymaps/wanleg/rules.mk63
4 files changed, 357 insertions, 0 deletions
diff --git a/keyboards/gherkin/keymaps/wanleg/config.h b/keyboards/gherkin/keymaps/wanleg/config.h
new file mode 100644
index 000000000..6b69b2150
--- /dev/null
+++ b/keyboards/gherkin/keymaps/wanleg/config.h
@@ -0,0 +1,61 @@
1#ifndef CONFIG_H
2#define CONFIG_H
3
4#include "config_common.h"
5
6/* USB Device descriptor parameter */
7#define VENDOR_ID 0xFEED
8#define PRODUCT_ID 0x6060
9#define DEVICE_VER 0x0001
10#define MANUFACTURER 40 Percent Club
11#define PRODUCT Gherkin
12#define DESCRIPTION A 30 key ortholinear keyboard
13
14/* key matrix size */
15#define MATRIX_ROWS 5
16#define MATRIX_COLS 6
17
18/* key matrix pins */
19#define MATRIX_ROW_PINS { F7, B1, B3, B2, B6 }
20#define MATRIX_COL_PINS { B4, E6, D7, C6, D4, D0 }
21#define UNUSED_PINS
22
23/* COL2ROW or ROW2COL */
24#define DIODE_DIRECTION COL2ROW
25
26/* number of backlight levels */
27#define BACKLIGHT_PIN B5
28#ifdef BACKLIGHT_PIN
29#define BACKLIGHT_LEVELS 3
30#endif
31
32/* Set 0 if debouncing isn't needed */
33#define DEBOUNCING_DELAY 5
34
35/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
36#define LOCKING_SUPPORT_ENABLE
37
38/* Locking resynchronize hack */
39#define LOCKING_RESYNC_ENABLE
40
41/* key combination for command */
42#define IS_COMMAND() ( \
43 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
44)
45
46/* prevent stuck modifiers */
47#define PREVENT_STUCK_MODIFIERS
48
49/*tap dance definition */
50#define TAPPING_TERM 200
51
52
53#ifdef RGB_DI_PIN
54#define RGBLIGHT_ANIMATIONS
55#define RGBLED_NUM 0
56#define RGBLIGHT_HUE_STEP 8
57#define RGBLIGHT_SAT_STEP 8
58#define RGBLIGHT_VAL_STEP 8
59#endif
60
61#endif
diff --git a/keyboards/gherkin/keymaps/wanleg/keymap.c b/keyboards/gherkin/keymaps/wanleg/keymap.c
new file mode 100644
index 000000000..b16c15a90
--- /dev/null
+++ b/keyboards/gherkin/keymaps/wanleg/keymap.c
@@ -0,0 +1,221 @@
1/* Copyright 2017 Brian Fong
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 "gherkin.h"
17
18// Each layer gets a name for readability, which is then used in the keymap matrix below.
19// The underscores don't mean anything - you can have a layer called STUFF or any other name.
20// Layer names don't all need to be of the same length, obviously, and you can also skip them
21// entirely and just use numbers.
22#define _QW 0
23#define DIR 1
24#define NUM 2
25#define ETC 3
26
27
28/////////////// TAP DANCE SECTION START ///////////////
29//Tap Dance Declarations (list of my tap dance configurations)
30enum {
31 TD_SFT_CAPS = 0
32 ,TD_Q_ESC
33 ,ENT_TAP_DANCE
34 ,DEL_TAP_DANCE
35};
36
37///// QUAD FUNCTION TAP DANCE GENERAL SETUP SECTION START /////
38///// (no need to edit this section) /////
39//Enums used to clearly convey the state of the tap dance
40enum {
41 SINGLE_TAP = 1,
42 SINGLE_HOLD = 2,
43 DOUBLE_TAP = 3,
44 DOUBLE_HOLD = 4,
45 DOUBLE_SINGLE_TAP = 5 //send SINGLE_TAP twice - NOT DOUBLE_TAP
46 // Add more enums here if you want for triple, quadruple, etc.
47};
48
49typedef struct {
50 bool is_press_action;
51 int state;
52} tap;
53
54int cur_dance (qk_tap_dance_state_t *state) {
55 if (state->count == 1) {
56 //If count = 1, and it has been interrupted - it doesn't matter if it is pressed or not: Send SINGLE_TAP
57 if (state->interrupted || !state->pressed) return SINGLE_TAP;
58 if (state->interrupted) return SINGLE_TAP;
59 else return SINGLE_HOLD;
60 }
61 //If count = 2, and it has been interrupted - assume that user is trying to type the letter associated
62 //with single tap.
63 else if (state->count == 2) {
64 if (state->interrupted) return DOUBLE_SINGLE_TAP;
65 else if (state->pressed) return DOUBLE_HOLD;
66 else return DOUBLE_TAP;
67 }
68 else return 6; //magic number. At some point this method will expand to work for more presses
69}
70///// QUAD FUNCTION TAP DANCE GENERAL SETUP SECTION END /////
71///// QUAD FUNCTION TAP DANCE PERSONALIZATION SECTION START /////
72//instantialize an instance of 'tap' for the 'ENT' tap dance.
73static tap ENTtap_state = {
74 .is_press_action = true,
75 .state = 0
76};
77
78void ENT_finished (qk_tap_dance_state_t *state, void *user_data) {
79 ENTtap_state.state = cur_dance(state);
80 switch (ENTtap_state.state) {
81 case SINGLE_TAP: register_code(KC_SPC); break;
82 case SINGLE_HOLD: register_code(KC_LSFT); break;
83 case DOUBLE_TAP: register_code(KC_ENT); break;
84 case DOUBLE_HOLD: register_code(KC_NO); break; // setting double hold to do nothing (change this if you want)
85 case DOUBLE_SINGLE_TAP: register_code(KC_SPC); unregister_code(KC_SPC); register_code(KC_SPC);
86 //Last case is for fast typing. Assuming your key is `f`:
87 //For example, when typing the word `buffer`, and you want to make sure that you send `ff` and not `Esc`.
88 //In order to type `ff` when typing fast, the next character will have to be hit within the `TAPPING_TERM`, which by default is 200ms.
89 }
90}
91
92void ENT_reset (qk_tap_dance_state_t *state, void *user_data) {
93 switch (ENTtap_state.state) {
94 case SINGLE_TAP: unregister_code(KC_SPC); break;
95 case SINGLE_HOLD: unregister_code(KC_LSFT); break;
96 case DOUBLE_TAP: unregister_code(KC_ENT); break;
97 case DOUBLE_HOLD: unregister_code(KC_NO);
98 case DOUBLE_SINGLE_TAP: unregister_code(KC_SPC);
99 }
100 ENTtap_state.state = 0;
101}
102
103//instanalize an instance of 'tap' for the 'DEL' tap dance.
104static tap DELtap_state = {
105 .is_press_action = true,
106 .state = 0
107};
108
109void DEL_finished (qk_tap_dance_state_t *state, void *user_data) {
110 DELtap_state.state = cur_dance(state);
111 switch (DELtap_state.state) {
112 case SINGLE_TAP: register_code(KC_BSPC); break;
113 case SINGLE_HOLD: register_code(KC_LCTL); break;
114 case DOUBLE_TAP: register_code(KC_DEL); break;
115 case DOUBLE_HOLD: register_code(KC_NO); break;
116 case DOUBLE_SINGLE_TAP: register_code(KC_BSPC); unregister_code(KC_BSPC); register_code(KC_BSPC);
117 }
118}
119
120void DEL_reset (qk_tap_dance_state_t *state, void *user_data) {
121 switch (DELtap_state.state) {
122 case SINGLE_TAP: unregister_code(KC_BSPC); break;
123 case SINGLE_HOLD: unregister_code(KC_LCTL); break;
124 case DOUBLE_TAP: unregister_code(KC_DEL); break;
125 case DOUBLE_HOLD: unregister_code(KC_NO);
126 case DOUBLE_SINGLE_TAP: unregister_code(KC_BSPC);
127 }
128 DELtap_state.state = 0;
129}
130///// QUAD FUNCTION TAP DANCE PERSONALIZATION SECTION END /////
131
132//Tap Dance Definitions
133//THIS SECTION HAS TO BE AT THE END OF THE TAP DANCE SECTION
134qk_tap_dance_action_t tap_dance_actions[] = {
135 [TD_SFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS)
136// Other declarations would go here, separated by commas, if you have them
137 ,[TD_Q_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_Q, KC_ESC)
138 ,[ENT_TAP_DANCE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ENT_finished, ENT_reset)
139 ,[DEL_TAP_DANCE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, DEL_finished, DEL_reset)
140};
141
142//In Layer declaration, add tap dance item in place of a key code
143//TD(TD_SFT_CAPS)
144
145///////////// TAP DANCE SECTION END ///////////////
146
147const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
148
149 /* Qwerty
150 * .-----------------------------------------------------------------------------------------.
151 * | Q//ESC | W | E | R | T | Y | U | I | O | P |
152 * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
153 * | A | S | D | F | G | H | J | K | L | ENTER |
154 * | | | | | | | | | |SFThold |
155 * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
156 * | Z | X | C | V/NUM | B/ETC | N | M/DIR | ,/GUI | ./ALT | BKSC |
157 * | SFThold| | | | | | | | |CTRLhold|
158 * '-----------------------------------------------------------------------------------------'
159 */
160
161 [_QW] = KEYMAP( /* Qwerty*/
162 TD(TD_Q_ESC), KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,
163 KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, SFT_T(KC_SPC),
164 SFT_T(KC_Z), KC_X, KC_C, LT(NUM, KC_V), LT(ETC, KC_B), KC_N, LT(DIR, KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC)
165 ),
166
167
168//
169///*
170// * Directional Modifiers
171// * .-----------------------------------------------------------------------------------------.
172// * | TAB | up | | INS | CTRL | SHIFT | PgUp | HOME | - | = |
173// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
174// * | left | down | right | PrScr | SHIFT | CTRL | PgDn | END | [ | ] |
175// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
176// * | | | | | | | | | ALT | / |
177// * '-----------------------------------------------------------------------------------------'
178// */
179//
180[DIR] = KEYMAP( /* Directional Modifiers */
181 KC_TAB, KC_UP, KC_TRNS, KC_INS, KC_LCTL, KC_RSFT, KC_PGUP, KC_HOME, KC_MINS, KC_EQL ,
182 KC_LEFT, KC_DOWN, KC_RGHT, KC_PSCR, KC_LSFT, KC_RCTL, KC_PGDN, KC_END, KC_LBRC, KC_RBRC ,
183 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_RALT, KC_SLSH
184),
185//
186// /*
187// * Numbers
188// * .-----------------------------------------------------------------------------------------.
189// * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 |
190// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
191// * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 |
192// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
193// * | F11 | F12 | | | | ENTER | SHIFT | GUI | ./ALT | BKSC |
194// * | | | | | | | | | |CTRLhold|
195// * '-----------------------------------------------------------------------------------------'
196// */
197//
198[NUM] = KEYMAP ( /* Numbers */
199 KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 ,
200 KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0 ,
201 KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENT, KC_RSFT, KC_RGUI, ALT_T(KC_DOT), CTL_T(KC_BSPC)
202),
203//
204//
205// /*
206// * ETC
207// * .-----------------------------------------------------------------------------------------.
208// * | ` | | | | | | | | | \ |
209// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
210// * | CAPS | P-Brk | | | | | | | ; | ' |
211// * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
212// * | SHIFT | | | | | C-A-D | | GUI | | DEL |
213// * '-----------------------------------------------------------------------------------------'
214// */
215//
216[ETC] = KEYMAP( /* ETC */
217 KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS ,
218 KC_CAPS, KC_PAUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SCLN, KC_QUOT ,
219 KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LALT(LCTL(KC_DEL)), KC_TRNS, KC_RGUI, KC_TRNS, KC_DEL
220 ),
221};
diff --git a/keyboards/gherkin/keymaps/wanleg/readme.md b/keyboards/gherkin/keymaps/wanleg/readme.md
new file mode 100644
index 000000000..a364fcabc
--- /dev/null
+++ b/keyboards/gherkin/keymaps/wanleg/readme.md
@@ -0,0 +1,12 @@
1![Gherkin Wanleg Layout Image](https://i.imgur.com/RpN5N42.png)
2
3# Gherkin Wanleg Layout
4
5Here is the layout I came up with to preserve a standard QWERTY layout as much as possible, in as few layers as possible for a 30 key board.
6I originally set up a few Tap Dance keys, but eventually dropped most of them in favor of chorded versions, since in actual use, they tended to impede typing speed more than their (current) two-key versions.
7I've left them in my layout ready for use if anyone wants to try them out:
8Single tap - Double tap - Hold
9space - enter - shift
10backspace - delete - control
11shift - caps lock - XXXX
12KC_Q - escape - XXXX \ No newline at end of file
diff --git a/keyboards/gherkin/keymaps/wanleg/rules.mk b/keyboards/gherkin/keymaps/wanleg/rules.mk
new file mode 100644
index 000000000..06e66c16e
--- /dev/null
+++ b/keyboards/gherkin/keymaps/wanleg/rules.mk
@@ -0,0 +1,63 @@
1# MCU name
2MCU = atmega32u4
3
4# Processor frequency.
5# This will define a symbol, F_CPU, in all source code files equal to the
6# processor frequency in Hz. You can then use this symbol in your source code to
7# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
8# automatically to create a 32-bit value in your source code.
9#
10# This will be an integer division of F_USB below, as it is sourced by
11# F_USB after it has run through any CPU prescalers. Note that this value
12# does not *change* the processor frequency - it should merely be updated to
13# reflect the processor speed set externally so that the code can use accurate
14# software delays.
15F_CPU = 16000000
16
17#
18# LUFA specific
19#
20# Target architecture (see library "Board Types" documentation).
21ARCH = AVR8
22
23# Input clock frequency.
24# This will define a symbol, F_USB, in all source code files equal to the
25# input clock frequency (before any prescaling is performed) in Hz. This value may
26# differ from F_CPU if prescaling is used on the latter, and is required as the
27# raw input clock is fed directly to the PLL sections of the AVR for high speed
28# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
29# at the end, this will be done automatically to create a 32-bit value in your
30# source code.
31#
32# If no clock division is performed on the input clock inside the AVR (via the
33# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
34F_USB = $(F_CPU)
35
36# Interrupt driven control endpoint task(+60)
37OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
38
39
40# Boot Section Size in *bytes*
41OPT_DEFS += -DBOOTLOADER_SIZE=4096
42
43# Bootloader
44# This definition is optional, and if your keyboard supports multiple bootloaders of
45# different sizes, comment this out, and the correct address will be loaded
46# automatically (+60). See bootloader.mk for all options.
47BOOTLOADER = caterina
48
49
50# Build Options
51# comment out to disable the options.
52#
53BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
54MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
55EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
56CONSOLE_ENABLE = no # Console for debug(+400)
57COMMAND_ENABLE = no # Commands for debug and configuration
58SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
59NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
60BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
61AUDIO_ENABLE = no
62RGBLIGHT_ENABLE = no
63TAP_DANCE_ENABLE = yes # Enable Tap Dance (comment if not being implemented) \ No newline at end of file