diff options
author | wanleg <32079073+wanleg@users.noreply.github.com> | 2018-08-17 16:11:21 -0700 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2018-08-17 16:11:21 -0700 |
commit | 9175eebc8796f31a481ba16b1ca2ba9e4432502e (patch) | |
tree | fe799b4792343343351be2dd3cc84715c3ffaafc /keyboards/gherkin/keymaps/wanleg | |
parent | 8007d9f3a7583adeedd26fa7ab1622e06fed8034 (diff) |
Keymap: Wanleg userspace (#3670)
* configure wanleg userspace
* additional layout support
* additional layout support
* userspace edits
* fix swap hands between 30 and 40 percent
* add additional keymaps
* userspace edits
* userspace configuration
* userspace configuration
* Update readme.md
* userspace work
* swap hands userspace fix
* made requested edits
* Update readme.md
* use relative paths instead of copying file
* Update wanleg.h
* fixing layer order
Diffstat (limited to 'keyboards/gherkin/keymaps/wanleg')
-rw-r--r-- | keyboards/gherkin/keymaps/wanleg/config.h | 24 | ||||
-rw-r--r-- | keyboards/gherkin/keymaps/wanleg/keymap.c | 218 | ||||
-rw-r--r-- | keyboards/gherkin/keymaps/wanleg/readme.md | 86 | ||||
-rw-r--r-- | keyboards/gherkin/keymaps/wanleg/rules.mk | 7 |
4 files changed, 0 insertions, 335 deletions
diff --git a/keyboards/gherkin/keymaps/wanleg/config.h b/keyboards/gherkin/keymaps/wanleg/config.h deleted file mode 100644 index 98e2b23380..0000000000 --- a/keyboards/gherkin/keymaps/wanleg/config.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" -#endif - -#define PREVENT_STUCK_MODIFIERS - -//Tap Dance Prerequisite -#define TAPPING_TERM 200 - -//Mousekeys Settings -#define MOUSEKEY_INTERVAL 16 -#define MOUSEKEY_DELAY 0 -#define MOUSEKEY_TIME_TO_MAX 60 -#define MOUSEKEY_MAX_SPEED 7 -#define MOUSEKEY_WHEEL_DELAY 0 - -/* for QMK DFU bootloader */ -/* not required if using default ProMicro bootloader */ -/* set top left key as bootloader mode escape key */ -#define QMK_ESC_OUTPUT B4 // usually COL -#define QMK_ESC_INPUT F7 // usually ROW -#define QMK_LED B0
\ No newline at end of file diff --git a/keyboards/gherkin/keymaps/wanleg/keymap.c b/keyboards/gherkin/keymaps/wanleg/keymap.c deleted file mode 100644 index 108ed40e53..0000000000 --- a/keyboards/gherkin/keymaps/wanleg/keymap.c +++ /dev/null @@ -1,218 +0,0 @@ -/* Copyright 2017 Brian Fong - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ -#include QMK_KEYBOARD_H - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _QW 0 -#define DIR 1 -#define NUM 2 -#define ETC 3 - -// Readability keycodes -#define _______ KC_TRNS - - -/////////////// TAP DANCE SECTION START /////////////// -//Tap Dance Declarations (list of my tap dance configurations) -enum { - TD_SFT_CAPS = 0 - ,TD_Q_ESC - ,ENT_TAP_DANCE - ,DEL_TAP_DANCE -}; - -///// QUAD FUNCTION TAP DANCE GENERAL SETUP SECTION START ///// -///// (no need to edit this section) ///// -//Enums used to clearly convey the state of the tap dance -enum { - SINGLE_TAP = 1, - SINGLE_HOLD = 2, - DOUBLE_TAP = 3, - DOUBLE_HOLD = 4, - DOUBLE_SINGLE_TAP = 5 //send SINGLE_TAP twice - NOT DOUBLE_TAP - // Add more enums here if you want for triple, quadruple, etc. -}; - -typedef struct { - bool is_press_action; - int state; -} tap; - -int cur_dance (qk_tap_dance_state_t *state) { - if (state->count == 1) { - //If count = 1, and it has been interrupted - it doesn't matter if it is pressed or not: Send SINGLE_TAP - if (state->interrupted || !state->pressed) return SINGLE_TAP; - if (state->interrupted) return SINGLE_TAP; - else return SINGLE_HOLD; - } - //If count = 2, and it has been interrupted - assume that user is trying to type the letter associated - //with single tap. - else if (state->count == 2) { - if (state->interrupted) return DOUBLE_SINGLE_TAP; - else if (state->pressed) return DOUBLE_HOLD; - else return DOUBLE_TAP; - } - else return 6; //magic number. At some point this method will expand to work for more presses -} -///// QUAD FUNCTION TAP DANCE GENERAL SETUP SECTION END ///// -///// QUAD FUNCTION TAP DANCE PERSONALIZATION SECTION START ///// -//instantialize an instance of 'tap' for the 'ENT' tap dance. -static tap ENTtap_state = { - .is_press_action = true, - .state = 0 -}; - -void ENT_finished (qk_tap_dance_state_t *state, void *user_data) { - ENTtap_state.state = cur_dance(state); - switch (ENTtap_state.state) { - case SINGLE_TAP: register_code(KC_SPC); break; - case SINGLE_HOLD: register_code(KC_LSFT); break; - case DOUBLE_TAP: register_code(KC_ENT); break; - case DOUBLE_HOLD: register_code(KC_NO); break; // setting double hold to do nothing (change this if you want) - case DOUBLE_SINGLE_TAP: register_code(KC_SPC); unregister_code(KC_SPC); register_code(KC_SPC); - //Last case is for fast typing. Assuming your key is `f`: - //For example, when typing the word `buffer`, and you want to make sure that you send `ff` and not `Esc`. - //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. - } -} - -void ENT_reset (qk_tap_dance_state_t *state, void *user_data) { - switch (ENTtap_state.state) { - case SINGLE_TAP: unregister_code(KC_SPC); break; - case SINGLE_HOLD: unregister_code(KC_LSFT); break; - case DOUBLE_TAP: unregister_code(KC_ENT); break; - case DOUBLE_HOLD: unregister_code(KC_NO); - case DOUBLE_SINGLE_TAP: unregister_code(KC_SPC); - } - ENTtap_state.state = 0; -} - -//instanalize an instance of 'tap' for the 'DEL' tap dance. -static tap DELtap_state = { - .is_press_action = true, - .state = 0 -}; - -void DEL_finished (qk_tap_dance_state_t *state, void *user_data) { - DELtap_state.state = cur_dance(state); - switch (DELtap_state.state) { - case SINGLE_TAP: register_code(KC_BSPC); break; - case SINGLE_HOLD: register_code(KC_LCTL); break; - case DOUBLE_TAP: register_code(KC_DEL); break; - case DOUBLE_HOLD: register_code(KC_NO); break; - case DOUBLE_SINGLE_TAP: register_code(KC_BSPC); unregister_code(KC_BSPC); register_code(KC_BSPC); - } -} - -void DEL_reset (qk_tap_dance_state_t *state, void *user_data) { - switch (DELtap_state.state) { - case SINGLE_TAP: unregister_code(KC_BSPC); break; - case SINGLE_HOLD: unregister_code(KC_LCTL); break; - case DOUBLE_TAP: unregister_code(KC_DEL); break; - case DOUBLE_HOLD: unregister_code(KC_NO); - case DOUBLE_SINGLE_TAP: unregister_code(KC_BSPC); - } - DELtap_state.state = 0; -} -///// QUAD FUNCTION TAP DANCE PERSONALIZATION SECTION END ///// - -//Tap Dance Definitions -//THIS SECTION HAS TO BE AT THE END OF THE TAP DANCE SECTION -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_SFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS) -// Other declarations would go here, separated by commas, if you have them - ,[TD_Q_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_Q, KC_ESC) - ,[ENT_TAP_DANCE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ENT_finished, ENT_reset) - ,[DEL_TAP_DANCE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, DEL_finished, DEL_reset) -}; - -//In Layer declaration, add tap dance item in place of a key code -//TD(TD_SFT_CAPS) - -///////////// TAP DANCE SECTION END /////////////// - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Qwerty - * .-----------------------------------------------------------------------------------------. - * | Q//ESC | W | E | R | T | Y | U | I | O | P | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | A | S | D | F | G | H | J | K | L | SPACE | - * | | | | | | | | | |SFThold | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | Z | X | C | V/NUM | B/ETC | N | M/DIR | ,/GUI | ./ALT | BKSC | - * | SFThold| | | | | | | | |CTRLhold| - * '-----------------------------------------------------------------------------------------' - */ - [_QW] = LAYOUT_ortho_3x10( /* Qwerty*/ - TD(TD_Q_ESC), KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, - KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, SFT_T(KC_SPC), - 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) - ), - - /* - * Directional Modifiers - * .-----------------------------------------------------------------------------------------. - * | TAB | up | | INS | CTRL | SHIFT | PgUp | HOME | - | = | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | left | down | right | PrScr | SHIFT | CTRL | PgDn | END | [ | ] | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | P-Brk | | | | | | | RGUI | ALT | / | - * '-----------------------------------------------------------------------------------------' - */ - [DIR] = LAYOUT_ortho_3x10( /* Directional Modifiers */ - KC_TAB, KC_UP, _______, KC_INS, KC_LCTL, KC_RSFT, KC_PGUP, KC_HOME, KC_MINS, KC_EQL, - KC_LEFT, KC_DOWN, KC_RGHT, KC_PSCR, KC_LSFT, KC_RCTL, KC_PGDN, KC_END, KC_LBRC, KC_RBRC, - KC_PAUS, _______, _______, _______, _______, _______, _______, KC_RGUI, KC_LALT, KC_SLSH - ), - - /* - * Numbers - * .-----------------------------------------------------------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | F11 | F12 | | | | ENTER | SHIFT | GUI | ./ALT | BKSC | - * | | | | | | | | | |CTRLhold| - * '-----------------------------------------------------------------------------------------' - */ - [NUM] = LAYOUT_ortho_3x10 ( /* Numbers */ - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, - KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, - KC_F11, KC_F12, _______, _______, _______, KC_ENT, KC_RSFT, KC_RGUI, ALT_T(KC_DOT), CTL_T(KC_BSPC) - ), - - /* - * ETC - * .-----------------------------------------------------------------------------------------. - * | ` | mUP | | | RESET | SHIFT | mUp | mDown | | \ | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | mLeft | mDown | mRight | | SHIFT | mBtn3 | mBtn1 | mBtn2 | ; | ' | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | Sft//Cp| | | | | C-A-D | mLeft | mRight | ALT | DEL | - * '-----------------------------------------------------------------------------------------' - */ - [ETC] = LAYOUT_ortho_3x10( /* ETC */ - KC_GRV, KC_MS_U, _______, _______, RESET, KC_RSFT, KC_WH_U, KC_WH_D, _______, KC_BSLS, - KC_MS_L, KC_MS_D, KC_MS_R, _______, KC_LSFT, KC_BTN3, KC_BTN1, KC_BTN2, KC_SCLN, KC_QUOT, - TD(TD_SFT_CAPS), _______, _______, _______, _______, LALT(LCTL(KC_DEL)), KC_WH_L, KC_WH_R, KC_LALT, KC_DEL - ), - -}; diff --git a/keyboards/gherkin/keymaps/wanleg/readme.md b/keyboards/gherkin/keymaps/wanleg/readme.md deleted file mode 100644 index 0b1b099c4a..0000000000 --- a/keyboards/gherkin/keymaps/wanleg/readme.md +++ /dev/null @@ -1,86 +0,0 @@ -![Gherkin Wanleg Layout Image](https://i.imgur.com/nCPog2W.png) -# Gherkin Wanleg Layout -This is the layout I came up with to preserve a standard QWERTY 104 key ANSI layout as much as possible, in as few layers as possible for a 30 key board. -I originally set up a few Tap Dance keys, but dropped half of them in favor of chorded versions since in actual use, they tended to impede typing speed more than their current two-key versions. -I've left them in my `keymap.c` ready for use if anyone wants to try them out: - -Legend Name | Single Tap | Double Tap | Hold ---- | --- | --- | --- -*null* | space | enter | shift -*null* | backspace | delete | control -Sft//Cp | shift | caps lock | *null* -Q//Esc | KC_Q | escape | *null* - -# Gherkin Flashing -## Windows -1. The standard Gherkin uses a ProMicro (or clone) microcontroller, which has the Caterina bootloader by default. -2. If you have never flashed your ProMicro with QMK before, you will need to short the RST pin to GND to put it into bootloader mode (you only have 7 seconds to flash once it enters bootloader mode). You may need to touch the RST pin to GND **TWICE** in quick succession if it doesn't flash with just one touch. -3. Once connected to your computer, you should be able to flash using -`make gherkin:wanleg:avrdude` -4. Once you've been able to successfully flash the ProMicro, you should be able to use the `RESET` key for future flashes instead of shorting the RST pin. - -## Linux -### First Flash with QMK -The built-in `:avrdude` QMK target in Linux doesn't work with the default Caterina bootloader on the ProMicro, so we have to use avrdude separately. The instructions below are adapted from https://deskthority.net/workshop-f7/how-to-use-a-pro-micro-as-a-cheap-controller-converter-like-soarer-s-t8448.html - -1. To flash the device, you need to have AVRdude installed. You can do this via your distro's package manager (or compile from source if needed). -2. Once avrdude has been installed, open a terminal and run -`ls /dev/tty*` -3. Next, plug in your device and re-run `ls /dev/tty*` -There should be one more device than was seen previously. Make a note of it. For me, it's `/dev/ttyACM0`. -4. Navigate to the directory with your `.hex` file in it. Touch the RST pin to GND **TWICE** in quick succession, then run the following within 7 seconds: -`sudo avrdude -p m32u4 -P YOUR_SERIAL_PORT -c avr109 -U flash:w:YOUR_FILENAME.hex` -Replace YOUR_SERIAL_PORT with your serial port's device name, and YOUR_FILENAME.hex with the appropriate filename. For me, it looks like this: -`sudo avrdude -p m32u4 -P /dev/ttyACM0 -c avr109 -U flash:w:gherkin_wanleg.hex` -If you miss the 7 second window, the ProMicro will leave bootloader mode and the flash will fail. Hit `Control` + `C` to exit the `avrdude` command, connect RST to GND twice quickly, and try the `avrdude` command again. - -### Subsequent Flashes with QMK -1. Re-flashing is similar to the initial flash procedure. Plug in your keyboard, open a terminal and run -`ls /dev/tty*` -2. Next, hit the `RESET` key on your keyboard and re-run the `ls /dev/tty*` command to find your keyboard's serial port. -3. Flash your keyboard with the avrdude command you used for the initial flash within 7 seconds after hitting `RESET`. - -# ProMicro Bootloader Replacement (Caterina to QMK DFU) -If you have an Arduino (or clone), you can replace the bootloader for a few extra features (e.g. no more 7 second "flash window", simplified Linux flashing, blinking LED when the ProMicro is in bootloader mode, ability to exit bootloader mode without unplugging your keyboard, among others). -The instructions below have been adapted from https://www.reddit.com/r/olkb/comments/8sxgzb/replace_pro_micro_bootloader_with_qmk_dfu/) -## Arduino Setup -1. Upload the ArduinoISP sketch onto your Arduino board (https://www.arduino.cc/en/Tutorial/ArduinoISP). -2. Wire the Arduino to the ProMicro - -| Arduino | ProMicro | -| --- | --- | -| 10 | RST | -| 11 | 16 | -| 12 | 14 | -| 13 | 15 | -| GND | GND | -| 5V | VCC | - -## Make the QMK DFU .hex -3. In `config.h` add the following. This is already set up in `qmk_firmware/keyboards/gherkin/wanleg`. You only need to do this on other keymaps. -``` -#define QMK_ESC_OUTPUT B4 -#define QMK_ESC_INPUT F7 -#define QMK_LED B0 -``` -The `QMK_ESC_` lines define where the bootloader escape key is. Refer to the `MATRIX_ROW_PINS` and `MATRIX_COL_PINS` lines in your keyboard's `config.h` to choose your preferred key. -You hit the bootloader escape key to exit bootloader mode after you've hit the RESET key to enter bootloader mode (e.g. if you change your mind and don't want to flash just then). -On a Gherkin, B4/F7 corresponds to the top-left corner key. -`B0` is an indicator light on one of the ProMicro's onboard LEDs. With QMK DFU, it will flash to indicate the ProMicro is in bootloader mode. -You can add `#define QMK_SPEAKER C6` if you have a speaker hooked up to pin C6. The Gherkin PCB already uses pin C6 in its switch layout, so you cannot use a speaker on a standard Gherkin. -4. Also, you should add `BOOTLOADER = qmk-dfu` to your `rules.mk` file, so it is flagged properly. Again, this is already set up in `qmk_firmware/keyboards/gherkin/wanleg`. -5. Once you've made the required edits, it's time to compile the firmware. If you use the `:production` target when compiling, it will produce the usual `.hex` file as well as `_bootloader.hex` and `_production.hex` files. The `_production.hex` will be what we want. This contains the bootloader and the firmware, so we only have to flash once (rather than flash the bootloader, and THEN flash the firmware). -For example -`make <keyboard>:<keymap>:production` -For my particular keymap, for reasons listed in the **Using QMK DFU** section, you should use the following to ensure the bootloader is set properly -`make gherkin:wanleg:production dfu=qmk` - -## Burn QMK DFU -6. Navigate to the directory with your `_production.hex` file, and burn it with the following command -`avrdude -b 19200 -c avrisp -p m32u4 -v -e -U lock:w:0x3F:m -U efuse:w:0xC3:m -U hfuse:w:0xD9:m -U lfuse:w:0x5E:m -U YOUR_production.hex -P comPORT` -Change `comPORT` to whatever port is used by the Arduino (e.g. `com11` in Windows or `/dev/ttyACM0` in Linux). Use Device Manager in Windows to find the port being used. Use `ls /dev/tty*` in Linux. Change `YOUR_production.hex` to whatever you've created in the previous step. - -## Using QMK DFU -7. Once QMK DFU is burned to your ProMicro, you can then flash subsequent hex files with -`make gherkin:<keymap>:dfu dfu=qmk` -The `dfu=qmk` conditional will set `BOOTLOADER = qmk-dfu` instead of `BOOTLOADER = caterina` diff --git a/keyboards/gherkin/keymaps/wanleg/rules.mk b/keyboards/gherkin/keymaps/wanleg/rules.mk deleted file mode 100644 index 7f2ff33277..0000000000 --- a/keyboards/gherkin/keymaps/wanleg/rules.mk +++ /dev/null @@ -1,7 +0,0 @@ -TAP_DANCE_ENABLE = yes # Enable Tap Dance (comment if not being implemented) - -#If ProMicro has QMK DFU bootloader instead of Caterina, -#run "make <keyboard>:<keymap> dfu=qmk" when compiling to ensure it is flagged properly after being flashed -ifeq ($(strip $(dfu)), qmk) - BOOTLOADER = qmk-dfu -endif
\ No newline at end of file |