diff options
| -rw-r--r-- | Dockerfile | 28 | ||||
| -rw-r--r-- | keyboards/handwired/CMD60/CMD60.c | 8 | ||||
| -rw-r--r-- | keyboards/handwired/CMD60/CMD60.h | 20 | ||||
| -rw-r--r-- | keyboards/handwired/CMD60/Makefile | 73 | ||||
| -rw-r--r-- | keyboards/handwired/CMD60/README.md | 35 | ||||
| -rw-r--r-- | keyboards/handwired/CMD60/config.h | 162 | ||||
| -rw-r--r-- | keyboards/handwired/CMD60/keymaps/default/keymap.c | 66 | ||||
| -rw-r--r-- | quantum/keymap_extras/keymap_dvorak.h | 15 | ||||
| -rw-r--r-- | quantum/keymap_extras/keymap_fr_ch.h | 2 | ||||
| -rw-r--r-- | quantum/keymap_extras/keymap_french.h | 4 | ||||
| -rw-r--r-- | quantum/keymap_extras/keymap_german.h | 2 | ||||
| -rw-r--r-- | quantum/keymap_extras/keymap_german_ch.h | 2 | ||||
| -rw-r--r-- | quantum/keymap_extras/keymap_nordic.h | 2 | ||||
| -rw-r--r-- | quantum/keymap_extras/keymap_spanish.h | 2 | ||||
| -rw-r--r-- | quantum/keymap_extras/keymap_uk.h | 4 | ||||
| -rw-r--r-- | quantum/process_keycode/process_tap_dance.c | 52 | ||||
| -rw-r--r-- | quantum/process_keycode/process_tap_dance.h | 19 | ||||
| -rw-r--r-- | readme.md | 63 | ||||
| -rw-r--r-- | tmk_core/avr.mk | 4 | ||||
| -rw-r--r-- | tmk_core/protocol/lufa/descriptor.c | 4 |
20 files changed, 536 insertions, 31 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..96ace4ec6 --- /dev/null +++ b/Dockerfile | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | FROM debian:jessie | ||
| 2 | MAINTAINER Erik Dasque <erik@frenchguys.com> | ||
| 3 | |||
| 4 | RUN apt-get update | ||
| 5 | RUN apt-get install --no-install-recommends -y build-essential \ | ||
| 6 | gcc \ | ||
| 7 | unzip \ | ||
| 8 | wget \ | ||
| 9 | zip \ | ||
| 10 | gcc-avr \ | ||
| 11 | binutils-avr \ | ||
| 12 | avr-libc \ | ||
| 13 | dfu-programmer \ | ||
| 14 | dfu-util \ | ||
| 15 | gcc-arm-none-eabi \ | ||
| 16 | binutils-arm-none-eabi \ | ||
| 17 | libnewlib-arm-none-eabi \ | ||
| 18 | git | ||
| 19 | |||
| 20 | RUN apt-get clean | ||
| 21 | RUN rm -rf /var/lib/apt/lists/* | ||
| 22 | |||
| 23 | ENV keyboard=ergodox_ez | ||
| 24 | ENV keymap=default | ||
| 25 | |||
| 26 | VOLUME /qmk | ||
| 27 | WORKDIR /qmk | ||
| 28 | CMD make clean ; make keyboard=${keyboard} keymap=${keymap} \ No newline at end of file | ||
diff --git a/keyboards/handwired/CMD60/CMD60.c b/keyboards/handwired/CMD60/CMD60.c new file mode 100644 index 000000000..799848e34 --- /dev/null +++ b/keyboards/handwired/CMD60/CMD60.c | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | #include "CMD60.h" | ||
| 2 | |||
| 3 | void matrix_init_kb(void) { | ||
| 4 | // put your keyboard start-up code here | ||
| 5 | // runs once when the firmware starts up | ||
| 6 | |||
| 7 | matrix_init_user(); | ||
| 8 | } | ||
diff --git a/keyboards/handwired/CMD60/CMD60.h b/keyboards/handwired/CMD60/CMD60.h new file mode 100644 index 000000000..f90871fc7 --- /dev/null +++ b/keyboards/handwired/CMD60/CMD60.h | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | #ifndef CMD60_H | ||
| 2 | #define CMD60_H | ||
| 3 | |||
| 4 | #include "quantum.h" | ||
| 5 | |||
| 6 | #define KEYMAP( \ | ||
| 7 | K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ | ||
| 8 | K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ | ||
| 9 | K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ | ||
| 10 | K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ | ||
| 11 | K40, K41, K42, K45, K4A, K4B, K4C, K4D \ | ||
| 12 | ) { \ | ||
| 13 | { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ | ||
| 14 | { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ | ||
| 15 | { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ | ||
| 16 | { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ | ||
| 17 | { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, KC_NO,K4A, K4B, K4C, K4D } \ | ||
| 18 | } | ||
| 19 | |||
| 20 | #endif \ No newline at end of file | ||
diff --git a/keyboards/handwired/CMD60/Makefile b/keyboards/handwired/CMD60/Makefile new file mode 100644 index 000000000..711759917 --- /dev/null +++ b/keyboards/handwired/CMD60/Makefile | |||
| @@ -0,0 +1,73 @@ | |||
| 1 | |||
| 2 | # MCU name | ||
| 3 | MCU = atmega32u4 | ||
| 4 | |||
| 5 | # Processor frequency. | ||
| 6 | # This will define a symbol, F_CPU, in all source code files equal to the | ||
| 7 | # processor frequency in Hz. You can then use this symbol in your source code to | ||
| 8 | # calculate timings. Do NOT tack on a 'UL' at the end, this will be done | ||
| 9 | # automatically to create a 32-bit value in your source code. | ||
| 10 | # | ||
| 11 | # This will be an integer division of F_USB below, as it is sourced by | ||
| 12 | # F_USB after it has run through any CPU prescalers. Note that this value | ||
| 13 | # does not *change* the processor frequency - it should merely be updated to | ||
| 14 | # reflect the processor speed set externally so that the code can use accurate | ||
| 15 | # software delays. | ||
| 16 | F_CPU = 16000000 | ||
| 17 | |||
| 18 | |||
| 19 | # | ||
| 20 | # LUFA specific | ||
| 21 | # | ||
| 22 | # Target architecture (see library "Board Types" documentation). | ||
| 23 | ARCH = AVR8 | ||
| 24 | |||
| 25 | # Input clock frequency. | ||
| 26 | # This will define a symbol, F_USB, in all source code files equal to the | ||
| 27 | # input clock frequency (before any prescaling is performed) in Hz. This value may | ||
| 28 | # differ from F_CPU if prescaling is used on the latter, and is required as the | ||
| 29 | # raw input clock is fed directly to the PLL sections of the AVR for high speed | ||
| 30 | # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' | ||
| 31 | # at the end, this will be done automatically to create a 32-bit value in your | ||
| 32 | # source code. | ||
| 33 | # | ||
| 34 | # If no clock division is performed on the input clock inside the AVR (via the | ||
| 35 | # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. | ||
| 36 | F_USB = $(F_CPU) | ||
| 37 | |||
| 38 | # Interrupt driven control endpoint task(+60) | ||
| 39 | OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT | ||
| 40 | |||
| 41 | |||
| 42 | # Boot Section Size in *bytes* | ||
| 43 | # Teensy halfKay 512 | ||
| 44 | # Teensy++ halfKay 1024 | ||
| 45 | # Atmel DFU loader 4096 | ||
| 46 | # LUFA bootloader 4096 | ||
| 47 | # USBaspLoader 2048 | ||
| 48 | OPT_DEFS += -DBOOTLOADER_SIZE=512 | ||
| 49 | |||
| 50 | |||
| 51 | # Build Options | ||
| 52 | # change yes to no to disable | ||
| 53 | # | ||
| 54 | BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) | ||
| 55 | MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) | ||
| 56 | EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) | ||
| 57 | CONSOLE_ENABLE ?= yes # Console for debug(+400) | ||
| 58 | COMMAND_ENABLE ?= yes # Commands for debug and configuration | ||
| 59 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | ||
| 60 | SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend | ||
| 61 | # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
| 62 | NKRO_ENABLE ?= no # USB Nkey Rollover | ||
| 63 | BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default | ||
| 64 | MIDI_ENABLE ?= no # MIDI controls | ||
| 65 | UNICODE_ENABLE ?= no # Unicode | ||
| 66 | BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID | ||
| 67 | AUDIO_ENABLE ?= no # Audio output on port C6 | ||
| 68 | |||
| 69 | ifndef QUANTUM_DIR | ||
| 70 | include ../../../Makefile | ||
| 71 | endif | ||
| 72 | |||
| 73 | |||
diff --git a/keyboards/handwired/CMD60/README.md b/keyboards/handwired/CMD60/README.md new file mode 100644 index 000000000..83e371543 --- /dev/null +++ b/keyboards/handwired/CMD60/README.md | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | CMD60 keyboard firmware | ||
| 2 | ====================== | ||
| 3 | |||
| 4 | ##CMD60 | ||
| 5 | |||
| 6 | This layout has been designed to optimize use of the left-hand, and it focussed specifically on programmers who work | ||
| 7 | with text editors like SublimeText and Atom. It utilizes the power of Space_fn, and features a caps lock swap for Fn2 | ||
| 8 | and enter key on tap. These features allow you to keep your right hand on the mouse more and should enable you to | ||
| 9 | achieve a higher level of productivity if you take the time to learn its function layers. | ||
| 10 | |||
| 11 | ## Quantum MK Firmware | ||
| 12 | |||
| 13 | For the full Quantum feature list, see [the parent readme.md](/doc/readme.md). | ||
| 14 | |||
| 15 | ## Building | ||
| 16 | |||
| 17 | Download or clone the whole firmware and navigate to the keyboards/handwired/CMD60 folder. | ||
| 18 | Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use | ||
| 19 | the Teensy Loader to program your .hex file. | ||
| 20 | |||
| 21 | Depending on which keymap you would like to use, you will have to compile slightly differently. | ||
| 22 | |||
| 23 | ### Default | ||
| 24 | |||
| 25 | To build with the default keymap, simply run `make`. | ||
| 26 | |||
| 27 | ### Other Keymaps | ||
| 28 | |||
| 29 | To build the firmware binary hex file with a keymap just do `make` with `keymap` option like: | ||
| 30 | |||
| 31 | ``` | ||
| 32 | $ make keymap=[default|jack|<name>] | ||
| 33 | ``` | ||
| 34 | |||
| 35 | Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/` | ||
diff --git a/keyboards/handwired/CMD60/config.h b/keyboards/handwired/CMD60/config.h new file mode 100644 index 000000000..27eb400b8 --- /dev/null +++ b/keyboards/handwired/CMD60/config.h | |||
| @@ -0,0 +1,162 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2012 Jun Wako <wakojun@gmail.com> | ||
| 3 | |||
| 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 2 of the License, or | ||
| 7 | (at your option) any later version. | ||
| 8 | |||
| 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. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #ifndef CONFIG_H | ||
| 19 | #define CONFIG_H | ||
| 20 | |||
| 21 | #include "config_common.h" | ||
| 22 | |||
| 23 | /* USB Device descriptor parameter */ | ||
| 24 | #define VENDOR_ID 0xFEED | ||
| 25 | #define PRODUCT_ID 0x6060 | ||
| 26 | #define DEVICE_VER 0x0001 | ||
| 27 | #define MANUFACTURER cmd | ||
| 28 | #define PRODUCT CMD60 | ||
| 29 | #define DESCRIPTION Advanced Programming Keeb Layout | ||
| 30 | |||
| 31 | /* key matrix size */ | ||
| 32 | #define MATRIX_ROWS 5 | ||
| 33 | #define MATRIX_COLS 14 | ||
| 34 | |||
| 35 | /* | ||
| 36 | * Keyboard Matrix Assignments | ||
| 37 | * | ||
| 38 | * Change this to how you wired your keyboard | ||
| 39 | * COLS: AVR pins used for columns, left to right | ||
| 40 | * ROWS: AVR pins used for rows, top to bottom | ||
| 41 | * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) | ||
| 42 | * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) | ||
| 43 | * | ||
| 44 | */ | ||
| 45 | #define MATRIX_ROW_PINS { F0, F4, F5, F6, F7 } | ||
| 46 | #define MATRIX_COL_PINS { B0, B1, B2, B3, B7, D0, D1, D2, D3, C6, D7, B4, B5, B6 } | ||
| 47 | #define UNUSED_PINS | ||
| 48 | |||
| 49 | /* COL2ROW or ROW2COL */ | ||
| 50 | #define DIODE_DIRECTION COL2ROW | ||
| 51 | |||
| 52 | // #define BACKLIGHT_PIN B7 | ||
| 53 | // #define BACKLIGHT_BREATHING | ||
| 54 | // #define BACKLIGHT_LEVELS 3 | ||
| 55 | |||
| 56 | |||
| 57 | /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ | ||
| 58 | #define DEBOUNCING_DELAY 5 | ||
| 59 | |||
| 60 | /* define if matrix has ghost (lacks anti-ghosting diodes) */ | ||
| 61 | //#define MATRIX_HAS_GHOST | ||
| 62 | |||
| 63 | /* number of backlight levels */ | ||
| 64 | |||
| 65 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | ||
| 66 | #define LOCKING_SUPPORT_ENABLE | ||
| 67 | /* Locking resynchronize hack */ | ||
| 68 | #define LOCKING_RESYNC_ENABLE | ||
| 69 | |||
| 70 | /* | ||
| 71 | * Force NKRO | ||
| 72 | * | ||
| 73 | * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved | ||
| 74 | * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the | ||
| 75 | * makefile for this to work.) | ||
| 76 | * | ||
| 77 | * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) | ||
| 78 | * until the next keyboard reset. | ||
| 79 | * | ||
| 80 | * NKRO may prevent your keystrokes from being detected in the BIOS, but it is | ||
| 81 | * fully operational during normal computer usage. | ||
| 82 | * | ||
| 83 | * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) | ||
| 84 | * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by | ||
| 85 | * bootmagic, NKRO mode will always be enabled until it is toggled again during a | ||
| 86 | * power-up. | ||
| 87 | * | ||
| 88 | */ | ||
| 89 | //#define FORCE_NKRO | ||
| 90 | |||
| 91 | /* | ||
| 92 | * Magic Key Options | ||
| 93 | * | ||
| 94 | * Magic keys are hotkey commands that allow control over firmware functions of | ||
| 95 | * the keyboard. They are best used in combination with the HID Listen program, | ||
| 96 | * found here: https://www.pjrc.com/teensy/hid_listen.html | ||
| 97 | * | ||
| 98 | * The options below allow the magic key functionality to be changed. This is | ||
| 99 | * useful if your keyboard/keypad is missing keys and you want magic key support. | ||
| 100 | * | ||
| 101 | */ | ||
| 102 | |||
| 103 | /* key combination for magic key command */ | ||
| 104 | #define IS_COMMAND() ( \ | ||
| 105 | keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ | ||
| 106 | ) | ||
| 107 | |||
| 108 | /* control how magic key switches layers */ | ||
| 109 | //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true | ||
| 110 | //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true | ||
| 111 | //#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false | ||
| 112 | |||
| 113 | /* override magic key keymap */ | ||
| 114 | //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS | ||
| 115 | //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS | ||
| 116 | //#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM | ||
| 117 | //#define MAGIC_KEY_HELP1 H | ||
| 118 | //#define MAGIC_KEY_HELP2 SLASH | ||
| 119 | //#define MAGIC_KEY_DEBUG D | ||
| 120 | //#define MAGIC_KEY_DEBUG_MATRIX X | ||
| 121 | //#define MAGIC_KEY_DEBUG_KBD K | ||
| 122 | //#define MAGIC_KEY_DEBUG_MOUSE M | ||
| 123 | //#define MAGIC_KEY_VERSION V | ||
| 124 | //#define MAGIC_KEY_STATUS S | ||
| 125 | //#define MAGIC_KEY_CONSOLE C | ||
| 126 | //#define MAGIC_KEY_LAYER0_ALT1 ESC | ||
| 127 | //#define MAGIC_KEY_LAYER0_ALT2 GRAVE | ||
| 128 | //#define MAGIC_KEY_LAYER0 0 | ||
| 129 | //#define MAGIC_KEY_LAYER1 1 | ||
| 130 | //#define MAGIC_KEY_LAYER2 2 | ||
| 131 | //#define MAGIC_KEY_LAYER3 3 | ||
| 132 | //#define MAGIC_KEY_LAYER4 4 | ||
| 133 | //#define MAGIC_KEY_LAYER5 5 | ||
| 134 | //#define MAGIC_KEY_LAYER6 6 | ||
| 135 | //#define MAGIC_KEY_LAYER7 7 | ||
| 136 | //#define MAGIC_KEY_LAYER8 8 | ||
| 137 | //#define MAGIC_KEY_LAYER9 9 | ||
| 138 | //#define MAGIC_KEY_BOOTLOADER PAUSE | ||
| 139 | //#define MAGIC_KEY_LOCK CAPS | ||
| 140 | //#define MAGIC_KEY_EEPROM E | ||
| 141 | //#define MAGIC_KEY_NKRO N | ||
| 142 | //#define MAGIC_KEY_SLEEP_LED Z | ||
| 143 | |||
| 144 | /* | ||
| 145 | * Feature disable options | ||
| 146 | * These options are also useful to firmware size reduction. | ||
| 147 | */ | ||
| 148 | |||
| 149 | /* disable debug print */ | ||
| 150 | //#define NO_DEBUG | ||
| 151 | |||
| 152 | /* disable print */ | ||
| 153 | //#define NO_PRINT | ||
| 154 | |||
| 155 | /* disable action features */ | ||
| 156 | //#define NO_ACTION_LAYER | ||
| 157 | //#define NO_ACTION_TAPPING | ||
| 158 | //#define NO_ACTION_ONESHOT | ||
| 159 | //#define NO_ACTION_MACRO | ||
| 160 | //#define NO_ACTION_FUNCTION | ||
| 161 | |||
| 162 | #endif | ||
diff --git a/keyboards/handwired/CMD60/keymaps/default/keymap.c b/keyboards/handwired/CMD60/keymaps/default/keymap.c new file mode 100644 index 000000000..9f9cbcd66 --- /dev/null +++ b/keyboards/handwired/CMD60/keymaps/default/keymap.c | |||
| @@ -0,0 +1,66 @@ | |||
| 1 | #include "CMD60.h" | ||
| 2 | |||
| 3 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 4 | [0] = KEYMAP( /* CMD60 - QWERTY */ | ||
| 5 | KC_ESC, 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, \ | ||
| 6 | 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, \ | ||
| 7 | LT(3, KC_ENT), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \ | ||
| 8 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, KC_NO, KC_RSFT, \ | ||
| 9 | KC_LCTL, KC_LGUI, KC_LALT, LT(2, KC_SPC), MO(3), MO(4), MO(5), TG(1) \ | ||
| 10 | ), | ||
| 11 | [1] = KEYMAP( /* CMD60 - GameMode */ | ||
| 12 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ | ||
| 13 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ | ||
| 14 | KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, \ | ||
| 15 | KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_RSFT, \ | ||
| 16 | KC_TRNS, KC_NO, KC_TRNS, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ | ||
| 17 | ), | ||
| 18 | [2] = KEYMAP( /* CMD60 - Arrows */ | ||
| 19 | KC_GRV, 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, \ | ||
| 20 | KC_TRNS, KC_BSPC, KC_UP, KC_DEL, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSPC, KC_UP, KC_DEL, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, \ | ||
| 21 | KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, \ | ||
| 22 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_TRNS, \ | ||
| 23 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ | ||
| 24 | ), | ||
| 25 | [3] = KEYMAP( /* CMD60 - Functions */ | ||
| 26 | KC_GRV, 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, \ | ||
| 27 | KC_AUDIO_MUTE, KC_BSPC, KC_PGUP, KC_DEL, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_UP, KC_PGDN, KC_TRNS, KC_PAUSE, KC_SLCK, KC_PSCREEN, \ | ||
| 28 | KC_TRNS, KC_HOME, KC_PGDN, KC_END, KC_TRNS, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_INSERT, KC_NO, KC_TRNS, \ | ||
| 29 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_TRNS, \ | ||
| 30 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ | ||
| 31 | ), | ||
| 32 | [4] = KEYMAP( /* CMD60 - Mouse */ | ||
| 33 | KC_SYSTEM_SLEEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ | ||
| 34 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, \ | ||
| 35 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_TRNS, KC_NO, KC_TRNS, \ | ||
| 36 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_WH_UP, KC_MS_BTN3, KC_MS_WH_DOWN, KC_NO, KC_NO, KC_TRNS, \ | ||
| 37 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ | ||
| 38 | ), | ||
| 39 | [5] = KEYMAP( /* CMD60 - Media */ | ||
| 40 | KC_SYSTEM_WAKE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ | ||
| 41 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, KC_AUDIO_MUTE, \ | ||
| 42 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MEDIA_PREV_TRACK, KC_MEDIA_NEXT_TRACK, KC_MEDIA_PLAY_PAUSE, \ | ||
| 43 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_WWW_BACK, KC_WWW_FORWARD, KC_NO, KC_NO, KC_WWW_REFRESH, \ | ||
| 44 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ | ||
| 45 | ), | ||
| 46 | }; | ||
| 47 | |||
| 48 | const uint16_t PROGMEM fn_actions[] = { | ||
| 49 | |||
| 50 | }; | ||
| 51 | |||
| 52 | |||
| 53 | const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) | ||
| 54 | { | ||
| 55 | // MACRODOWN only works in this function | ||
| 56 | switch(id) { | ||
| 57 | case 0: | ||
| 58 | if (record->event.pressed) { | ||
| 59 | register_code(KC_RSFT); | ||
| 60 | } else { | ||
| 61 | unregister_code(KC_RSFT); | ||
| 62 | } | ||
| 63 | break; | ||
| 64 | } | ||
| 65 | return MACRO_NONE; | ||
| 66 | }; | ||
diff --git a/quantum/keymap_extras/keymap_dvorak.h b/quantum/keymap_extras/keymap_dvorak.h index e855056e8..17f205977 100644 --- a/quantum/keymap_extras/keymap_dvorak.h +++ b/quantum/keymap_extras/keymap_dvorak.h | |||
| @@ -18,18 +18,19 @@ | |||
| 18 | #define DV_LBRC KC_MINS | 18 | #define DV_LBRC KC_MINS |
| 19 | #define DV_RBRC KC_EQL | 19 | #define DV_RBRC KC_EQL |
| 20 | 20 | ||
| 21 | #define DV_QUOT KC_Q | 21 | #define DV_QUOT KC_Q |
| 22 | #define DV_COMM KC_W | 22 | #define DV_COMM KC_W |
| 23 | #define DV_DOT KC_E | 23 | #define DV_DOT KC_E |
| 24 | #define DV_P KC_R | 24 | #define DV_P KC_R |
| 25 | #define DV_Y KC_T | 25 | #define DV_Y KC_T |
| 26 | #define DV_F KC_Y | 26 | #define DV_F KC_Y |
| 27 | #define DV_G KC_U | 27 | #define DV_G KC_U |
| 28 | #define DV_C KC_I | 28 | #define DV_C KC_I |
| 29 | #define DV_R KC_O | 29 | #define DV_R KC_O |
| 30 | #define DV_L KC_P | 30 | #define DV_L KC_P |
| 31 | #define DV_SLSH KC_LBRC | 31 | #define DV_SLSH KC_LBRC |
| 32 | #define DV_EQL KC_RBRC | 32 | #define DV_EQL KC_RBRC |
| 33 | #define DV_BSLS KC_BSLS | ||
| 33 | 34 | ||
| 34 | #define DV_A KC_A | 35 | #define DV_A KC_A |
| 35 | #define DV_O KC_S | 36 | #define DV_O KC_S |
| @@ -68,7 +69,13 @@ | |||
| 68 | #define DV_RPRN LSFT(DV_0) | 69 | #define DV_RPRN LSFT(DV_0) |
| 69 | #define DV_LCBR LSFT(DV_LBRC) | 70 | #define DV_LCBR LSFT(DV_LBRC) |
| 70 | #define DV_RCBR LSFT(DV_RBRC) | 71 | #define DV_RCBR LSFT(DV_RBRC) |
| 71 | #define DV_UNDS LSFT(DV_MINS) | 72 | |
| 72 | #define DV_PLUS LSFT(DV_EQL) | 73 | #define DV_QUES LSFT(DV_SLSH) |
| 74 | #define DV_PLUS LSFT(DV_EQL) | ||
| 75 | #define DV_PIPE LSFT(DV_BSLS) | ||
| 76 | |||
| 77 | #define DV_UNDS LSFT(DV_MINS) | ||
| 78 | |||
| 79 | #define DV_COLN LSFT(DV_SCLN) | ||
| 73 | 80 | ||
| 74 | #endif | 81 | #endif |
diff --git a/quantum/keymap_extras/keymap_fr_ch.h b/quantum/keymap_extras/keymap_fr_ch.h index 3fd971357..87d4bb24c 100644 --- a/quantum/keymap_extras/keymap_fr_ch.h +++ b/quantum/keymap_extras/keymap_fr_ch.h | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | #include "keymap.h" | 4 | #include "keymap.h" |
| 5 | 5 | ||
| 6 | // Alt gr | 6 | // Alt gr |
| 7 | #define ALGR(kc) kc | 0x1400 | 7 | #define ALGR(kc) RALT(kc) |
| 8 | #define FR_CH_ALGR KC_RALT | 8 | #define FR_CH_ALGR KC_RALT |
| 9 | 9 | ||
| 10 | // normal characters | 10 | // normal characters |
diff --git a/quantum/keymap_extras/keymap_french.h b/quantum/keymap_extras/keymap_french.h index 2a44c80b1..834c69650 100644 --- a/quantum/keymap_extras/keymap_french.h +++ b/quantum/keymap_extras/keymap_french.h | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | #include "keymap.h" | 4 | #include "keymap.h" |
| 5 | 5 | ||
| 6 | // Alt gr | 6 | // Alt gr |
| 7 | #define ALGR(kc) kc | 0x1400 | 7 | #define ALGR(kc) RALT(kc) |
| 8 | #define NO_ALGR KC_RALT | 8 | #define NO_ALGR KC_RALT |
| 9 | 9 | ||
| 10 | // Normal characters | 10 | // Normal characters |
| @@ -80,4 +80,4 @@ | |||
| 80 | #define FR_EURO ALGR(KC_E) | 80 | #define FR_EURO ALGR(KC_E) |
| 81 | #define FR_BULT ALGR(FR_DLR) | 81 | #define FR_BULT ALGR(FR_DLR) |
| 82 | 82 | ||
| 83 | #endif \ No newline at end of file | 83 | #endif |
diff --git a/quantum/keymap_extras/keymap_german.h b/quantum/keymap_extras/keymap_german.h index 3f9ae8bad..7e2e0ed44 100644 --- a/quantum/keymap_extras/keymap_german.h +++ b/quantum/keymap_extras/keymap_german.h | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | #include "keymap.h" | 4 | #include "keymap.h" |
| 5 | 5 | ||
| 6 | // Alt gr | 6 | // Alt gr |
| 7 | #define ALGR(kc) kc | 0x1400 | 7 | #define ALGR(kc) RALT(kc) |
| 8 | #define DE_ALGR KC_RALT | 8 | #define DE_ALGR KC_RALT |
| 9 | 9 | ||
| 10 | // normal characters | 10 | // normal characters |
diff --git a/quantum/keymap_extras/keymap_german_ch.h b/quantum/keymap_extras/keymap_german_ch.h index 6a782bcd7..b66d582a4 100644 --- a/quantum/keymap_extras/keymap_german_ch.h +++ b/quantum/keymap_extras/keymap_german_ch.h | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | #include "keymap.h" | 4 | #include "keymap.h" |
| 5 | 5 | ||
| 6 | // Alt gr | 6 | // Alt gr |
| 7 | #define ALGR(kc) kc | 0x1400 | 7 | #define ALGR(kc) RALT(kc) |
| 8 | #define CH_ALGR KC_RALT | 8 | #define CH_ALGR KC_RALT |
| 9 | 9 | ||
| 10 | // normal characters | 10 | // normal characters |
diff --git a/quantum/keymap_extras/keymap_nordic.h b/quantum/keymap_extras/keymap_nordic.h index 3acb8b698..f8cf4e2e4 100644 --- a/quantum/keymap_extras/keymap_nordic.h +++ b/quantum/keymap_extras/keymap_nordic.h | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | #include "keymap.h" | 4 | #include "keymap.h" |
| 5 | 5 | ||
| 6 | // Alt gr | 6 | // Alt gr |
| 7 | #define ALGR(kc) kc | 0x1400 | 7 | #define ALGR(kc) RALT(kc) |
| 8 | #define NO_ALGR KC_RALT | 8 | #define NO_ALGR KC_RALT |
| 9 | 9 | ||
| 10 | // Normal characters | 10 | // Normal characters |
diff --git a/quantum/keymap_extras/keymap_spanish.h b/quantum/keymap_extras/keymap_spanish.h index af76e39fc..4ba568af2 100644 --- a/quantum/keymap_extras/keymap_spanish.h +++ b/quantum/keymap_extras/keymap_spanish.h | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | #include "keymap.h" | 4 | #include "keymap.h" |
| 5 | 5 | ||
| 6 | // Alt gr | 6 | // Alt gr |
| 7 | #define ALGR(kc) kc | 0x1400 | 7 | #define ALGR(kc) RALT(kc) |
| 8 | #define NO_ALGR KC_RALT | 8 | #define NO_ALGR KC_RALT |
| 9 | 9 | ||
| 10 | // Normal characters | 10 | // Normal characters |
diff --git a/quantum/keymap_extras/keymap_uk.h b/quantum/keymap_extras/keymap_uk.h index 5c5d95179..00c87afc3 100644 --- a/quantum/keymap_extras/keymap_uk.h +++ b/quantum/keymap_extras/keymap_uk.h | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | #include "keymap.h" | 4 | #include "keymap.h" |
| 5 | 5 | ||
| 6 | // Alt gr | 6 | // Alt gr |
| 7 | #define ALGR(kc) kc | 0x1400 | 7 | #define ALGR(kc) RALT(kc) |
| 8 | #define NO_ALGR KC_RALT | 8 | #define NO_ALGR KC_RALT |
| 9 | 9 | ||
| 10 | // Normal characters | 10 | // Normal characters |
| @@ -33,4 +33,4 @@ | |||
| 33 | 33 | ||
| 34 | #define UK_AACT ALGR(KC_A) | 34 | #define UK_AACT ALGR(KC_A) |
| 35 | 35 | ||
| 36 | #endif \ No newline at end of file | 36 | #endif |
diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index 9b172e1b6..b9b836df2 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c | |||
| @@ -22,10 +22,29 @@ static void _process_tap_dance_action_pair (qk_tap_dance_state_t *state, | |||
| 22 | static void _process_tap_dance_action_fn (qk_tap_dance_state_t *state, | 22 | static void _process_tap_dance_action_fn (qk_tap_dance_state_t *state, |
| 23 | qk_tap_dance_user_fn_t fn) | 23 | qk_tap_dance_user_fn_t fn) |
| 24 | { | 24 | { |
| 25 | fn(state); | 25 | if (fn) { |
| 26 | fn(state); | ||
| 27 | } | ||
| 28 | } | ||
| 29 | |||
| 30 | void process_tap_dance_action_on_each_tap (uint16_t keycode) | ||
| 31 | { | ||
| 32 | uint16_t idx = keycode - QK_TAP_DANCE; | ||
| 33 | qk_tap_dance_action_t action; | ||
| 34 | |||
| 35 | action = tap_dance_actions[idx]; | ||
| 36 | |||
| 37 | switch (action.type) { | ||
| 38 | case QK_TAP_DANCE_TYPE_FN: | ||
| 39 | _process_tap_dance_action_fn (&qk_tap_dance_state, action.fn.on_each_tap); | ||
| 40 | break; | ||
| 41 | |||
| 42 | default: | ||
| 43 | break; | ||
| 44 | } | ||
| 26 | } | 45 | } |
| 27 | 46 | ||
| 28 | void process_tap_dance_action (uint16_t keycode) | 47 | void process_tap_dance_action_on_dance_finished (uint16_t keycode) |
| 29 | { | 48 | { |
| 30 | uint16_t idx = keycode - QK_TAP_DANCE; | 49 | uint16_t idx = keycode - QK_TAP_DANCE; |
| 31 | qk_tap_dance_action_t action; | 50 | qk_tap_dance_action_t action; |
| @@ -38,7 +57,7 @@ void process_tap_dance_action (uint16_t keycode) | |||
| 38 | action.pair.kc1, action.pair.kc2); | 57 | action.pair.kc1, action.pair.kc2); |
| 39 | break; | 58 | break; |
| 40 | case QK_TAP_DANCE_TYPE_FN: | 59 | case QK_TAP_DANCE_TYPE_FN: |
| 41 | _process_tap_dance_action_fn (&qk_tap_dance_state, action.fn); | 60 | _process_tap_dance_action_fn (&qk_tap_dance_state, action.fn.on_dance_finished); |
| 42 | break; | 61 | break; |
| 43 | 62 | ||
| 44 | default: | 63 | default: |
| @@ -51,8 +70,9 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { | |||
| 51 | 70 | ||
| 52 | switch(keycode) { | 71 | switch(keycode) { |
| 53 | case QK_TAP_DANCE ... QK_TAP_DANCE_MAX: | 72 | case QK_TAP_DANCE ... QK_TAP_DANCE_MAX: |
| 73 | process_tap_dance_action_on_each_tap (qk_tap_dance_state.keycode); | ||
| 54 | if (qk_tap_dance_state.keycode && qk_tap_dance_state.keycode != keycode) { | 74 | if (qk_tap_dance_state.keycode && qk_tap_dance_state.keycode != keycode) { |
| 55 | process_tap_dance_action (qk_tap_dance_state.keycode); | 75 | process_tap_dance_action_on_dance_finished (qk_tap_dance_state.keycode); |
| 56 | } else { | 76 | } else { |
| 57 | r = false; | 77 | r = false; |
| 58 | } | 78 | } |
| @@ -66,8 +86,9 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { | |||
| 66 | 86 | ||
| 67 | default: | 87 | default: |
| 68 | if (qk_tap_dance_state.keycode) { | 88 | if (qk_tap_dance_state.keycode) { |
| 69 | process_tap_dance_action (qk_tap_dance_state.keycode); | 89 | // if we are here, the tap dance was interrupted by a different key |
| 70 | 90 | process_tap_dance_action_on_each_tap (qk_tap_dance_state.keycode); | |
| 91 | process_tap_dance_action_on_dance_finished (qk_tap_dance_state.keycode); | ||
| 71 | reset_tap_dance (&qk_tap_dance_state); | 92 | reset_tap_dance (&qk_tap_dance_state); |
| 72 | } | 93 | } |
| 73 | break; | 94 | break; |
| @@ -78,13 +99,28 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { | |||
| 78 | 99 | ||
| 79 | void matrix_scan_tap_dance () { | 100 | void matrix_scan_tap_dance () { |
| 80 | if (qk_tap_dance_state.keycode && timer_elapsed (qk_tap_dance_state.timer) > TAPPING_TERM) { | 101 | if (qk_tap_dance_state.keycode && timer_elapsed (qk_tap_dance_state.timer) > TAPPING_TERM) { |
| 81 | process_tap_dance_action (qk_tap_dance_state.keycode); | 102 | // if we are here, the tap dance was timed out |
| 82 | 103 | process_tap_dance_action_on_dance_finished (qk_tap_dance_state.keycode); | |
| 83 | reset_tap_dance (&qk_tap_dance_state); | 104 | reset_tap_dance (&qk_tap_dance_state); |
| 84 | } | 105 | } |
| 85 | } | 106 | } |
| 86 | 107 | ||
| 87 | void reset_tap_dance (qk_tap_dance_state_t *state) { | 108 | void reset_tap_dance (qk_tap_dance_state_t *state) { |
| 109 | uint16_t idx = state->keycode - QK_TAP_DANCE; | ||
| 110 | qk_tap_dance_action_t action; | ||
| 111 | |||
| 112 | action = tap_dance_actions[idx]; | ||
| 113 | switch (action.type) { | ||
| 114 | case QK_TAP_DANCE_TYPE_FN: | ||
| 115 | if (action.fn.on_reset) { | ||
| 116 | action.fn.on_reset(state); | ||
| 117 | } | ||
| 118 | break; | ||
| 119 | |||
| 120 | default: | ||
| 121 | break; | ||
| 122 | } | ||
| 123 | |||
| 88 | state->keycode = 0; | 124 | state->keycode = 0; |
| 89 | state->count = 0; | 125 | state->count = 0; |
| 90 | } | 126 | } |
diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h index b9d7c7fcf..7b820584a 100644 --- a/quantum/process_keycode/process_tap_dance.h +++ b/quantum/process_keycode/process_tap_dance.h | |||
| @@ -31,18 +31,27 @@ typedef struct | |||
| 31 | uint16_t kc1; | 31 | uint16_t kc1; |
| 32 | uint16_t kc2; | 32 | uint16_t kc2; |
| 33 | } pair; | 33 | } pair; |
| 34 | qk_tap_dance_user_fn_t fn; | 34 | struct { |
| 35 | qk_tap_dance_user_fn_t on_each_tap; | ||
| 36 | qk_tap_dance_user_fn_t on_dance_finished; | ||
| 37 | qk_tap_dance_user_fn_t on_reset; | ||
| 38 | } fn; | ||
| 35 | }; | 39 | }; |
| 36 | } qk_tap_dance_action_t; | 40 | } qk_tap_dance_action_t; |
| 37 | 41 | ||
| 38 | #define ACTION_TAP_DANCE_DOUBLE(kc1, kc2) { \ | 42 | #define ACTION_TAP_DANCE_DOUBLE(kc1, kc2) { \ |
| 39 | .type = QK_TAP_DANCE_TYPE_PAIR, \ | 43 | .type = QK_TAP_DANCE_TYPE_PAIR, \ |
| 40 | .pair = { kc1, kc2 } \ | 44 | .pair = { kc1, kc2 } \ |
| 41 | } | 45 | } |
| 42 | 46 | ||
| 43 | #define ACTION_TAP_DANCE_FN(user_fn) { \ | 47 | #define ACTION_TAP_DANCE_FN(user_fn) { \ |
| 44 | .type = QK_TAP_DANCE_TYPE_FN, \ | 48 | .type = QK_TAP_DANCE_TYPE_FN, \ |
| 45 | .fn = user_fn \ | 49 | .fn = { NULL, user_fn, NULL } \ |
| 50 | } | ||
| 51 | |||
| 52 | #define ACTION_TAP_DANCE_FN_ADVANCED(user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_reset) { \ | ||
| 53 | .type = QK_TAP_DANCE_TYPE_FN, \ | ||
| 54 | .fn = { user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_reset } \ | ||
| 46 | } | 55 | } |
| 47 | 56 | ||
| 48 | extern const qk_tap_dance_action_t tap_dance_actions[]; | 57 | extern const qk_tap_dance_action_t tap_dance_actions[]; |
| @@ -75,6 +75,21 @@ Debian/Ubuntu example: | |||
| 75 | sudo apt-get update | 75 | sudo apt-get update |
| 76 | sudo apt-get install gcc-avr avr-libc dfu-programmer | 76 | sudo apt-get install gcc-avr avr-libc dfu-programmer |
| 77 | 77 | ||
| 78 | ### Docker | ||
| 79 | |||
| 80 | If this is a bit complex for you, Docker might be the turn-key solution you need. After installing [Docker](https://www.docker.com/products/docker), run the following command at the root of the QMK folder to build a keyboard/keymap: | ||
| 81 | |||
| 82 | ```bash | ||
| 83 | # You'll run this every time you want to build a keymap | ||
| 84 | # modify the keymap and keyboard assigment to compile what you want | ||
| 85 | # defaults are ergodox_ez/default | ||
| 86 | |||
| 87 | docker run -e keymap=gwen -e keyboard=ergodox_ez --rm -v $('pwd'):/qmk:rw edasque/qmk_firmware | ||
| 88 | |||
| 89 | ``` | ||
| 90 | |||
| 91 | This will compile the targetted keyboard/keymap and leave it in your QMK directory for you to flash. | ||
| 92 | |||
| 78 | ### Vagrant | 93 | ### Vagrant |
| 79 | If you have any problems building the firmware, you can try using a tool called Vagrant. It will set up a virtual computer with a known configuration that's ready-to-go for firmware building. OLKB does NOT host the files for this virtual computer. Details on how to set up Vagrant are in the [VAGRANT_GUIDE file](doc/VAGRANT_GUIDE.md). | 94 | If you have any problems building the firmware, you can try using a tool called Vagrant. It will set up a virtual computer with a known configuration that's ready-to-go for firmware building. OLKB does NOT host the files for this virtual computer. Details on how to set up Vagrant are in the [VAGRANT_GUIDE file](doc/VAGRANT_GUIDE.md). |
| 80 | 95 | ||
| @@ -372,10 +387,11 @@ But lets start with how to use it, first! | |||
| 372 | 387 | ||
| 373 | First, you will need `TAP_DANCE_ENABLE=yes` in your `Makefile`, because the feature is disabled by default. This adds a little less than 1k to the firmware size. Next, you will want to define some tap-dance keys, which is easiest to do with the `TD()` macro, that - similar to `F()`, takes a number, which will later be used as an index into the `tap_dance_actions` array. | 388 | First, you will need `TAP_DANCE_ENABLE=yes` in your `Makefile`, because the feature is disabled by default. This adds a little less than 1k to the firmware size. Next, you will want to define some tap-dance keys, which is easiest to do with the `TD()` macro, that - similar to `F()`, takes a number, which will later be used as an index into the `tap_dance_actions` array. |
| 374 | 389 | ||
| 375 | This array specifies what actions shall be taken when a tap-dance key is in action. Currently, there are two possible options: | 390 | This array specifies what actions shall be taken when a tap-dance key is in action. Currently, there are three possible options: |
| 376 | 391 | ||
| 377 | * `ACTION_TAP_DANCE_DOUBLE(kc1, kc2)`: Sends the `kc1` keycode when tapped once, `kc2` otherwise. | 392 | * `ACTION_TAP_DANCE_DOUBLE(kc1, kc2)`: Sends the `kc1` keycode when tapped once, `kc2` otherwise. |
| 378 | * `ACTION_TAP_DANCE_FN(fn)`: Calls the specified function - defined in the user keymap - with the current state of the tap-dance action. | 393 | * `ACTION_TAP_DANCE_FN(fn)`: Calls the specified function - defined in the user keymap - with the final tap count of the tap dance action. |
| 394 | * `ACTION_TAP_DANCE_FN_ADVANCED(on_each_tap_fn, on_dance_finished_fn, on_reset_fn)`: Calls the first specified function - defined in the user keymap - on every tap, the second function on when the dance action finishes (like the previous option), and the last function when the tap dance action resets. | ||
| 379 | 395 | ||
| 380 | The first option is enough for a lot of cases, that just want dual roles. For example, `ACTION_TAP_DANCE(KC_SPC, KC_ENT)` will result in `Space` being sent on single-tap, `Enter` otherwise. | 396 | The first option is enough for a lot of cases, that just want dual roles. For example, `ACTION_TAP_DANCE(KC_SPC, KC_ENT)` will result in `Space` being sent on single-tap, `Enter` otherwise. |
| 381 | 397 | ||
| @@ -399,7 +415,8 @@ In the end, let's see a full example! | |||
| 399 | enum { | 415 | enum { |
| 400 | CT_SE = 0, | 416 | CT_SE = 0, |
| 401 | CT_CLN, | 417 | CT_CLN, |
| 402 | CT_EGG | 418 | CT_EGG, |
| 419 | CT_FLSH, | ||
| 403 | }; | 420 | }; |
| 404 | 421 | ||
| 405 | /* Have the above three on the keymap, TD(CT_SE), etc... */ | 422 | /* Have the above three on the keymap, TD(CT_SE), etc... */ |
| @@ -424,10 +441,50 @@ void dance_egg (qk_tap_dance_state_t *state) { | |||
| 424 | } | 441 | } |
| 425 | } | 442 | } |
| 426 | 443 | ||
| 444 | // on each tap, light up one led, from right to left | ||
| 445 | // on the forth tap, turn them off from right to left | ||
| 446 | void dance_flsh_each(qk_tap_dance_state_t *state) { | ||
| 447 | switch (state->count) { | ||
| 448 | case 1: | ||
| 449 | ergodox_right_led_3_on(); | ||
| 450 | break; | ||
| 451 | case 2: | ||
| 452 | ergodox_right_led_2_on(); | ||
| 453 | break; | ||
| 454 | case 3: | ||
| 455 | ergodox_right_led_1_on(); | ||
| 456 | break; | ||
| 457 | case 4: | ||
| 458 | ergodox_right_led_3_off(); | ||
| 459 | _delay_ms(50); | ||
| 460 | ergodox_right_led_2_off(); | ||
| 461 | _delay_ms(50); | ||
| 462 | ergodox_right_led_1_off(); | ||
| 463 | } | ||
| 464 | } | ||
| 465 | |||
| 466 | // on the fourth tap, set the keyboard on flash state | ||
| 467 | void dance_flsh_finished(qk_tap_dance_state_t *state) { | ||
| 468 | if (state->count >= 4) { | ||
| 469 | reset_keyboard(); | ||
| 470 | reset_tap_dance(state); | ||
| 471 | } | ||
| 472 | } | ||
| 473 | |||
| 474 | // if the flash state didnt happen, then turn off leds, left to right | ||
| 475 | void dance_flsh_reset(qk_tap_dance_state_t *state) { | ||
| 476 | ergodox_right_led_1_off(); | ||
| 477 | _delay_ms(50); | ||
| 478 | ergodox_right_led_2_off(); | ||
| 479 | _delay_ms(50); | ||
| 480 | ergodox_right_led_3_off(); | ||
| 481 | } | ||
| 482 | |||
| 427 | const qk_tap_dance_action_t tap_dance_actions[] = { | 483 | const qk_tap_dance_action_t tap_dance_actions[] = { |
| 428 | [CT_SE] = ACTION_TAP_DANCE_DOUBLE (KC_SPC, KC_ENT) | 484 | [CT_SE] = ACTION_TAP_DANCE_DOUBLE (KC_SPC, KC_ENT) |
| 429 | ,[CT_CLN] = ACTION_TAP_DANCE_FN (dance_cln) | 485 | ,[CT_CLN] = ACTION_TAP_DANCE_FN (dance_cln) |
| 430 | ,[CT_EGG] = ACTION_TAP_DANCE_FN (dance_egg) | 486 | ,[CT_EGG] = ACTION_TAP_DANCE_FN (dance_egg) |
| 487 | ,[CT_FLSH] = ACTION_TAP_DANCE_FN_ADVANCED (dance_flsh_each, dance_flsh_finished, dance_flsh_reset) | ||
| 431 | }; | 488 | }; |
| 432 | ``` | 489 | ``` |
| 433 | 490 | ||
diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index 3bf2b34f8..6c03e1650 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk | |||
| @@ -107,6 +107,10 @@ flip: $(BUILD_DIR)/$(TARGET).hex | |||
| 107 | batchisp -hardware usb -device $(MCU) -operation start reset 0 | 107 | batchisp -hardware usb -device $(MCU) -operation start reset 0 |
| 108 | 108 | ||
| 109 | dfu: $(BUILD_DIR)/$(TARGET).hex sizeafter | 109 | dfu: $(BUILD_DIR)/$(TARGET).hex sizeafter |
| 110 | until dfu-programmer $(MCU) get bootloader-version; do\ | ||
| 111 | echo "Error: Bootloader not found. Trying again in 5s." ;\ | ||
| 112 | sleep 5 ;\ | ||
| 113 | done | ||
| 110 | ifneq (, $(findstring 0.7, $(shell dfu-programmer --version 2>&1))) | 114 | ifneq (, $(findstring 0.7, $(shell dfu-programmer --version 2>&1))) |
| 111 | dfu-programmer $(MCU) erase --force | 115 | dfu-programmer $(MCU) erase --force |
| 112 | else | 116 | else |
diff --git a/tmk_core/protocol/lufa/descriptor.c b/tmk_core/protocol/lufa/descriptor.c index 850a20fdb..539a58d66 100644 --- a/tmk_core/protocol/lufa/descriptor.c +++ b/tmk_core/protocol/lufa/descriptor.c | |||
| @@ -140,9 +140,9 @@ const USB_Descriptor_HIDReport_Datatype_t PROGMEM ExtrakeyReport[] = | |||
| 140 | HID_RI_USAGE(8, 0x80), /* System Control */ | 140 | HID_RI_USAGE(8, 0x80), /* System Control */ |
| 141 | HID_RI_COLLECTION(8, 0x01), /* Application */ | 141 | HID_RI_COLLECTION(8, 0x01), /* Application */ |
| 142 | HID_RI_REPORT_ID(8, REPORT_ID_SYSTEM), | 142 | HID_RI_REPORT_ID(8, REPORT_ID_SYSTEM), |
| 143 | HID_RI_LOGICAL_MINIMUM(16, 0x0001), | 143 | HID_RI_LOGICAL_MINIMUM(16, 0x0081), |
| 144 | HID_RI_LOGICAL_MAXIMUM(16, 0x00B7), | 144 | HID_RI_LOGICAL_MAXIMUM(16, 0x00B7), |
| 145 | HID_RI_USAGE_MINIMUM(16, 0x0001), /* System Power Down */ | 145 | HID_RI_USAGE_MINIMUM(16, 0x0081), /* System Power Down */ |
| 146 | HID_RI_USAGE_MAXIMUM(16, 0x00B7), /* System Display LCD Autoscale */ | 146 | HID_RI_USAGE_MAXIMUM(16, 0x00B7), /* System Display LCD Autoscale */ |
| 147 | HID_RI_REPORT_SIZE(8, 16), | 147 | HID_RI_REPORT_SIZE(8, 16), |
| 148 | HID_RI_REPORT_COUNT(8, 1), | 148 | HID_RI_REPORT_COUNT(8, 1), |
