summaryrefslogtreecommitdiff
path: root/keyboards/hhkb/keymaps
diff options
context:
space:
mode:
authorBlake Dietz <blakedietz@gmail.com>2017-06-24 22:46:07 -0600
committerBlake Dietz <blakedietz@gmail.com>2017-06-24 22:46:07 -0600
commitdaf16535f1a8dfe997065bf9957a7e248fe476db (patch)
treea235d764d1296d68f516ef8e13ff4ccff9a6cef7 /keyboards/hhkb/keymaps
parent62c77e7dbf0ac6d52448886bc6e1fda7551f94f5 (diff)
downloadqmk_firmware-daf16535f1a8dfe997065bf9957a7e248fe476db.tar.gz
qmk_firmware-daf16535f1a8dfe997065bf9957a7e248fe476db.zip
Add keymaps for ergodox ez, hhkb and jd45 under user blakedietz
Diffstat (limited to 'keyboards/hhkb/keymaps')
-rw-r--r--keyboards/hhkb/keymaps/blakedietz/Makefile2
-rw-r--r--keyboards/hhkb/keymaps/blakedietz/README.md134
-rw-r--r--keyboards/hhkb/keymaps/blakedietz/config.h24
-rw-r--r--keyboards/hhkb/keymaps/blakedietz/keymap.c122
4 files changed, 282 insertions, 0 deletions
diff --git a/keyboards/hhkb/keymaps/blakedietz/Makefile b/keyboards/hhkb/keymaps/blakedietz/Makefile
new file mode 100644
index 0000000000..7c16b2c98d
--- /dev/null
+++ b/keyboards/hhkb/keymaps/blakedietz/Makefile
@@ -0,0 +1,2 @@
+TAP_DANCE_ENABLE = no
+UNICODE_ENABLE = no
diff --git a/keyboards/hhkb/keymaps/blakedietz/README.md b/keyboards/hhkb/keymaps/blakedietz/README.md
new file mode 100644
index 0000000000..c0f7fde7ad
--- /dev/null
+++ b/keyboards/hhkb/keymaps/blakedietz/README.md
@@ -0,0 +1,134 @@
+# QMK HHKB Keymap: blakedietz
+
+<!-- TODO: Link to Hasu's geekhack page from his name -->
+<!-- TODO: Link to the ergodox ez layout in this repository -->
+
+This is my (Blake Dietz's) own take on a QMK keymap for the Happy Hacking Keyboard Pro 2 alternate controller made by Hasu. A lot of the
+ functionality was inspired by the ergodox ez default layout.
+
+## Dependencies
+
+### macOS
+
+```bash
+brew tap osx-cross/avr
+brew install avr-libc
+brew install dfu-programmer
+```
+
+### Windows/Linux
+
+[Build Environment Setup](https://github.com/jackhumbert/qmk_firmware/wiki#build-environment-setup)
+
+## Flashing
+
+You will need to make sure that you have something that you can use to press the button on the alternate controller in
+order to put it into boot mode.
+
+From the hhkb directory run the following:
+
+```bash
+make clean
+make hhkb-blakedietz-dfu
+```
+
+Press the button on the alternate controller to put the board into boot mode.
+
+You'll see an output similar to the following:
+
+```bash
+make hhkb-blakedietz-dfu
+
+Making hhkb with keymap blakedietz and target dfu
+
+avr-gcc (GCC) 6.2.0
+Copyright (C) 2016 Free Software Foundation, Inc.
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+Size before:
+ text data bss dec hex filename
+ 0 22162 0 22162 5692 hhkb_blakedietz.hex
+
+Compiling: keyboards/hhkb/keymaps/blakedietz/keymap.c [OK]
+Compiling: ./tmk_core/common/command.c [OK]
+Linking: .build/hhkb_blakedietz.elf [OK]
+Creating load file for Flash: .build/hhkb_blakedietz.hex [OK]
+
+Size after:
+ text data bss dec hex filename
+ 0 22162 0 22162 5692 hhkb_blakedietz.hex
+
+dfu-programmer: no device present.
+Error: Bootloader not found. Trying again in 5s.
+dfu-programmer: no device present.
+Error: Bootloader not found. Trying again in 5s.
+Bootloader Version: 0x00 (0)
+Erasing flash... Success
+Checking memory from 0x0 to 0x6FFF... Empty.
+Checking memory from 0x0 to 0x56FF... Empty.
+0% 100% Programming 0x5700 bytes...
+[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success
+0% 100% Reading 0x7000 bytes...
+[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success
+Validating... Success
+0x5700 bytes written into 0x7000 bytes memory (77.68%).
+```
+
+### Layers
+
+#### Default
+
+##### A more "standard" layout
+
+This layout places tilde in the standard location. Backspace is moved to the two upper-right-most keys and pipe
+is put back where it belongs (where backspace is on the default hhkb2 keymapping).
+
+##### Hyper key
+
+<!-- TODO: Link to Brett's article about the thyper key -->
+
+This layout throws out the HHKB's control key in favor of a Hyper key. Ctrl is instead placed on the z and / keys and
+can be activated with a long press. I find that this is far more ergonomic as it's less of a reach and it allows you to
+alternate to either hand when you need to use `ctrl` as a modifier.
+
+The hyper key can be held for hyper and tapped for escape. You'll find that this is quite nice for vim.
+
+Enter is also a hyper key. This allows for symmetry between control and enter. Hold for hyper, tap for enter.
+
+##### Tap to Hold
+
+###### CTL, ALT, GUI
+
+Since the HHKB does not have three super/meta keys, these keys were moved to pinky, ring and middle finger for ctrl, alt/
+ option and super respectively. This is closer to home row which I've found causes less strain.
+
+The Alt and Super keys are instead replaced with layer toggle keys to go to dev and mouse mode respectively.
+
+###### Space
+
+Hold space to switch to dev mode. This will put you on a layer to have vim like arrow functionality on h,j,k and l. Use
+this in editors that don't have vim keybindings.
+
+### Dev
+
+The Dev layer can be activated holding space or hitting the HHKB's Alt key. This will put you in a mode
+where all function keys are available and left, right, up and down are mapped to their vim equivalents. The function
+ keys are mapped in such a way that you can use them for debugging. Typically I map debugging functions in all IDEs to
+ the following for a seamless debugging experience (e.g. jumping from Intellij to chrome dev tools and back):
+
+ - f1 -> step over
+ - f2 -> step into
+ - f3 -> step out
+ - f4 -> continue
+ - f5 -> set break point on current line
+
+### Media
+
+The media layer can be activated by pressing and holding the semi-colon. I've also placed the play and pause key on the
+apostrophe key in the media layer. This allows you to easily roll your pinky from the media toggle (semi-colon) to the
+play/pause key in one fluid motion.
+
+I've also tried to logically map next/previous track along with volume up/down vim behavior. In vim since middle finger
+goes up on k and index finger goes down on j, next/prev track is k/j respectively. ,/m changes volume up/down
+respectively while toggled to the media layer.
diff --git a/keyboards/hhkb/keymaps/blakedietz/config.h b/keyboards/hhkb/keymaps/blakedietz/config.h
new file mode 100644
index 0000000000..e0d2bce0f1
--- /dev/null
+++ b/keyboards/hhkb/keymaps/blakedietz/config.h
@@ -0,0 +1,24 @@
+// Based off of this section:
+// https://github.com/qmk/qmk_firmware/blob/master/doc/BUILD_GUIDE.md#the-configh-file
+#ifndef CONFIG_BLAKEDIETZ_H
+#define CONFIG_BLAKEDIETZ_H
+
+// Bring in original defaults
+#include "../../config.h"
+
+// Define mousekey settings
+#define MOUSEKEY_DELAY 0
+#define MOUSEKEY_INTERVAL 20
+#define MOUSEKEY_MAX_SPEED 2
+#define MOUSEKEY_TIME_TO_MAX 5
+#define MOUSEKEY_WHEEL_DELAY 0
+
+// Set up tapdance functionality
+//#define TAPPING_TOGGLE 1
+// TAPPING_TERM is set in config.h this defaults to 200
+
+// This makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when
+// you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.)
+#define IGNORE_MOD_TAP_INTERRUPT
+
+#endif
diff --git a/keyboards/hhkb/keymaps/blakedietz/keymap.c b/keyboards/hhkb/keymaps/blakedietz/keymap.c
new file mode 100644
index 0000000000..ef29a5c80d
--- /dev/null
+++ b/keyboards/hhkb/keymaps/blakedietz/keymap.c
@@ -0,0 +1,122 @@
+#include "hhkb.h"
+
+// Layer names
+#define BASE 0
+#define DEV 1
+#define MOUSE 2
+#define MEDIA 3
+
+// Required for leader function. Measured in ms
+// #define LEADER_TIMEOUT 300
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+ /* BASE Level: Default Layer
+ |-----------+-------+--------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+------+----|
+ | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bksp |Lead|
+ |-----------+-------+--------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+------+----|
+ | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | | \ |
+ |-----------+-------+--------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+------+----|
+ | Esc/Hyper | A | S | D | F | G | H | J | K | L |;/Media| ' | Enter | | |
+ |-----------+-------+--------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+------+----|
+ | Shift | Z/Ctl | X/Alt | C/Gui | V | B | N | M | ,/Gui | ./Alt | //Ctl | Shift | Dev | | |
+ |-----------+-------+--------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+------+----|
+ TODO: Maybe add a photoshop layer for when I need to hold spacebar down. Maybe just make it a layer that you
+ |------+------+-----------------------+------+------|
+ | Dev |Mouse | ******* Space ******* | Dev |Mouse |
+ |------+------+-----------------------+------+------|
+ */
+
+ [BASE] = KEYMAP( // default layer
+ KC_GRV, 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, KC_LEAD, \
+ 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, \
+ ALL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(MEDIA, KC_SCLN), KC_QUOT, ALL_T(KC_ENT), \
+ KC_LSFT, CTL_T(KC_Z), ALT_T(KC_X), GUI_T(KC_C), KC_V, KC_B, KC_N, KC_M, GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_SLSH), KC_RSFT, TG(DEV), \
+ TG(DEV), TG(MOUSE), LT(DEV, KC_SPC), TG(MOUSE), TG(DEV)),
+
+ /* Layer DEV: DEV mode (DEV Fn)
+ TODO: Add a cmd/tab function to the developer layer for quick switching between different applications when debugging
+ |------+-----+-----+-----+----+----+--------+----------------+--------------+-----------+-------------+-----+-------+-------+-----|
+ | | | | | | | | | | | | | | | |
+ |------+-----+-----+-----+----+----+--------+----------------+--------------+-----------+-------------+-----+-------+-------+-----|
+ | | | | | | | | | | | | | | | |
+ |------+-----+-----+-----+----+----+--------+----------------+--------------+-----------+-------------+-----+-------+-------+-----|
+ | | F1 | F2 | F3 | F4 | F5 | Left | Down | Up | Right | | | | | |
+ |------+-----+-----+-----+----+----+--------+----------------+--------------+-----------+-------------+-----+-------+-------+-----|
+ | | | | | | | | | | | | | | | |
+ |------+-----+-----+-----+----+----+--------+----------------+--------------+-----------+-------------+-----+-------+-------+-----|
+
+ |------+------+----------------------+------+------+
+ | **** | **** | ******************** | **** | **** |
+ |------+------+----------------------+------+------+
+ */
+
+ [DEV] = KEYMAP(
+ 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, 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, KC_TRNS, \
+ KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, 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, KC_TRNS, TG(DEV), \
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
+
+ /* Layer MOUSE: MOUSE mode (MOUSE Fn)
+ |------+-----+-----+-----+----+----+--------+----------------+--------------+-----------+-------------+-----+-------+-------+-----|
+ | | | | | | | | | | | | | | | |
+ |------+-----+-----+-----+----+----+--------+----------------+--------------+-----------+-------------+-----+-------+-------+-----|
+ | | | | | | | | | | | | | | | |
+ |------+-----+-----+-----+----+----+--------+----------------+--------------+-----------+-------------+-----+-------+-------+-----|
+ | | | | | | | | | | | | | | | |
+ |------+-----+-----+-----+----+----+--------+----------------+--------------+-----------+-------------+-----+-------+-------+-----|
+ | | | | | | | | | | | | | | | |
+ |------+-----+-----+-----+----+----+--------+----------------+--------------+-----------+-------------+-----+-------+-------+-----|
+
+ |------+------+----------------------+------+------+
+ | **** | **** | ******************** | **** | **** |
+ |------+------+----------------------+------+------+
+ */
+
+ [MOUSE] = KEYMAP(
+ 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, KC_TRNS, \
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, KC_WH_D, KC_WH_U, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
+ KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, 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, KC_TRNS, KC_TRNS, TG(DEV), \
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
+
+ /* Layer MEDIA: mode (Hold Semi-colon)
+ |------+-----+-----+-----+----+----+----+----------------+--------------+-----------+-------------+-----+-------+-------+-----|
+ | | | | | | | | | | | | | | | |
+ |------+-----+-----+-----+----+----+----+----------------+--------------+-----------+-------------+-----+-------+-------+-----|
+ | | | | | | | | | | | | | | | |
+ |------+-----+-----+-----+----+----+----+----------------+--------------+-----------+-------------+-----+-------+-------+-----|
+ | | | | | | | | Previous | Next | | Play/Pause | | | | |
+ |------+-----+-----+-----+----+----+----+----------------+--------------+-----------+-------------+-----+-------+-------+-----|
+ | | | | | | | | Volume Down | Volume Up | Mute | | | | | |
+ |------+-----+-----+-----+----+----+----+----------------+--------------+-----------+-------------+-----+-------+-------+-----|
+
+ |------+------+----------------------+------+------+
+ | **** | **** | ******************** | **** | **** |
+ |------+------+----------------------+------+------+
+
+ */
+
+ [MEDIA] = KEYMAP(
+ 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, 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, KC_TRNS, \
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_MUTE, KC_TRNS, KC_MPLY, KC_TRNS, \
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, TG(DEV), \
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS)
+};
+
+const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
+{
+ // MACRODOWN only works in this function
+ switch(id) {
+ case 0:
+ if (record->event.pressed) {
+ register_code(KC_RSFT);
+ } else {
+ unregister_code(KC_RSFT);
+ }
+ break;
+ }
+ return MACRO_NONE;
+};