Merge pull request #880 from psyill/master

Added keymap "videck", an ErgoDox keymap for Vi(m) users.
This commit is contained in:
Jack Humbert 2016-11-16 14:54:18 -05:00 committed by GitHub
commit 9f1b27c5ba
6 changed files with 678 additions and 0 deletions

View File

@ -0,0 +1,19 @@
AUDIO_ENABLE:=no
BACKLIGHT_ENABLE:=no
BLUETOOTH_ENABLE:=no
BOOTMAGIC_ENABLE:=no
COMMAND_ENABLE:=no
CONSOLE_ENABLE:=no
EXTRAKEY_ENABLE:=yes
MIDI_ENABLE:=no
MOUSEKEY_ENABLE:=yes
NKRO_ENABLE:=no
RGBLIGHT_ENABLE:=no
SLEEP_LED_ENABLE:=no
TAP_DANCE_ENABLE:=yes
UNICODEMAP_ENABLE:=no
UNICODE_ENABLE:=no
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

View File

@ -0,0 +1,13 @@
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include "../../config.h"
#ifndef NO_DEBUG
#define NO_DEBUG
#endif
#ifndef NO_PRINT
#define NO_PRINT
#endif
#endif

View File

@ -0,0 +1,179 @@
#include <stdbool.h>
#include "ergodox.h"
#include "action_layer.h"
enum {
BASE = 0, // Default layer
ARROWS = 1, // Arrows and Fx keys layer
MOUSE = 2, // Mouse movement and buttons layer
PARENS = 3, // Parenthesis easy access layer
TD_L = 0, // Tap dance index for left shift
TD_R = 1 // Tap dance index for right shift
};
// See the videck.png image for a visualization of the layout.
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[BASE] = KEYMAP(
// left hand
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_HOME,
KC_EQL, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_END,
MO(PARENS), KC_A, KC_S, KC_D, KC_F, KC_G,
TD(TD_L), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BSPC,
KC_LCTL, KC_LALT, KC_VOLD, KC_VOLU, KC_MUTE,
KC_ESC, KC_LGUI,
TG(MOUSE),
KC_SPC, KC_TAB, TG(ARROWS),
// right hand
KC_PGUP, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
KC_PGDN, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
KC_DELT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TD(TD_R),
KC_LBRC, KC_RBRC, KC_EQL, KC_RALT, KC_RCTL,
KC_APP, KC_ESC,
KC_INS,
KC_SLCK, KC_ENT, KC_SPC
),
[ARROWS] = KEYMAP(
// left hand
KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, 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_NO,
KC_TRNS, KC_TRNS, KC_TRNS,
// right hand
KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F12,
KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, 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
),
[MOUSE] = KEYMAP(
// left hand
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_BTN3, KC_TRNS,
KC_TRNS,
KC_BTN1, KC_BTN2, KC_NO,
// right hand
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_L, KC_MS_D, KC_MS_U, KC_MS_R, 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
),
[PARENS] = KEYMAP(
// left hand
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_NO,
KC_TRNS, KC_TRNS, KC_NO,
// right hand
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LCBR, KC_RCBR, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_LPRN, KC_RPRN, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS,
KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS
)
};
typedef void (*videck_tap_dance_trigger_t) (const uint16_t kc);
typedef struct
{
uint16_t kc1;
uint16_t kc2;
videck_tap_dance_trigger_t trigger;
} videck_tap_dance_tuple_t;
static void videck_tap_dance_finished (qk_tap_dance_state_t *state, void *user_data) {
videck_tap_dance_tuple_t *const tuple = (videck_tap_dance_tuple_t *)user_data;
if (state->count == 1) {
register_code16 (tuple->kc1);
} else if (state->count == 2) {
register_code16 (tuple->kc2);
}
}
static void videck_tap_dance_reset (qk_tap_dance_state_t *state, void *user_data) {
videck_tap_dance_tuple_t *const tuple = (videck_tap_dance_tuple_t *)user_data;
if (state->count == 1) {
unregister_code16 (tuple->kc1);
} else if (state->count == 2) {
unregister_code16 (tuple->kc2);
tuple->trigger(tuple->kc2);
}
}
static bool caps_lock_is_on;
// Toggles caps lock status.
static void videck_caps_trigger (const uint16_t kc) {
caps_lock_is_on ^= true;
}
#define ACTION_TAP_DANCE_DOUBLE_TRIGGER(kc1, kc2, double_trigger) { \
.fn = { NULL, videck_tap_dance_finished, videck_tap_dance_reset }, \
.user_data = (void *)&((videck_tap_dance_tuple_t) { kc1, kc2, double_trigger }), \
}
qk_tap_dance_action_t tap_dance_actions[] = {
[TD_L] = ACTION_TAP_DANCE_DOUBLE_TRIGGER(KC_LSFT, KC_CAPS, videck_caps_trigger),
[TD_R] = ACTION_TAP_DANCE_DOUBLE_TRIGGER(KC_RSFT, KC_CAPS, videck_caps_trigger)
};
// Runs just one time when the keyboard initializes.
void matrix_init_user(void) {
ergodox_led_all_set(LED_BRIGHTNESS_LO);
caps_lock_is_on = false;
};
static void indicate_using_led(const uint8_t led, const bool enabled) {
if (enabled) {
ergodox_right_led_on(led);
} else {
ergodox_right_led_off(led);
}
}
static inline void indicate_caps_lock_state(const bool enabled) {
indicate_using_led(1, enabled);
}
static inline void indicate_arrows_layer_state(const bool enabled) {
indicate_using_led(2, enabled);
}
static inline void indicate_mouse_layer_state(const bool enabled) {
indicate_using_led(3, enabled);
}
// Runs constantly in the background, in a loop.
void matrix_scan_user(void) {
// Check if we have shift locked.
indicate_caps_lock_state(caps_lock_is_on);
indicate_arrows_layer_state(IS_LAYER_ON(ARROWS));
indicate_mouse_layer_state(IS_LAYER_ON(MOUSE));
};

