diff options
| author | dkrieger <dougkrieger@gmail.com> | 2017-11-01 21:29:23 -0400 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2017-11-01 21:29:23 -0400 |
| commit | 19753788c1404f43f2a3000a68c336170cb7eb5c (patch) | |
| tree | e381fba04686d6cf0f993aa9b780b21c445e420e | |
| parent | 54a8abd785d46c879dfedb740df782b20521e086 (diff) | |
| download | qmk_firmware-19753788c1404f43f2a3000a68c336170cb7eb5c.tar.gz qmk_firmware-19753788c1404f43f2a3000a68c336170cb7eb5c.zip | |
Add satan keymap: HHKB-alike based on dbroqua's, with mouse functionality (#1948)
* Add satan keymap: HHKB-alike based on dbroqua's, with mouse functionality and without LED functionality
* move mouse layer to DOUBLE_HOLD, add UTIL layer for TRIPLE_HOLD
- UTIL layer
- currently has "RESET" key and nothing else.
- functionality otherwise covered by bootmagic should go here
- small bugfix: dispatch of [QTY]_HOLD should be based on range tap count
falls in, not exact count.
| -rw-r--r-- | keyboards/satan/keymaps/dkrieger/config.h | 26 | ||||
| -rw-r--r-- | keyboards/satan/keymaps/dkrieger/keymap.c | 167 | ||||
| -rw-r--r-- | keyboards/satan/keymaps/dkrieger/readme.md | 23 | ||||
| -rw-r--r-- | keyboards/satan/keymaps/dkrieger/rules.mk | 22 |
4 files changed, 238 insertions, 0 deletions
diff --git a/keyboards/satan/keymaps/dkrieger/config.h b/keyboards/satan/keymaps/dkrieger/config.h new file mode 100644 index 000000000..faea4d660 --- /dev/null +++ b/keyboards/satan/keymaps/dkrieger/config.h | |||
| @@ -0,0 +1,26 @@ | |||
| 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.h" | ||
| 22 | |||
| 23 | /* Tap Dance */ | ||
| 24 | #define TAPPING_TERM 200 | ||
| 25 | |||
| 26 | #endif | ||
diff --git a/keyboards/satan/keymaps/dkrieger/keymap.c b/keyboards/satan/keymaps/dkrieger/keymap.c new file mode 100644 index 000000000..5e88498b0 --- /dev/null +++ b/keyboards/satan/keymaps/dkrieger/keymap.c | |||
| @@ -0,0 +1,167 @@ | |||
| 1 | #include "satan.h" | ||
| 2 | #include "action_layer.h" | ||
| 3 | |||
| 4 | #define _DEFAULT 0 | ||
| 5 | #define _FN 1 | ||
| 6 | #define _MOUSE 2 | ||
| 7 | #define _MOUSESHIFT 3 | ||
| 8 | #define _UTIL 4 | ||
| 9 | |||
| 10 | // Fillers to make layering more clear | ||
| 11 | #define ______ KC_TRNS | ||
| 12 | |||
| 13 | enum { | ||
| 14 | SUPER_FN = 0, | ||
| 15 | SINGLE_HOLD = 1, | ||
| 16 | DOUBLE_HOLD = 2, | ||
| 17 | TRIPLE_HOLD = 3 | ||
| 18 | }; | ||
| 19 | |||
| 20 | typedef struct { | ||
| 21 | bool is_press_action; | ||
| 22 | int state; | ||
| 23 | } tap; | ||
| 24 | |||
| 25 | int cur_dance (qk_tap_dance_state_t *state) { | ||
| 26 | if (state->interrupted == false || state->pressed) { | ||
| 27 | if (state->count < 2) return SINGLE_HOLD; | ||
| 28 | if (state->count < 3) return DOUBLE_HOLD; | ||
| 29 | else return TRIPLE_HOLD; | ||
| 30 | } | ||
| 31 | else return 9; | ||
| 32 | } | ||
| 33 | |||
| 34 | //instantiate an instance of 'tap' for the 'fn' tap dance. | ||
| 35 | static tap fn_tap_state = { | ||
| 36 | .is_press_action = true, | ||
| 37 | .state = 0 | ||
| 38 | }; | ||
| 39 | |||
| 40 | void fn_finished (qk_tap_dance_state_t *state, void *user_data) { | ||
| 41 | fn_tap_state.state = cur_dance(state); | ||
| 42 | switch (fn_tap_state.state) { | ||
| 43 | /* case SINGLE_HOLD: register_code(MO(_FN)); break; */ | ||
| 44 | case SINGLE_HOLD: layer_on(_FN); break; | ||
| 45 | case DOUBLE_HOLD: layer_on(_MOUSE); break; | ||
| 46 | case TRIPLE_HOLD: layer_on(_UTIL); | ||
| 47 | } | ||
| 48 | } | ||
| 49 | |||
| 50 | void fn_reset (qk_tap_dance_state_t *state, void *user_data) { | ||
| 51 | switch (fn_tap_state.state) { | ||
| 52 | case SINGLE_HOLD: layer_off(_FN); break; | ||
| 53 | case DOUBLE_HOLD: layer_off(_MOUSE); layer_off(_MOUSESHIFT); break; | ||
| 54 | case TRIPLE_HOLD: layer_off(_UTIL); | ||
| 55 | } | ||
| 56 | } | ||
| 57 | |||
| 58 | qk_tap_dance_action_t tap_dance_actions[] = { | ||
| 59 | [SUPER_FN] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, fn_finished, fn_reset) | ||
| 60 | }; | ||
| 61 | |||
| 62 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 63 | /* Qwerty gui/alt/space/alt/gui | ||
| 64 | * ,-----------------------------------------------------------------------------------------. | ||
| 65 | * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` | | ||
| 66 | * |-----------------------------------------------------------------------------------------+ | ||
| 67 | * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Bksp | | ||
| 68 | * |-----------------------------------------------------------------------------------------+ | ||
| 69 | * | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | Enter | | ||
| 70 | * |-----------------------------------------------------------------------------------------+ | ||
| 71 | * | Shift | Z | X | C | V | B | N | M | , | . | / | RShift | FN | | ||
| 72 | * |-----------------------------------------------------------------------------------------+ | ||
| 73 | * |LGUI | LAlt | Space | RAlt |RGUI | | ||
| 74 | * `-----------------------------------------------------------------' | ||
| 75 | */ | ||
| 76 | [_DEFAULT] = KEYMAP_HHKB( /* Basic QWERTY */ | ||
| 77 | 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_BSLS, KC_GRV, \ | ||
| 78 | 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_BSPC, \ | ||
| 79 | KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ | ||
| 80 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, TD(SUPER_FN), \ | ||
| 81 | ______, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, ______, ______ \ | ||
| 82 | ), | ||
| 83 | |||
| 84 | /* FN Layer | ||
| 85 | * ,-----------------------------------------------------------------------------------------. | ||
| 86 | * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del | | ||
| 87 | * |-----------------------------------------------------------------------------------------+ | ||
| 88 | * | CAPS | BL- | BL+ | BL | | | | | Psc | Slck| Paus| Up | | | | ||
| 89 | * |-----------------------------------------------------------------------------------------+ | ||
| 90 | * | | Vol-| Vol+| Mute| | | * | / | Home| PgUp| Left|Right| | | ||
| 91 | * |-----------------------------------------------------------------------------------------+ | ||
| 92 | * | | Prev| Play| Next| | | + | - | End |PgDn| Down| | | | ||
| 93 | * |-----------------------------------------------------------------------------------------+ | ||
| 94 | * | | | | Stop | | | ||
| 95 | * `-----------------------------------------------------------------' | ||
| 96 | */ | ||
| 97 | [_FN] = KEYMAP_HHKB( /* Layer 1 */ | ||
| 98 | ______, 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_INS, KC_DEL, \ | ||
| 99 | KC_CAPS, ______, ______, ______, ______, ______, ______, ______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, ______, ______, \ | ||
| 100 | ______, KC_VOLD,KC_VOLU,KC_MUTE,______, ______, KC_PAST,KC_PSLS,KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, ______, \ | ||
| 101 | ______, KC_MPRV,KC_MPLY,KC_MNXT,______, ______, KC_PPLS,KC_PMNS,KC_END, KC_PGDN, KC_DOWN, ______, ______, \ | ||
| 102 | ______, ______, ______, ______, KC_MSTP, ______, ______, ______ \ | ||
| 103 | ), | ||
| 104 | |||
| 105 | /* MOUSE Layer | ||
| 106 | * ,-----------------------------------------------------------------------------------------. | ||
| 107 | * | | | | | | | | | | | | | | |RESET| | ||
| 108 | * |----------------------------------------------------------------------------------------- | ||
| 109 | * | | | | | | | | | | | |UCurs| | | | ||
| 110 | * |----------------------------------------------------------------------------------------- | ||
| 111 | * | | | | | | | | | | |LCurs|RCurs| | | ||
| 112 | * |----------------------------------------------------------------------------------------- | ||
| 113 | * | ScrollHold| | | | | | | | | |DCurs| ScrollHold| | | ||
| 114 | * |-----------------------------------------------------------------------------------------+ | ||
| 115 | * | | | LClick | MClick| RClick| | ||
| 116 | * `-----------------------------------------------------------------' | ||
| 117 | */ | ||
| 118 | [_MOUSE] = KEYMAP_HHKB( | ||
| 119 | ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, RESET, \ | ||
| 120 | ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_MS_UP, ______, ______, \ | ||
| 121 | ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_MS_LEFT, KC_MS_RIGHT, ______, \ | ||
| 122 | MO(_MOUSESHIFT), ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_MS_DOWN, MO(_MOUSESHIFT), ______, \ | ||
| 123 | ______, ______, ______, KC_MS_BTN1, KC_MS_BTN3, KC_MS_BTN2, ______, ______ \ | ||
| 124 | ), | ||
| 125 | |||
| 126 | /* MOUSESHIFT Layer | ||
| 127 | * ,-----------------------------------------------------------------------------------------. | ||
| 128 | * | | | | | | | | | | | | | | | | | ||
| 129 | * |----------------------------------------------------------------------------------------- | ||
| 130 | * | | | | | | | | | | | |UScrl| | | | ||
| 131 | * |----------------------------------------------------------------------------------------- | ||
| 132 | * | | | | | | | | | | |LScrl|RScrl| | | ||
| 133 | * |----------------------------------------------------------------------------------------- | ||
| 134 | * | | | | | | | | | | |DScrl| | | | ||
| 135 | * |-----------------------------------------------------------------------------------------+ | ||
| 136 | * | | | | | | | ||
| 137 | * `-----------------------------------------------------------------' | ||
| 138 | */ | ||
| 139 | [_MOUSESHIFT] = KEYMAP_HHKB( | ||
| 140 | ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ | ||
| 141 | ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_MS_WH_UP, ______, ______, \ | ||
| 142 | ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_MS_WH_LEFT, KC_MS_WH_RIGHT, ______, \ | ||
| 143 | ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_MS_WH_DOWN, ______, ______, \ | ||
| 144 | ______, ______, ______, ______, ______, ______, ______, ______ \ | ||
| 145 | ), | ||
| 146 | |||
| 147 | /* UTIL Layer | ||
| 148 | * ,-----------------------------------------------------------------------------------------. | ||
| 149 | * | | | | | | | | | | | | | | |RESET| | ||
| 150 | * |----------------------------------------------------------------------------------------- | ||
| 151 | * | | | | | | | | | | | | | | | | ||
| 152 | * |----------------------------------------------------------------------------------------- | ||
| 153 | * | | | | | | | | | | | | | | | ||
| 154 | * |----------------------------------------------------------------------------------------- | ||
| 155 | * | | | | | | | | | | | | | | | ||
| 156 | * |-----------------------------------------------------------------------------------------+ | ||
| 157 | * | | | | | | | ||
| 158 | * `-----------------------------------------------------------------' | ||
| 159 | */ | ||
| 160 | [_UTIL] = KEYMAP_HHKB( | ||
| 161 | ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, RESET, \ | ||
| 162 | ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ | ||
| 163 | ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ | ||
| 164 | ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ | ||
| 165 | ______, ______, ______, ______, ______, ______, ______, ______ \ | ||
| 166 | ) | ||
| 167 | }; | ||
diff --git a/keyboards/satan/keymaps/dkrieger/readme.md b/keyboards/satan/keymaps/dkrieger/readme.md new file mode 100644 index 000000000..894113239 --- /dev/null +++ b/keyboards/satan/keymaps/dkrieger/readme.md | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | # dkrieger HHKB like Layout | ||
| 2 | |||
| 3 | Base derived from dbroqua (special thanks) | ||
| 4 | |||
| 5 | Based on HHKB with the following [dip switches][1] engaged: | ||
| 6 | |||
| 7 | - SW3: delete key -> backspace | ||
| 8 | - SW5: swap alt and meta keys | ||
| 9 | - SW2: Mac Mode (partial implementation, includes media keys | ||
| 10 | - Note: this was copied from dbroqua, there seem to have been some | ||
| 11 | modifications from stock Mac Mode | ||
| 12 | |||
| 13 | Additionally, this layout includes a mouse layer engaged by tapping Fn 3 times, | ||
| 14 | holding on the third time. The arrow keys move the mouse, scrolling when shift | ||
| 15 | is held (either left or right). Right alt is left click, right meta is right | ||
| 16 | click. | ||
| 17 | |||
| 18 | # Programming Instructions: | ||
| 19 | Enter into programming mode and run the following command. | ||
| 20 | ``` | ||
| 21 | $ sudo KEYMAP=dkrieger_hhkb make dfu | ||
| 22 | ``` | ||
| 23 | [1]: http://www.elitekeyboards.com/products.php?sub=pfu_keyboards,hhkbpro2&pid=pdkb400b | ||
diff --git a/keyboards/satan/keymaps/dkrieger/rules.mk b/keyboards/satan/keymaps/dkrieger/rules.mk new file mode 100644 index 000000000..4c280ceb0 --- /dev/null +++ b/keyboards/satan/keymaps/dkrieger/rules.mk | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | # Build Options | ||
| 2 | # change to "no" to disable the options, or define them in the Makefile in | ||
| 3 | # the appropriate keymap folder that will get included automatically | ||
| 4 | # | ||
| 5 | BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) | ||
| 6 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) | ||
| 7 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | ||
| 8 | CONSOLE_ENABLE = yes # Console for debug(+400) | ||
| 9 | COMMAND_ENABLE = yes # Commands for debug and configuration | ||
| 10 | NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
| 11 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
| 12 | MIDI_ENABLE = no # MIDI controls | ||
| 13 | AUDIO_ENABLE = no # Audio output on port C6 | ||
| 14 | UNICODE_ENABLE = no # Unicode | ||
| 15 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID | ||
| 16 | RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. | ||
| 17 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
| 18 | TAP_DANCE_ENABLE = yes | ||
| 19 | |||
| 20 | ifndef QUANTUM_DIR | ||
| 21 | include ../../../../Makefile | ||
| 22 | endif | ||