View File

@ -0,0 +1,24 @@
ViDeck keymap for ErgoDox
=========================
This is a QWERTY layout based on the US layout, where Vi functionality has been
especially considered.
# Features
* Mouse movements using the Vi movement keys.
* Vi movement keys doubling as arrow keys.
* Shift lock using double tap.
* A coder's modifier key for easy input of parenthesis.
* Acess to the escape key using either thumb.
* Reasonably accessible Scroll Lock key (useful if you, like me, want to switch
to a non-US layout once in a while in X).
# Missing keys
* Caps Lock (shift lock is used instead).
* Pause/Break.
* Print Screen.
# LEDs
* Shift lock is indicated using first LED.
* Arrow keys layer is indicated using second LED.
* Mouse keys layer is indicated using third LED.

View File

@ -0,0 +1,443 @@
[
{
"backcolor": "#333333",
"background": {
"name": "PBT Black",
"style": "background-image: url('/bg/plastic/pbt-black.png');"
},
"switchMount": "cherry",
"switchBrand": "gateron",
"switchType": "KS-3-Red"
},
[
{
"x": 3.5,
"c": "#323232",
"t": "#ffffff\n\n\n#ac97d8"
},
"#\n3\n\nF3",
{
"x": 10.5
},
"*\n8\n\nF8"
],
[
{
"y": -0.875,
"x": 2.5
},
"@\n2\n\nF2",
{
"x": 1
},
"$\n4\n\nF4",
{
"x": 8.5
},
"&\n7\n\nF7",
{
"x": 1,
"t": "#ffffff\n\n\n#ac97d8\n\n\n\n#555454"
},
"(\n9\n\nF9"
],
[
{
"y": -0.875,
"x": 5.5,
"t": "#ffffff\n\n\n#ac97d8"
},
"%\n5\n\nF5",
{
"t": "#ffffff"
},
"home",
{
"x": 4.5
},
"pgup",
{
"t": "#ffffff\n\n\n#ac97d8"
},
"^\n6\n\nF6"
],
[
{
"y": -0.875,
"t": "#ffffff",
"w": 1.5
},
"~\n`",
{
"t": "#ffffff\n\n\n#ac97d8"
},
"!\n1\n\nF1",
{
"x": 14.5
},
")\n0\n\nF10",
{
"w": 1.5
},
"_\n-\n\nF11"
],
[
{
"y": -0.375,
"x": 3.5,
"t": "#ffffff"
},
"E",
{
"x": 10.5
},
"I"
],
[
{
"y": -0.875,
"x": 2.5
},
"W",
{
"x": 1
},
"R",
{
"x": 8.5
},
"U",
{
"x": 1,
"t": "#ffffff\n\n\n\n\n\n\n\n\n#f8d615"
},
"O\n\n\n\n\n\n\n\n\n{"
],
[
{
"y": -0.875,
"x": 5.5,
"t": "#ffffff"
},
"T",
{
"h": 1.5
},
"end",
{
"x": 4.5,
"h": 1.5
},
"pgdn",
"Y"
],
[
{
"y": -0.875,
"w": 1.5
},
"+\n=",
"Q",
{
"x": 14.5,
"t": "#ffffff\n\n\n\n\n\n\n\n\n#f8d615"
},
"P\n\n\n\n\n\n\n\n\n}",
{
"t": "#ffffff\n\n\n#ac97d8",
"w": 1.5
},
"|\n\\\n\nF12"
],
[
{
"y": -0.375,
"x": 3.5,
"t": "#ffffff"
},
"D",
{
"x": 10.5,
"t": "#ffffff\n\n#5eb1e7\n#ac97d8"
},
"K\n\n<i class='fa fa-caret-up'></i>\n<i class='kb kb-Arrows-Up'></i>"
],
[
{
"y": -0.875,
"x": 2.5,
"t": "#ffffff"
},
"S",
{
"x": 1,
"n": true
},
"F",
{
"x": 8.5,
"t": "#ffffff\n\n#5eb1e7\n#ac97d8",
"n": true
},
"J\n\n<i class='fa fa-caret-down'></i>\n<i class='kb kb-Arrows-Down'></i>",
{
"x": 1,
"t": "#ffffff\n\n#5eb1e7\n#ac97d8\n\n\n\n\n\n#f8d615"
},
"L\n\n<i class='fa fa-caret-right'></i>\n<i class='kb kb-Arrows-Right'></i>\n\n\n\n\n\n("
],
[
{
"y": -0.875,
"x": 5.5,
"t": "#ffffff"
},
"G",
{
"x": 6.5,
"t": "#ffffff\n\n#5eb1e7\n#ac97d8"
},
"H\n\n<i class='fa fa-caret-left'></i>\n<i class='kb kb-Arrows-Left'></i>"
],
[
{
"y": -0.875,
"t": "#f8d615",
"a": 6,
"w": 1.5
},
"( ) [ ] { }",
{
"t": "#ffffff",
"a": 4
},
"A",
{
"x": 14.5,
"t": "#ffffff\n\n\n\n\n\n\n#60605b\n\n#f8d615"
},
":\n;\n\n\n\n\n\n&Ouml;\n\n)",
{
"t": "#ffffff\n\n\n\n\n\n\n#60605b",
"w": 1.5
},
"\"\n'\n\n\n\n\n\n&Auml;"
],
[
{
"y": -0.625,
"x": 6.5,
"t": "#ffffff",
"h": 1.5
},
"<i class='kb kb-Unicode-BackSpace-DeleteLeft-Big'></i>",
{
"x": 4.5,
"h": 1.5
},
"<i class='kb kb-Unicode-DeleteRight-Big'></i>"
],
[
{
"y": -0.75,
"x": 3.5
},
"C",
{
"x": 10.5
},
"<\n,"
],
[
{
"y": -0.875,
"x": 2.5
},
"X",
{
"x": 1
},
"V",
{
"x": 8.5
},
"M",
{
"x": 1,
"t": "#ffffff\n\n\n\n\n\n\n\n\n#f8d615"
},
">\n.\n\n\n\n\n\n\n\n["
],
[
{
"y": -0.875,
"x": 5.5,
"t": "#ffffff"
},
"B",
{
"x": 6.5
},
"N"
],
[
{
"y": -0.875,
"t": "#ffffff\n\n#f67f00",
"a": 6,
"fa": [
5
],
"w": 1.5
},
"&uArr;\n\n2-tap<br/>locks",
{
"t": "#ffffff",
"a": 4,
"f": 3
},
"Z",
{
"x": 14.5,
"t": "#ffffff\n\n\n\n\n\n\n\n\n#f8d615",
"f": 3
},
"?\n/\n\n\n\n\n\n\n\n]",
{
"t": "#ffffff\n\n#f67f00",
"a": 6,
"f": 3,
"w": 1.5
},
"&uArr;\n\n2-tap<br/>locks"
],
[
{
"y": -0.375,
"x": 3.5,
"t": "#ffffff",
"a": 4
},
"\n<i class='kb kb-Multimedia-Volume-Up-2'></i>",
{
"x": 10.5,
"f": 3
},
"}\n]"
],
[
{
"y": -0.875,
"x": 2.5
},
"\n<i class='kb kb-Multimedia-Volume-Down-1'></i>",
{
"x": 1
},
"\n<i class='kb kb-Multimedia-Mute-1'></i>",
{
"x": 8.5,
"t": "#ffffff\n\n\n\n\n\n\n#60605b",
"f": 3
},
"{\n[\n\n\n\n\n\n&Aring;",
{
"x": 1,
"t": "#ffffff",
"f": 3
},
"+\n="
],
[
{
"y": -0.75,
"x": 0.5,
"f": 3
},
"ctrl",
{
"f": 3
},
"alt",
{
"x": 14.5,
"f": 3
},
"altgr",
{
"f": 3
},
"ctrl"
],
[
{
"r": 30,
"rx": 6.5,
"ry": 4.25,
"y": -1,
"x": 1,
"t": "#ffffff\n\n\n\n\n\n\n\n\n\n#5eb1e7",
"f": 3
},
"esc\n\n\n\n\n\n\n\n\n\n<i class='fa fa-mouse-pointer'></i>M",
{
"t": "#ffffff",
"f": 7
},
"<i class='kb kb-logo-linux-tux'></i>"
],
[
{
"t": "#ffffff\n\n\n\n\n\n\n\n\n\n#5eb1e7",
"f": 3,
"h": 2
},
"space\n\n\n\n\n\n\n\n\n\n<i class='fa fa-mouse-pointer'></i>L",
{
"h": 2
},
"<i class='kb kb-Tab-1'></i>\n\n\n\n\n\n\n\n\n\n<i class='fa fa-mouse-pointer'></i>R",
{
"t": "#5eb1e7"
},
"<i class='fa fa-mouse-pointer'></i>"
],
[
{
"x": 2,
"t": "#ac97d8"
},
"<i class='fa fa-arrows'></i>"
],
[
{
"r": -30,
"rx": 13,
"y": -1,
"x": -3,
"t": "#ffffff"
},
"<i class='kb kb-Hamburger-Menu'></i>",
"esc"
],
[
{
"x": -3
},
"ins",
{
"h": 2
},
"<i class='kb kb-Return-2'></i>",
{
"h": 2
},
"space"
],
[
{
"x": -3
},
"scroll<br/>lock"
]
]

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB