Merge branch 'master' of https://github.com/Dbroqua/qmk_firmware
commit
28ca1f5345
@ -1 +1,5 @@
|
||||
# The default keymap for cluecard
|
||||
|
||||
Note that this keymap has audio enabled, so the RGB mode button does not go through the different effects.
|
||||
So the LEDs will still show a static light, that is configurable with the hue, staturation and brightness
|
||||
buttons. You can of course also turn them on and off with the on/off button.
|
||||
|
@ -0,0 +1,21 @@
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = no # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = yes # Console for debug(+400)
|
||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
@ -0,0 +1,12 @@
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "../../config.h"
|
||||
|
||||
// place overrides here
|
||||
#define RGBLIGHT_TIMER
|
||||
#define RGBLIGHT_EFFECT_SNAKE_LENGTH 3
|
||||
#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2
|
||||
#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 2
|
||||
|
||||
#endif
|
@ -0,0 +1,28 @@
|
||||
#include "cluecard.h"
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = KEYMAP(
|
||||
RGB_TOG, RGB_SAI, RGB_VAI, \
|
||||
RGB_HUD, RGB_HUI, \
|
||||
RGB_MOD, RGB_SAD, RGB_VAD, \
|
||||
BL_STEP, \
|
||||
KC_NO, KC_NO, KC_NO \
|
||||
)
|
||||
};
|
||||
|
||||
const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {255, 170, 85};
|
||||
const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {255, 170, 85};
|
||||
|
||||
void matrix_init_user(void) {
|
||||
}
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
# RGB effect test keymap for cluecard
|
||||
|
||||
This keymap is made for testing the RGB effects. Audio is disabled and the mode buttons goes through each
|
||||
effect. If you run HID-listen you will be able to see which effect is active. For a list of effects, check
|
||||
the `rgblight.c` file.
|
||||
|
||||
The hue, saturation and brightness buttons will work depending on which effect is active.
|
@ -0,0 +1,145 @@
|
||||
## v1.8
|
||||
|
||||
*2016-10-03*
|
||||
|
||||
### ADORE
|
||||
|
||||
* Major rearrangements were made, to reduce pinky use, and to balance out the hand usage.
|
||||
|
||||
### Tools
|
||||
|
||||
* The `hid-commands` tool will now display a notification when the **AppSel** layer is triggered.
|
||||
* The `log-to-heatmap.py` tool now treats the innermost keys on the bottom row as thumb keys, as far as statistics are concerned.
|
||||
|
||||
### Miscellaneous
|
||||
|
||||
* Fixed the [Steno](#steno-layer) toggle key.
|
||||
|
||||
## v1.7
|
||||
|
||||
*2016-09-18*
|
||||
|
||||
### Overall changes
|
||||
|
||||
* The number row has been completely rearranged on both the [Base](#base-layer) and the [ADORE](#adore-layer) layers.
|
||||
* The number/function key behavior was changed: function keys are now on the **Media**.
|
||||
* The `:`/`;` and `-`/`_` keys were put back to their thumb position on the bottom row, on both the [Base](#base-layer) and [ADORE](#adore-layer) layers.
|
||||
* The bottom large keys on the inner side of each half now function as [tmux](http://tmux.github.io/) keys: the left to send the prefix, the right to send the `display-panes` key. The left also doubles as a GNU screen prefix key, and sends `C-a` when double tapped.
|
||||
* A number of functions, such as the **AppSel** layer, now require the `hid-commands` tool to be running, with the output of `hid_listen` being piped to it.
|
||||
|
||||
### ADORE
|
||||
|
||||
* `Y` and `X` have been swapped again.
|
||||
|
||||
### Media/Navigation layer
|
||||
|
||||
* The function keys are now on this layer.
|
||||
* Mouse keys have been removed.
|
||||
* Media start/stop/prev/next have been removed.
|
||||
* `Print screen` has been removed.
|
||||
* There is only one screen lock key now.
|
||||
|
||||
### Heatmap
|
||||
|
||||
* Fixed a few issues in the finger-stats calculation.
|
||||
* The tool now also timestamps and saves all input lines to a logfile, which it loads on start, allowing one to continue the collection after upgrading the tool.
|
||||
* The heatmap tool will now colorize the stats by default.
|
||||
* The periodic stats are now printed in a more compact format.
|
||||
|
||||
### Tools
|
||||
|
||||
* Added a new tool, `tools/layer-notify` that listens to layer change events on the HID console, and pops up a notification on layer changes.
|
||||
* Another new tool, `tools/text-to-log.py` has been added that converts arbitrary text to a keylogger output, which can be fed to the heatmap generator.
|
||||
* A number of features have been moved to the `tools/hid-commands` utility. These generally are OS dependent, and are easier to implement on the software side.
|
||||
|
||||
## v1.6
|
||||
|
||||
*2016-08-24*
|
||||
|
||||
### Base layer changes
|
||||
|
||||
* The parentheses & bracket keys have been merged: tapping them results in `[` or `{` (if it was shifted), double tapping leads to `(`.
|
||||
* The `:;` and `-_` keys are now available on the base layer, on their [ADORE](#adore-layer) location, too, just below `[{(`/`]})`.
|
||||
* The `Apps` key has been replaced by `F12`.
|
||||
* The `-`/`_` is no longer a tap-dance key.
|
||||
|
||||
### ADORE layer changes
|
||||
|
||||
* Adjustments were made to the [ADORE](#adore-layer) layer, to separate some inconvenient combinations.
|
||||
|
||||
### Miscellaneous changes
|
||||
|
||||
* `LEAD u` now starts the symbolic unicode input system, instead of the OS-one.
|
||||
* The mouse acceleration keys on the **Navigation/Media** layer have been turned into toggles: tap them once to turn them on, until tapped again. Tapping an accelerator button will turn all the others off.
|
||||
* When the **ARROW** layer is on, the *red* and *blue* LEDs light up now.
|
||||
|
||||
### Heatmap
|
||||
|
||||
* The built-in keylogger has been greatly enhanced, it now outputs the pressed state, and the layer (Dvorak or ADORE). As such, the `ADORE_AUTOLOG` option has been removed, instead there is `AUTOLOG_ENABLE` now, which when enabled, makes the keylogger start when the keyboard boots. It defaults to off.
|
||||
* The heatmap generator received a lot of updates.
|
||||
|
||||
## v1.5
|
||||
|
||||
*2016-08-12*
|
||||
|
||||
* The **1HAND** layer has been removed.
|
||||
* A `Delete` key is now available on the right thumb cluster.
|
||||
* The [ADORE](#adore-layer) layer received a major update, see the layout image above.
|
||||
* It is now possible to enable automatic logging for the [ADORE](#adore-layer) layer, by setting the `ADORE_AUTOLOG` makefile variable to `yes` when compiling the keymap. It is off by default.
|
||||
* The `~` key and the `Media Next/Prev` key have been swapped on the [base layer](#base-layer).
|
||||
* On the **ARROW** layer, `Backspace` has been replaced by `Enter`.
|
||||
* There is some experimental support for entering Unicode symbols.
|
||||
|
||||
## v1.4
|
||||
|
||||
*2016-07-29*
|
||||
|
||||
* When toggling the key logging on or off, the LEDs will do a little dance.
|
||||
* The keylogger is now optional, but enabled by default. Use `KEYLOGGER_ENABLE=no` on the `make` command line to disable it.
|
||||
* The `TAB`/`ARRW` key was turned into a tap-dance key, allowing one to toggle the **ARROW** layer on by double-tapping, and as such, avoid the need to hold the key.
|
||||
* The `-`/`_` key was turned into a tap-dance key too.
|
||||
* There is now a way to travel time with the keyboard, toggle the feature on by hitting `LEAD t`.
|
||||
|
||||
## v1.3
|
||||
|
||||
*2016-07-06*
|
||||
|
||||
* Added support for logging keys, by pressing `LEAD d`. Also included is a tool to generate a [heatmap](#heatmap) out of the logs.
|
||||
* The arrow and navigation keys were rearranged again, and now require an additional key being held to activate. See the [base layer](#base-layer) for an image that shows where arrows are.
|
||||
* The **experimental** layer has been redone, and is now called [ADORE](#adore-layer), and as such, can be enabled by `LEAD a` now.
|
||||
* Switching between Dvorak and ADORE is now persisted into EEPROM, and survives a reboot.
|
||||
|
||||
## v1.2
|
||||
|
||||
*2016-06-22*
|
||||
|
||||
* The forced NKRO mode can be easily toggled off at compile-time, to make the firmware compatible with [certain operating systems](#using-on-windows).
|
||||
* The `:;` key has changed behaviour: to access the `;` symbol, the key needs to be double-tapped, instead of shifted.
|
||||
* The `=` and `\` keys were swapped, `=` moved to the home row, on both the [base](#base-layer) and the **experimental** layers.
|
||||
* The arrow and navigation keys were redone, they are now more accessible, but the navigation keys require an extra tap to access.
|
||||
* The **Emacs** layer is gone, replaced by a simplified **navigation and media** layer.
|
||||
* `LEAD v` types the firmware version, and the keymap version.
|
||||
* On the **experimental** layer, the `L` and `Q`, and the `K` and `G` keys were swapped.
|
||||
* The [Steno](#steno-layer) layer gained a few more `#` and `*` keys, to make it easier on my fingers.
|
||||
|
||||
## v1.1
|
||||
|
||||
*2016-06-14*
|
||||
|
||||
* The keyboard starts in NKRO mode, bootmagic and other things are disabled.
|
||||
* A [Steno](#steno-layer) layer was added, to be used with Plover.
|
||||
* An **experimental** layer was added, something halfway between Dvorak and Capewell-Dvorak. A work in progress.
|
||||
* `LEAD y` types `\o/`.
|
||||
* Some keys on the [Base](#base-layer) layer have been moved around:
|
||||
- `?` moved to the left pinky, left of `Q`.
|
||||
- `=` shifted one row down, but `F11` stayed where it was.
|
||||
- `-` on the left half was replaced by `Tab`.
|
||||
- `Tab`'s original position is taken by a `Media Next`/`Media Prev` key.
|
||||
- `:` now inputs `;` when shifted.
|
||||
* `ESC` cancels the **Hungarian** layer too, not just modifiers.
|
||||
|
||||
## v1.0
|
||||
|
||||
*2016-05-26*
|
||||
|
||||
Initial version.
|
Binary file not shown.
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 95 KiB |
Binary file not shown.
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 63 KiB |
@ -0,0 +1,231 @@
|
||||
/*
|
||||
* This is built out of frustration with OSX / Sierra caps lock delay.
|
||||
* Fake it till you make it!
|
||||
*/
|
||||
|
||||
#include "ergodox.h"
|
||||
#include "debug.h"
|
||||
#include "action_layer.h"
|
||||
#include "timer.h"
|
||||
|
||||
#define BASE 0 // default layer
|
||||
#define SYMB 1 // symbols
|
||||
#define MDIA 2 // media keys
|
||||
|
||||
#define BLINK_BASE 150U // timer threshold for blinking on MDIA layer
|
||||
|
||||
typedef enum onoff_t {OFF, ON} onoff;
|
||||
|
||||
#define caps_led_on ergodox_right_led_2_on
|
||||
#define caps_led_off ergodox_right_led_2_off
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap 0: Basic layer
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | Esc | 1 | 2 | 3 | 4 | 5 | 6 | | ` | 7 | 8 | 9 | 0 | - | = |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \ |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | CapsL | A | S | D | F | G |------| |------| H | J | K | L | ; | " |
|
||||
* |--------+------+------+------+------+------| ~L1 | | ~L1 |------+------+------+------+------+--------|
|
||||
* | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | Ctrl | Opt | Cmd | Left | Right| | Down | Up | Ctrl | Cmd | Opt |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | L1 | | Alt | Ctrl ]
|
||||
* ,------|------|------| |------+--------+------.
|
||||
* | | | Home | | PgUp | | |
|
||||
* |Backsp| Del |------| |------| Enter | Spc |
|
||||
* | | | End | | PgDn | | |
|
||||
* `--------------------' `----------------------'
|
||||
*/
|
||||
|
||||
[BASE] = KEYMAP( // layer 0 : default
|
||||
// left hand
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6,
|
||||
KC_TAB, M(KC_Q), M(KC_W), M(KC_E), M(KC_R), M(KC_T), KC_LBRC,
|
||||
M(KC_CAPS), M(KC_A), M(KC_S), M(KC_D), M(KC_F), M(KC_G),
|
||||
KC_LSFT, M(KC_Z), M(KC_X), M(KC_C), M(KC_V), M(KC_B), KC_FN0,
|
||||
KC_LCTL, KC_LALT, KC_LGUI, KC_LEFT, KC_RGHT,
|
||||
KC_TRNS, KC_FN1,
|
||||
KC_HOME,
|
||||
KC_BSPC, KC_DEL, KC_END,
|
||||
// right hand
|
||||
KC_GRV, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL,
|
||||
KC_RBRC, M(KC_Y), M(KC_U), M(KC_I), M(KC_O), M(KC_P), KC_BSLS,
|
||||
M(KC_H), M(KC_J), M(KC_K), M(KC_L), KC_SCLN, KC_QUOT,
|
||||
KC_FN0, M(KC_N), M(KC_M), KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
|
||||
KC_DOWN, KC_UP, KC_RCTL, KC_RGUI, KC_RALT,
|
||||
KC_RALT, KC_RCTL,
|
||||
KC_PGUP,
|
||||
KC_PGDN, KC_ENT, KC_SPC
|
||||
),
|
||||
/* Keymap 1: Symbol Layer
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | ` | F1 | F2 | F3 | F4 | F5 | F6 | | | F7 | F8 | F9 | F10 | F11 | F12 |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | | | | | |------| |------| | | | | | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | | | | | | | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | L0 | L2 | | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* | | |------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// SYMBOLS
|
||||
[SYMB] = KEYMAP(
|
||||
// left hand
|
||||
KC_GRV ,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6,
|
||||
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_FN3, KC_FN2,
|
||||
KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
// right hand
|
||||
KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
|
||||
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
|
||||
),
|
||||
/* Keymap 2: Media and tenkey
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | BOOTL | | Mute | Vol- | Vol+ | F14 | F15 | | | | NumLk| / | * | - | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | 7 | 8 | 9 | + | |
|
||||
* |--------+------+------+------+------+------| | | |------+-----+-------+------+------+--------|
|
||||
* | | | | | | |------| |------| | 4 | 5 | 6 | + | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | 1 | 2 | 3 | Enter| |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | | | | 0 | 0 | . | Enter| |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | L1 | | | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* | | |------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// MEDIA AND TENKEY
|
||||
[MDIA] = KEYMAP(
|
||||
KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_F14, KC_F15,
|
||||
KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO,
|
||||
KC_FN4, KC_NO,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
// right hand
|
||||
KC_NO, KC_NO, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, KC_NO,
|
||||
KC_NO, KC_NO, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_NO,
|
||||
KC_NO, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_NO,
|
||||
KC_NO, KC_NO, KC_P1, KC_P2, KC_P3, KC_PENT, KC_NO,
|
||||
KC_P0, KC_P0, KC_PDOT, KC_PENT, KC_NO,
|
||||
KC_NO, KC_NO,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS
|
||||
),
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
ACTION_LAYER_MOMENTARY(SYMB), // FN0 - Momentary Layer 1 (Symbols)
|
||||
ACTION_LAYER_ON(SYMB,ON_RELEASE), // FN1 - Enable Layer 1 (Symbols)
|
||||
ACTION_LAYER_ON(MDIA,ON_RELEASE), // FN2 - Enable Layer 2 (Media)
|
||||
ACTION_LAYER_OFF(SYMB,ON_RELEASE), // FN3 - Disable Layer 1 (Symbols)
|
||||
ACTION_LAYER_OFF(MDIA,ON_RELEASE), // FN4 - Disable Layer 2 (MMedia)
|
||||
ACTION_LAYER_MOMENTARY(MDIA) // FN5 - Momentary Layer 2 (Mdia)
|
||||
};
|
||||
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
static onoff caps_state = OFF;
|
||||
switch(id) {
|
||||
case KC_CAPS:
|
||||
if (record->event.pressed) {
|
||||
// Toggle caps state;
|
||||
if (caps_state == OFF) {
|
||||
// Turn it on then!
|
||||
caps_led_on();
|
||||
caps_state = ON;
|
||||
} else {
|
||||
caps_led_off();
|
||||
caps_state = OFF;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (record->event.pressed) {
|
||||
bool shifted = false;
|
||||
if (caps_state == ON && get_mods() == 0) {
|
||||
register_code(KC_LSFT);
|
||||
shifted = true;
|
||||
}
|
||||
register_code(id);
|
||||
if(shifted) {
|
||||
unregister_code(KC_LSFT);
|
||||
}
|
||||
} else {
|
||||
unregister_code(id);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
// Runs just one time when the keyboard initializes.
|
||||
void matrix_init_user(void) {
|
||||
|
||||
}
|
||||
// Runs constantly in the background, in a loop.
|
||||
void matrix_scan_user(void) {
|
||||
uint8_t layer = biton32(layer_state);
|
||||
|
||||
static onoff board_led_state = OFF;
|
||||
static uint16_t dt = 0;
|
||||
static uint8_t oldlayer = 0;
|
||||
|
||||
if(oldlayer != layer) {
|
||||
// Layer was just toggled.
|
||||
if(layer == BASE) {
|
||||
ergodox_board_led_off();
|
||||
board_led_state = OFF;
|
||||
} else {
|
||||
ergodox_board_led_on();
|
||||
board_led_state = ON;
|
||||
}
|
||||
} else if (layer >= MDIA) {
|
||||
// We need to do blinking.
|
||||
if(timer_elapsed(dt) > BLINK_BASE) {
|
||||
// toggle
|
||||
dt = timer_read();
|
||||
if(board_led_state == OFF) {
|
||||
ergodox_board_led_on();
|
||||
board_led_state = ON;
|
||||
} else {
|
||||
ergodox_board_led_off();
|
||||
board_led_state = OFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
oldlayer = layer;
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 181 KiB |
@ -0,0 +1,38 @@
|
||||
# The extra special ergodox build for MacOS Sierra caps lock users
|
||||
|
||||
###Do you
|
||||
- Hate the OSX / MacOS caps lock delay?
|
||||
- Have an ergodox?
|
||||
|
||||
###Then this might just be for you!
|
||||
|
||||
[This](http://apple.stackexchange.com/questions/81234/how-to-remove-caps-lock-delay-on-apple-macbook-pro-aluminum-keyboard)
|
||||
and [this](http://sleepycow.org/2014/07/removing-the-caps-lock-delay-on-a-macbook/)
|
||||
are good workarounds for the caps lock delay, however none of these
|
||||
work on Sierra. This abomination of a keymap simulates capslock to the best
|
||||
of its abilities.
|
||||
This means that it keeps track of caps lock state internally rather than
|
||||
sending a caps lock keypress to the OS. It is smart enough to check for
|
||||
modifiers, such as Control being held down, and stop it with the hanky panky
|
||||
and just send on the key event unmolested even if FakeCaps is enabled. And
|
||||
since the macro isn't even registered on the non-alphas, it will not affect
|
||||
them regardless. Only in the event that FakeCaps is enabled and an alpha key
|
||||
is pressed will it sneak in a shift keydown before the alpha keydown and
|
||||
immediately afterward sneaks in a shift keyup. Generally this works well,
|
||||
however there is one known issue:
|
||||
|
||||
- Holding down a key will only have the first character in caps. For instance,
|
||||
with caps lock on, if you hold down the 'a' key, you get:
|
||||
|
||||
```
|
||||
Aaaaaaaaaaaaaaaaaa
|
||||
```
|
||||
|
||||
I have only tested this on an original Ergodox with a Teensy 2.0.
|
||||
|
||||
####Some other small tweaks
|
||||
- Layer 0 board light is off
|
||||
- Layer 1 board light is on solid
|
||||
- Layer 2 board light blinks at speed controlled by BLINK_BASE
|
||||
|
||||
![osx whiskey tango foxtrot](osx_whiskey_tango_foxtrot_capslock.png)
|
@ -0,0 +1,7 @@
|
||||
## v0.3
|
||||
|
||||
*2016-10-11*
|
||||
|
||||
### Starting point
|
||||
|
||||
* The starting point of this keymap. A beginner layout, and a couple placeholders.
|
@ -0,0 +1,9 @@
|
||||
CONSOLE_ENABLE = no # for debugging
|
||||
|
||||
SLEEP_LED_ENABLE = no # no led blinking while sleeping
|
||||
NKRO_ENABLE = yes # disable for windows
|
||||
TAP_DANCE_ENABLE = yes # tap-tap-tap
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
@ -0,0 +1,65 @@
|
||||
pvinis' keymap
|
||||
==============
|
||||
|
||||
This is a getting-used-to keymap for the [ErgoDox EZ][ez]. It's very much a work in progress.
|
||||
|
||||
[ez]: https://ergodox-ez.com/
|
||||
|
||||
## Table of Contents
|
||||
|
||||
* [Todo](#todo)
|
||||
* [Layouts](#layouts)
|
||||
- [Base layer](#base-layer)
|
||||
- [Beginner layer](#beginner-layer)
|
||||
- [QWERTY layer](#qwerty-layer)
|
||||
- [CARPALX layer](#carpalx-layer)
|
||||
- [System Control layer](#system-control-layer)
|
||||
- [Template layers](#template-layers)
|
||||
* [Building](#building)
|
||||
|
||||
# Todo
|
||||
|
||||
- [ ] Generate images from keymap
|
||||
- [ ] Implement algernon's heatmap
|
||||
- [ ] Implement `KC_POP`
|
||||
|
||||
# Layouts
|
||||
|
||||
## Base layer
|
||||
|
||||
This is the base layer that contains the common buttons of all keymaps. Right now, it has the top left button as a `flash` button when it's tapped 4 times, and the two thumb islands. The islands contain the `space` and `enter` keys on the right, the `backspace` and `shift` on the left, and all the 1x1 keys are just layer switches.
|
||||
Every time I connect the keyboard, I press the `BEGIN` layer switch, and then start typing.
|
||||
Recently, I added a few application "shortcuts", that basically call `ctrl`+`alt`+`cmd`+`<key>`, and `<key>` is `S` for Slack, `X` for Xcode, `M` for Messenger. Using [Hammerspoon][hammerspoon], I show/hide the application.
|
||||
|
||||
[hammerspoon]: http://www.hammerspoon.org/
|
||||
|
||||
## Beginner layer
|
||||
|
||||
This is a basic keymap I use right now until I'm comfortable typing on the Ergodox. Currently uses a QWERTY layout, and the `([{}])` on the middle keys. Not a perfect layout, and its going to go away at some point, but for now thats my daily driver.
|
||||
|
||||
## QWERTY layer
|
||||
|
||||
This is basically the same as the `BEGIN` layer, but it might go away. I'm not using it, but I should have a QWERTY layout on the keyboard, in case someone else wants to try it out, or if I completely forget how keyboards work! At some point, this and the `BEGIN` layer will become one.
|
||||
|
||||
## CARPALX layer
|
||||
|
||||
This is here as a placeholder. I want to transition to [Carpalx QGMLWY][carpalx] or [White][white] at some point. They both look very interesting and more comfortable to type on, but after I'm confident with typing on the Ergodox.
|
||||
|
||||
[carpalx]: http://mkweb.bcgsc.ca/carpalx/?full_optimization
|
||||
[white]: https://github.com/mw8/white_keyboard_layout
|
||||
|
||||
## System Control layer
|
||||
|
||||
This one is a layer that, in time, will have controls like mouse movement, volume up/down, mute, sleep, restart, shutdown, etc.
|
||||
|
||||
## Template layers
|
||||
|
||||
I have two commented out layers that are just templates, so I can easily create a new layer.
|
||||
|
||||
# Building
|
||||
|
||||
```
|
||||
$ git clone https://github.com/jackhumbert/qmk_firmware.git
|
||||
$ cd qmk_firmware/keyboards/ergodox/keymaps/pvinis
|
||||
$ make
|
||||
```
|
@ -0,0 +1,430 @@
|
||||
// pvinis' ergodox keymap
|
||||
|
||||
#include "ergodox.h"
|
||||
#include "mousekey.h"
|
||||
|
||||
// easier name for left ctrl-alt-gui
|
||||
#define ALLM(kc) LCAG(kc)
|
||||
|
||||
// layers
|
||||
enum {
|
||||
BASE = 0,
|
||||
BEGIN,
|
||||
QWERTY,
|
||||
CARPALX,
|
||||
SYSCTL,
|
||||
};
|
||||
|
||||
// extra keys
|
||||
enum {
|
||||
NONE = 0,
|
||||
|
||||
// mouse
|
||||
MS_UL, // up left
|
||||
MS_UR, // up right
|
||||
MS_DL, // down left
|
||||
MS_DR, // down right
|
||||
|
||||
// tap dance
|
||||
TD_FLSH, // flash keyboard
|
||||
};
|
||||
|
||||
// application selection
|
||||
// this is sending ctrl-alt-gui-<key>, and this is picked up by hammerspoon
|
||||
#define AP_SLCK ALLM(KC_S)
|
||||
#define AP_XCOD ALLM(KC_X)
|
||||
#define AP_MSGR ALLM(KC_M)
|
||||
|
||||
// keymaps
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* BASE
|
||||
* the base of the keyboard.
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* |4x FLASH| | | | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | | | | | |------| |------| | | | | | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | | | | | | | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* |BEGIN |QWERTY| |SYSCTL| |
|
||||
* ,------|------|------| |------+--------+------.
|
||||
* | | |CARPAL| |Slack | | |
|
||||
* |Backsp|LShift|------| |------| Enter |Space |
|
||||
* | | |SYSCTL| |Msngr | | |
|
||||
* `--------------------' `----------------------'
|
||||
*/
|
||||
[BASE] = KEYMAP(
|
||||
TD(TD_FLSH) ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
|
||||
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
|
||||
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
|
||||
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
|
||||
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
|
||||
|
||||
,TG(BEGIN) ,TG(QWERTY)
|
||||
,TG(CARPALX)
|
||||
,KC_BSPC ,KC_LSFT ,TG(SYSCTL)
|
||||
|
||||
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
|
||||
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
|
||||
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
|
||||
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
|
||||
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
|
||||
|
||||
,TG(SYSCTL) ,KC_NO
|
||||
,AP_SLCK
|
||||
,AP_MSGR ,KC_ENT ,KC_SPC
|
||||
),
|
||||
|
||||
/* BEGIN
|
||||
* a beginner's keymap i currently use.
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | 1 | 2 | 3 | 4 | 5 | 6 | | 6 | 7 | 8 | 9 | 0 | - | = |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \ |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* |Esc/Ctrl| A | S | D | F | G |------| |------| H | J | K | L | ; | Enter |
|
||||
* |--------+------+------+------+------+------| ( | | ) |------+------+------+------+------+--------|
|
||||
* | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | ` | Cmd | | Cmd | | | | | ' | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+--------+------.
|
||||
* | | | | | | | |
|
||||
* | | |------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `----------------------'
|
||||
*/
|
||||
[BEGIN] = KEYMAP(
|
||||
KC_TRNS ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_6
|
||||
,KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_LBRC
|
||||
,CTL_T(KC_ESC) ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G
|
||||
,KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_LPRN
|
||||
,KC_TRNS ,KC_GRV ,KC_LGUI ,KC_LEFT ,KC_RIGHT
|
||||
|
||||
,KC_TRNS ,KC_TRNS
|
||||
,KC_TRNS
|
||||
,KC_TRNS ,KC_TRNS ,KC_TRNS
|
||||
|
||||
,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_MINS ,KC_EQL
|
||||
,KC_RBRC ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_BSLS
|
||||
,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,KC_ENT
|
||||
,KC_RPRN ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSFT
|
||||
,KC_UP ,KC_DOWN ,KC_TRNS ,KC_QUOT ,KC_TRNS
|
||||
|
||||
,KC_TRNS ,KC_TRNS
|
||||
,KC_TRNS
|
||||
,KC_TRNS ,KC_TRNS ,KC_TRNS
|
||||
),
|
||||
|
||||
/* QWERTY
|
||||
* the default qwerty keymap. not really used, but i'll keep it here for now.
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | Q | W | E | R | T | | | | Y | U | I | O | P | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | A | S | D | F | G |------| |------| H | J | K | L | ; | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | Z | X | C | V | B | | | | N | M | , | . | / | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | | | | | | | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+--------+------.
|
||||
* | | | | | | | |
|
||||
* | | |------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `----------------------'
|
||||
*/
|
||||
[QWERTY] = KEYMAP(
|
||||
KC_TRNS ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_TRNS
|
||||
,KC_TRNS ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_TRNS
|
||||
,KC_TRNS ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G
|
||||
,KC_TRNS ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,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_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_TRNS
|
||||
,KC_TRNS ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_TRNS
|
||||
,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,KC_TRNS
|
||||
,KC_TRNS ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_TRNS
|
||||
,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS
|
||||
|
||||
,KC_TRNS ,KC_TRNS
|
||||
,KC_TRNS
|
||||
,KC_TRNS ,KC_TRNS ,KC_TRNS
|
||||
),
|
||||
|
||||
/* CARPALX
|
||||
* the keymap i would like to transition to.
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | 1 | 2 | 3 | 4 | 5 | | | RIGHT| 6 | 7 | 8 | 9 | 0 | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | Q | G | M | L | W | | | L1 | Y | F | U | B | ; | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | D | S | T | N | R |------| |------| I | A | E | O | H | |
|
||||
* |--------+------+------+------+------+------| | | Meh |------+------+------+------+------+--------|
|
||||
* | | Z | X | C | V | J | | | | K | P | , | . | / | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | | | | Up | | | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* | | |------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
[CARPALX] = KEYMAP(
|
||||
KC_TRNS ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_TRNS
|
||||
,KC_TRNS ,KC_Q ,KC_G ,KC_M ,KC_L ,KC_W ,KC_TRNS
|
||||
,KC_TRNS ,KC_D ,KC_S ,KC_T ,KC_N ,KC_R
|
||||
,KC_TRNS ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_J ,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_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_TRNS
|
||||
,KC_TRNS ,KC_Y ,KC_F ,KC_U ,KC_B ,KC_SCLN ,KC_TRNS
|
||||
,KC_I ,KC_A ,KC_E ,KC_O ,KC_H ,KC_TRNS
|
||||
,KC_TRNS ,KC_K ,KC_P ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_TRNS
|
||||
,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS
|
||||
|
||||
,KC_TRNS ,KC_TRNS
|
||||
,KC_TRNS
|
||||
,KC_TRNS ,KC_TRNS ,KC_TRNS
|
||||
),
|
||||
|
||||
|
||||
/* SYSCTL
|
||||
* a keymap to control my system.
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | | | | | | | | | | | Mute |VolDn |VolUp | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | |MsUpL | MsUp |MsUpR | | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | | | | | |------| |------| |MsLeft| MsDn |MsRght| | Lock |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | |MsDnL | MsDn | | | Sleep |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | | | | | | | | Power|
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | |MidClk|
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | |Left |Right |
|
||||
* | | |------| |------| Click| Click|
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
[SYSCTL] = KEYMAP(
|
||||
KC_TRNS ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
|
||||
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
|
||||
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
|
||||
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
|
||||
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
|
||||
|
||||
,KC_NO ,KC_NO
|
||||
,KC_NO
|
||||
,KC_NO ,KC_NO ,KC_NO
|
||||
|
||||
/*,KC_POP*/,KC_NO ,KC_NO ,KC_NO ,KC_MUTE ,KC_VOLD ,KC_VOLU ,KC_NO
|
||||
/*,KC_PTRN*/,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
|
||||
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,LCTL(LSFT(KC_PWR))
|
||||
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_SLEP
|
||||
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_PWR
|
||||
|
||||
,KC_NO ,KC_NO
|
||||
,KC_NO
|
||||
,KC_NO ,KC_NO ,KC_NO
|
||||
),
|
||||
|
||||
/* TEMPLATE
|
||||
* keymap template with transparent and non-transparent keys
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | | | | | |------| |------| | | | | | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | | | | | | | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+--------+------.
|
||||
* | | | | | | | |
|
||||
* | | |------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `----------------------'
|
||||
*/
|
||||
/*
|
||||
[TEMPLATE] = 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_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_TRNS
|
||||
,KC_TRNS ,KC_TRNS ,KC_TRNS
|
||||
),
|
||||
[TEMPLATE] = KEYMAP(
|
||||
KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
|
||||
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
|
||||
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
|
||||
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
|
||||
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
|
||||
|
||||
,KC_NO ,KC_NO
|
||||
,KC_NO
|
||||
,KC_NO ,KC_NO ,KC_NO
|
||||
|
||||
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
|
||||
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
|
||||
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
|
||||
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
|
||||
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
|
||||
|
||||
,KC_NO ,KC_NO
|
||||
,KC_NO
|
||||
,KC_NO ,KC_NO ,KC_NO
|
||||
),
|
||||
*/
|
||||
};
|
||||
|
||||
// keyboard initialization
|
||||
void matrix_init_user() {
|
||||
ergodox_led_all_on();
|
||||
for (int i = LED_BRIGHTNESS_HI; i > LED_BRIGHTNESS_LO; i--) {
|
||||
ergodox_led_all_set(i);
|
||||
wait_ms(5);
|
||||
}
|
||||
wait_ms(1000);
|
||||
for (int i = LED_BRIGHTNESS_LO; i > 0; i--) {
|
||||
ergodox_led_all_set(i);
|
||||
wait_ms(10);
|
||||
}
|
||||
ergodox_led_all_off();
|
||||
}
|
||||
|
||||
// extra keys
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
switch (id) {
|
||||
|
||||
// mouse
|
||||
case MS_UL:
|
||||
if (record->event.pressed) {
|
||||
mousekey_on(KC_MS_UP);
|
||||
mousekey_on(KC_MS_LEFT);
|
||||
} else {
|
||||
mousekey_off(KC_MS_UP);
|
||||
mousekey_off(KC_MS_LEFT);
|
||||
}
|
||||
break;
|
||||
case MS_UR:
|
||||
if (record->event.pressed) {
|
||||
mousekey_on(KC_MS_UP);
|
||||
mousekey_on(KC_MS_RIGHT);
|
||||
} else {
|
||||
mousekey_off(KC_MS_UP);
|
||||
mousekey_off(KC_MS_RIGHT);
|
||||
}
|
||||
break;
|
||||
case MS_DL:
|
||||
if (record->event.pressed) {
|
||||
mousekey_on(KC_MS_DOWN);
|
||||
mousekey_on(KC_MS_LEFT);
|
||||
} else {
|
||||
mousekey_off(KC_MS_DOWN);
|
||||
mousekey_off(KC_MS_LEFT);
|
||||
}
|
||||
break;
|
||||
case MS_DR:
|
||||
if (record->event.pressed) {
|
||||
mousekey_on(KC_MS_DOWN);
|
||||
mousekey_on(KC_MS_RIGHT);
|
||||
} else {
|
||||
mousekey_off(KC_MS_DOWN);
|
||||
mousekey_off(KC_MS_RIGHT);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
}
|
||||
|
||||
// tap dances
|
||||
|
||||
// flash keyboard on 4x tap, with leds
|
||||
void flash_each_tap(qk_tap_dance_state_t *state, void *user_data) {
|
||||
switch (state->count) {
|
||||
case 1:
|
||||
ergodox_right_led_3_on();
|
||||
break;
|
||||
case 2:
|
||||
ergodox_right_led_2_on();
|
||||
break;
|
||||
case 3:
|
||||
ergodox_right_led_1_on();
|
||||
break;
|
||||
case 4:
|
||||
ergodox_right_led_3_off();
|
||||
wait_ms(50);
|
||||
ergodox_right_led_2_off();
|
||||
wait_ms(50);
|
||||
ergodox_right_led_1_off();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void flash_dance_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count >= 4) {
|
||||
reset_keyboard();
|
||||
reset_tap_dance(state);
|
||||
}
|
||||
}
|
||||
|
||||
void flash_dance_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
ergodox_right_led_1_off();
|
||||
wait_ms(50);
|
||||
ergodox_right_led_2_off();
|
||||
wait_ms(50);
|
||||
ergodox_right_led_3_off();
|
||||
}
|
||||
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
[TD_FLSH] = ACTION_TAP_DANCE_FN_ADVANCED( flash_each_tap, flash_dance_finished, flash_dance_reset ),
|
||||
};
|
@ -0,0 +1,3 @@
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../../Makefile
|
||||
endif
|
@ -0,0 +1,102 @@
|
||||
GameNum firmware
|
||||
======================
|
||||
## Board overview
|
||||
|
||||
The GameNum was designed to facilitate the use of mechanical keys for gaming even when your packing space is limited.
|
||||
It uses a standard numpad layout replacing the NumLock key with a layer toggle that allows you to cycle through the different layers.
|
||||
The standard layout features a default layer that acts as a standard numpad, a layer that was meant for simple WASD based games and a layer that was designed to be used for MOBA/RTS related games.
|
||||
The RTS layer is meant to be used rotating the device 90 degrees counterclockwise.
|
||||
|
||||
The README.MD for this board is reasonably extensive and in-depth because the build is quite small and covers a lot of things that I feel that it would be a good starting point for getting into QMK.
|
||||
|
||||
## Build considerations
|
||||
|
||||
Since the GameNum is handwired and uses 2 of its pins to toggle indicator lights there are some things to keep in mind.
|
||||
Firmware was build for use with a Pro Micro based on a ATMEGA32u4 at 16mHz.
|
||||
The indicator LED's are normally assigned to `pin C6` and `pin D4`, C6 goes high when the first layer is used, D4 goes high when layer 2 is used. Both LED's are off when the default layer is enabled.
|
||||
'+' of the LED goes to the respective pins and can be joined together on the '-' into a resistor that runs to the ground pin of the pro micro. With a standard LED a resistor value of 100 ohm is fine, keep in mind that you cannot use high powered LEDS on these pins without ruining your pro micro.
|
||||
|
||||
## schematic of the switches and diodes
|
||||
|
||||
![schematic overview](http://i.imgur.com/fleitoA.jpg)
|
||||
|
||||
Keep in mind that the minus of the diodes should point towards the pro micros inputs.
|
||||
|
||||
##LED hookup
|
||||
|
||||
![led overview](http://i.imgur.com/U6m865n.jpg)
|
||||
|
||||
## Adding more layers
|
||||
|
||||
Adding additional layers is pretty straight forward. Look in `keymaps/default/keymap.c` and find `#define OSY 2` add a new definition for the layer you are going to add. This can be named pretty much anything. Example: `#define NAMEHERE 3`.
|
||||
Keep in mind here that the number after the name should correspond with the number that the layer has in the stack of layers.
|
||||
|
||||
Next thing to do is to add the actual layer for the keymap.
|
||||
|
||||
```
|
||||
[DEF] = KEYMAP(
|
||||
KC_FN0, KC_SLSH, KC_ASTR, KC_MINS, \
|
||||
KC_7, KC_8, KC_9, KC_PLUS, \
|
||||
KC_4, KC_5, KC_6, \
|
||||
KC_1, KC_2, KC_3, \
|
||||
KC_0, KC_DOT, KC_ENT \
|
||||
)
|
||||
```
|
||||
|
||||
This is the default layer for the gamenum. It's generally easiest to just copy this and change things as you see fit. Keep in mind that at least 1 button on the pad has to be used to switch to the next layer in the stack or you will be stuck in that layer FOREVER! D:
|
||||
In the case of DEF this is key `KC_FN0`. Also keep in mind that the last layer that you add does not have a comma after its closing bracket but any other layer does!
|
||||
|
||||
Which brings us nicely to the next part, the layer switching logic. Under the keymaps look for `PROGMEM fn_actions[]` this function handles the switching between layers, as you might have noticed every layer in the keymap has its own KC_FNx key. This is the key responsible for switching you from layer to layer.
|
||||
The number that is at the end of the keycode corresponds with the code in the function.
|
||||
`[0] = ACTION_LAYER_SET(HDN, ON_PRESS),` When `KC_FN0` is pressed the keyboard switches layer `HDN` on when the key is pressed down. Add an extra line for your layer here as well.
|
||||
|
||||
Now for the LEDs, if you plan on adding extra LED's to the keyboard to indicate other layers you have to first define the pin that the LED will be using in `gamenum.c`.
|
||||
Look for this piece of code:
|
||||
|
||||
```
|
||||
DDRD |= (1<<4);
|
||||
PORTD &= ~(1<<4);
|
||||
```
|
||||
|
||||
Copy it and change the letter after DDR and PORT to the letter of your pin. Change the 4 to the number of your pin. `DDRx |= (1<<y);` defines that pin as an output. `PORTx &= ~(1<<y);` sets the pin to LOW turning off the LED.
|
||||
|
||||
Now go back to `keymap.c` and look for the `process_record_user` function. The function is basically a switch case that checks if you pushed one of the defined layer-switch buttons. When it sees that you pushed one of them it sets the pins of the LED's either low or high.
|
||||
|
||||
```
|
||||
case KC_FN1:
|
||||
if (record->event.pressed) {
|
||||
PORTC &= ~(1 << 6); // PC6 goes low
|
||||
PORTD |= (1<<4); //PD4 goes high
|
||||
}
|
||||
break;
|
||||
```
|
||||
|
||||
This is the code for the KC_FN1 button. Notice how we check against what key is pressed in the case and then set pin C6 low and pin D4 high. Adjust this as you see fit.
|
||||
|
||||
|
||||
## Quantum MK Firmware
|
||||
|
||||
For the full Quantum feature list, see [the parent readme.md](/doc/readme.md).
|
||||
|
||||
## Building
|
||||
|
||||
Download or clone the whole firmware and navigate to the keyboards/handwired/gamenum folder.
|
||||
Read the README.md for the qmk repository on how to set up your developer enviroment to build your firmware with.
|
||||
Building firmware on Windows can be a bit of a hassle. Linux is a lot easier to use if you have some experience with it. A raspberry pi will already be able to build the firmware for you.
|
||||
Once your dev env is set up, you'll be able to type `make` to generate your .hex - you can then use AVRDudess to program your .hex file.
|
||||
|
||||
### Default
|
||||
|
||||
To build with the default keymap, simply run `make`.
|
||||
|
||||
### Other Keymaps
|
||||
|
||||
To build the firmware binary hex file with a keymap just do `make` with `keymap` option like:
|
||||
|
||||
```
|
||||
$ make keymap=[default|jack|<name>]
|
||||
```
|
||||
|
||||
Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/`
|
||||
|
||||
|
@ -0,0 +1,162 @@
|
||||
/*
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
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/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0x1234
|
||||
#define PRODUCT_ID 0x5678
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER Seth-Senpai
|
||||
#define PRODUCT GameNum
|
||||
#define DESCRIPTION Numpad with gamelayers
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 5
|
||||
#define MATRIX_COLS 4
|
||||
|
||||
/*
|
||||
* Keyboard Matrix Assignments
|
||||
*
|
||||
* Change this to how you wired your keyboard
|
||||
* COLS: AVR pins used for columns, left to right
|
||||
* ROWS: AVR pins used for rows, top to bottom
|
||||
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||
*
|
||||
*/
|
||||
#define MATRIX_ROW_PINS { B6, B2, B3, B1, F7 }
|
||||
#define MATRIX_COL_PINS { D7, E6, B4, B5 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION ROW2COL
|
||||
|
||||
// #define BACKLIGHT_PIN C6
|
||||
// #define BACKLIGHT_BREATHING
|
||||
// #define BACKLIGHT_LEVELS 3
|
||||
|
||||
|
||||
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||
#define DEBOUNCING_DELAY 5
|
||||
|
||||
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* number of backlight levels */
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/*
|
||||
* Force NKRO
|
||||
*
|
||||
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
|
||||
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
|
||||
* makefile for this to work.)
|
||||
*
|
||||
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
|
||||
* until the next keyboard reset.
|
||||
*
|
||||
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
|
||||
* fully operational during normal computer usage.
|
||||
*
|
||||
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
|
||||
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
|
||||
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
|
||||
* power-up.
|
||||
*
|
||||
*/
|
||||
//#define FORCE_NKRO
|
||||
|
||||
/*
|
||||
* Magic Key Options
|
||||
*
|
||||
* Magic keys are hotkey commands that allow control over firmware functions of
|
||||
* the keyboard. They are best used in combination with the HID Listen program,
|
||||
* found here: https://www.pjrc.com/teensy/hid_listen.html
|
||||
*
|
||||
* The options below allow the magic key functionality to be changed. This is
|
||||
* useful if your keyboard/keypad is missing keys and you want magic key support.
|
||||
*
|
||||
*/
|
||||
|
||||
/* key combination for magic key command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
/* control how magic key switches layers */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
|
||||
|
||||
/* override magic key keymap */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
|
||||
//#define MAGIC_KEY_HELP1 H
|
||||
//#define MAGIC_KEY_HELP2 SLASH
|
||||
//#define MAGIC_KEY_DEBUG D
|
||||
//#define MAGIC_KEY_DEBUG_MATRIX X
|
||||
//#define MAGIC_KEY_DEBUG_KBD K
|
||||
//#define MAGIC_KEY_DEBUG_MOUSE M
|
||||
//#define MAGIC_KEY_VERSION V
|
||||
//#define MAGIC_KEY_STATUS S
|
||||
//#define MAGIC_KEY_CONSOLE C
|
||||
//#define MAGIC_KEY_LAYER0_ALT1 ESC
|
||||
//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
|
||||
//#define MAGIC_KEY_LAYER0 0
|
||||
//#define MAGIC_KEY_LAYER1 1
|
||||
//#define MAGIC_KEY_LAYER2 2
|
||||
//#define MAGIC_KEY_LAYER3 3
|
||||
//#define MAGIC_KEY_LAYER4 4
|
||||
//#define MAGIC_KEY_LAYER5 5
|
||||
//#define MAGIC_KEY_LAYER6 6
|
||||
//#define MAGIC_KEY_LAYER7 7
|
||||
//#define MAGIC_KEY_LAYER8 8
|
||||
//#define MAGIC_KEY_LAYER9 9
|
||||
//#define MAGIC_KEY_BOOTLOADER PAUSE
|
||||
//#define MAGIC_KEY_LOCK CAPS
|
||||
//#define MAGIC_KEY_EEPROM E
|
||||
//#define MAGIC_KEY_NKRO N
|
||||
//#define MAGIC_KEY_SLEEP_LED Z
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
*/
|
||||
|
||||
/* disable debug print */
|
||||
//#define NO_DEBUG
|
||||
|
||||
/* disable print */
|
||||
//#define NO_PRINT
|
||||
|
||||
/* disable action features */
|
||||
//#define NO_ACTION_LAYER
|
||||
//#define NO_ACTION_TAPPING
|
||||
//#define NO_ACTION_ONESHOT
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
|
||||
#endif
|
@ -0,0 +1,14 @@
|
||||
#include "gamenum.h"
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
// put your keyboard start-up code here
|
||||
// runs once when the firmware starts up
|
||||
DDRC |= (1<<6);
|
||||
PORTC &= ~(1<<6);
|
||||
|
||||
DDRD |= (1<<4);
|
||||
PORTD &= ~(1<<4);
|
||||
|
||||
matrix_init_user();
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
#ifndef GAMENUM_H
|
||||
#define GAMENUM_H
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
#define KEYMAP( \
|
||||
k00, k01, k02, k03, \
|
||||
k10, k11, k12, k13, \
|
||||
k20, k21, k22, \
|
||||
k30, k31, k32, \
|
||||
k41, k42, k43 \
|
||||
) \
|
||||
{ \
|
||||
{ k00, k01, k02, k03}, \
|
||||
{ k10, k11, k12, k13}, \
|
||||
{ k20, k21, k22, KC_NO}, \
|
||||
{ k30, k31, k32, KC_NO}, \
|
||||
{ KC_NO, k41, k42, k43} \
|
||||
}
|
||||
|
||||
#endif
|
@ -0,0 +1,68 @@
|
||||
#include "gamenum.h"
|
||||
#include "action_layer.h"
|
||||
#include "eeconfig.h"
|
||||
|
||||
|
||||
#define _______ KC_TRNS
|
||||
|
||||
#define DEF 0
|
||||
#define HDN 1
|
||||
#define OSY 2
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[DEF] = KEYMAP(
|
||||
KC_FN0, KC_SLSH, KC_ASTR, KC_MINS, \
|
||||
KC_7, KC_8, KC_9, KC_PLUS, \
|
||||
KC_4, KC_5, KC_6, \
|
||||
KC_1, KC_2, KC_3, \
|
||||
KC_0, KC_DOT, KC_ENT \
|
||||
),
|
||||
[HDN] = KEYMAP(
|
||||
KC_FN1, KC_1, KC_2, KC_3, \
|
||||
KC_Q, KC_W, KC_E, KC_R, \
|
||||
KC_A, KC_S, KC_D, \
|
||||
KC_Z, KC_X, KC_C, \
|
||||
KC_LSFT, KC_LALT, KC_SPC \
|
||||
),
|
||||
[OSY] = KEYMAP(
|
||||
KC_A, KC_Q, KC_1, KC_FN2, \
|
||||
KC_S, KC_W, KC_2, KC_LALT, \
|
||||
KC_D, KC_E, KC_3, \
|
||||
KC_F, KC_R, KC_4, \
|
||||
KC_SPC, KC_T, KC_TAB \
|
||||
)
|
||||
};
|
||||
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[0] = ACTION_LAYER_SET(HDN, ON_PRESS),
|
||||
[1] = ACTION_LAYER_SET(OSY, ON_PRESS),
|
||||
[2] = ACTION_LAYER_SET(DEF, ON_PRESS),
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
|
||||
bool process_record_user (uint16_t keycode, keyrecord_t *record) {
|
||||
switch(keycode) {
|
||||
case KC_FN0:
|
||||
if (record->event.pressed) {
|
||||
PORTC |= (1 << 6); // PC6 goes high
|
||||
}
|
||||
break;
|
||||
case KC_FN1:
|
||||
if (record->event.pressed) {
|
||||
PORTC &= ~(1 << 6); // PC6 goes high
|
||||
PORTD |= (1<<4);
|
||||
}
|
||||
break;
|
||||
case KC_FN2:
|
||||
if (record->event.pressed) {
|
||||
PORTD &= ~(1 << 4); // PC6 goes high
|
||||
}
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
|
||||
# MCU name
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE ?= no # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../Makefile
|
||||
endif
|
||||
|
||||
|
@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = yes # Console for debug(+400)
|
||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
@ -0,0 +1,91 @@
|
||||
/*
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
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/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x6060
|
||||
#define MANUFACTURER Ortholinear Keyboards
|
||||
#define PRODUCT The Planck Keyboard
|
||||
#define DESCRIPTION A compact ortholinear keyboard
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 4
|
||||
#define MATRIX_COLS 12
|
||||
|
||||
/* Planck PCB default pin-out */
|
||||
#define MATRIX_ROW_PINS { D0, D5, B5, B6 }
|
||||
#define MATRIX_COL_PINS { F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
#define BACKLIGHT_PIN B7
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/* define if matrix has ghost */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* number of backlight levels */
|
||||
#define BACKLIGHT_LEVELS 3
|
||||
|
||||
/* Set 0 if debouncing isn't needed */
|
||||
#define DEBOUNCING_DELAY 5
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/* key combination for command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
*/
|
||||
|
||||
/* disable debug print */
|
||||
//#define NO_DEBUG
|
||||
|
||||
/* disable print */
|
||||
//#define NO_PRINT
|
||||
|
||||
/* disable action features */
|
||||
//#define NO_ACTION_LAYER
|
||||
//#define NO_ACTION_TAPPING
|
||||
//#define NO_ACTION_ONESHOT
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
|
||||
/* prevent the modifiers from being stuck, sacrificing some memory */
|
||||
#define PREVENT_STUCK_MODIFIERS
|
||||
|
||||
#ifdef SUBPROJECT_rev3
|
||||
#include "rev3/config.h"
|
||||
#endif
|
||||
#ifdef SUBPROJECT_rev4
|
||||
#include "rev4/config.h"
|
||||
#endif
|
||||
|
||||
#endif
|
@ -0,0 +1,187 @@
|
||||
// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
|
||||
// this is the style you want to emulate.
|
||||
|
||||
#include "planck.h"
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
# include "backlight.h"
|
||||
#endif
|
||||
#include "timer.h"
|
||||
#include <bootloader.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.
|
||||
enum userlayer {
|
||||
_QW = 0,
|
||||
_CM,
|
||||
_PP,
|
||||
_PPG,
|
||||
_NM,
|
||||
_LW,
|
||||
_RS,
|
||||
_DL,
|
||||
_DYN,
|
||||
};
|
||||
|
||||
enum planck_keycodes {
|
||||
KM_LW = SAFE_RANGE,
|
||||
KM_RS,
|
||||
KM_SHLK, /* ShiftLock */
|
||||
KM_RST, /* Reset */
|
||||
KM_NUM, /* Numeric layer */
|
||||
KM_SLP, /* Sleep 250 ms */
|
||||
KM_PPLR, /* Pure Pro layer */
|
||||
DYNAMIC_MACRO_RANGE,
|
||||
};
|
||||
|
||||
#include "dynamic_macro.h"
|
||||
|
||||
#define _______ KC_TRNS
|
||||
#define XXXXXXX KC_NO
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[_QW] = { /* Qwerty */
|
||||
{KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
|
||||
{CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
|
||||
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_FN0 },
|
||||
{KC_LCTL, MO(_DYN),KC_LGUI, KC_LALT, KM_LW, KC_SPC, KC_SPC, KM_RS, KC_RALT, KC_DOWN, KC_UP, KC_RCTL}
|
||||
},
|
||||
[_CM] = { /* Colemak */
|
||||
{KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC},
|
||||
{CTL_T(KC_ESC), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT},
|
||||
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_FN0 },
|
||||
{KC_LCTL, MO(_DYN),KC_LGUI, KC_LALT, KM_LW, KC_SPC, KC_SPC, KM_RS, KC_RALT, KC_DOWN, KC_UP, KC_RCTL}
|
||||
},
|
||||
[_PP] = { /* Pure Pro */
|
||||
{KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
|
||||
{KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT },
|
||||
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_RSFT, KC_UP, KC_RCTL},
|
||||
{KC_LCTL, MO(_DYN),KC_LGUI, KC_LALT, KM_LW, KC_SPC, KC_SPC, KM_RS, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT}
|
||||
},
|
||||
[_PPG] = { /* Pure Pro: Gaming */
|
||||
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
|
||||
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
|
||||
{_______, _______, _______, _______, _______, _______, _______, _______, _______, DF(_RS), _______, _______},
|
||||
{_______, _______, XXXXXXX, _______, KM_RS , _______, _______, KM_LW , _______, _______, _______, _______},
|
||||
},
|
||||
[_NM] = { /* Numeric */
|
||||
{KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
|
||||
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
|
||||
{KC_LSFT, _______, _______, _______, _______, _______, _______, _______, KC_COMM, KC_DOT, _______, KC_FN0 },
|
||||
{_______, _______, _______, _______, _______, KC_SPC, KC_SPC, _______, _______, _______, _______, _______}
|
||||
},
|
||||
[_LW]= { /* LOWER */
|
||||
{KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC},
|
||||
{KC_ESC, LGUI(KC_1), LGUI(KC_2), LGUI(KC_3), LGUI(KC_4), LGUI(KC_5), KM_NUM, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
|
||||
{_______, LGUI(KC_6), LGUI(KC_7), LGUI(KC_8), LGUI(KC_9), LGUI(KC_0), KM_SLP, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_ENT },
|
||||
{_______, BL_TOGG, _______, _______, _______, KC_BTN1, KC_BTN1, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
|
||||
},
|
||||
[_RS]= { /* RAISE */
|
||||
{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL },
|
||||
{KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
|
||||
{_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), KM_PPLR, KM_RST, KC_ENT },
|
||||
{_______, BL_STEP, _______, _______, _______, KC_BTN2, KC_BTN2, _______, KC_MPLY, KC_VOLD, KC_VOLU, _______}
|
||||
},
|
||||
[_DL]= { /* DUAL */
|
||||
{_______, _______, KC_WH_U, KC_MS_U, KC_WH_D, _______, _______, KC_APP, KC_INS, _______, KC_PSCR, _______},
|
||||
{_______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_ACL0, KC_ACL2},
|
||||
{_______, _______, KC_BTN2, KC_BTN3, KC_BTN1, KC_WWW_BACK, KC_WWW_FORWARD, KC_MUTE, _______, _______, _______, _______},
|
||||
{_______, _______, KC_LGUI, KC_LALT, _______, _______, _______, _______, _______, _______, _______, _______}
|
||||
},
|
||||
[_DYN]= { /* special */
|
||||
{_______, DYN_REC_START1, DYN_MACRO_PLAY1, _______, _______, _______, _______, _______, KC_INS, _______, KC_PSCR, KC_PAUS},
|
||||
{_______, DYN_REC_START2, DYN_MACRO_PLAY2, _______, _______, _______, _______, _______, _______, KC_CAPS, KC_SLCK, KC_NLCK},
|
||||
{KM_SHLK, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
|
||||
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
|
||||
},
|
||||
};
|
||||
|
||||
#undef _______
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT),
|
||||
};
|
||||
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
static uint16_t key_timer;
|
||||
|
||||
if (!process_record_dynamic_macro(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (keycode) {
|
||||
case KM_LW:
|
||||
if (record->event.pressed) {
|
||||
layer_on(_LW);
|
||||
} else {
|
||||
layer_off(_LW);
|
||||
}
|
||||
update_tri_layer(_LW, _RS, _DL);
|
||||
return false;
|
||||
break;
|
||||
case KM_RS:
|
||||
if (record->event.pressed) {
|
||||
layer_on(_RS);
|
||||
} else {
|
||||
layer_off(_RS);
|
||||
}
|
||||
update_tri_layer(_LW, _RS, _DL);
|
||||
return false;
|
||||
break;
|
||||
case KM_SHLK:
|
||||
register_code(KC_LSFT);
|
||||
break;
|
||||
case KM_RST:
|
||||
if (record->event.pressed) {
|
||||
key_timer = timer_read();
|
||||
} else {
|
||||
if (timer_elapsed(key_timer) >= 500) {
|
||||
clear_keyboard();
|
||||
backlight_toggle();
|
||||
_delay_ms(250);
|
||||
backlight_toggle();
|
||||
bootloader_jump();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case KM_PPLR:
|
||||
if (record->event.pressed) {
|
||||
key_timer = timer_read();
|
||||
} else {
|
||||
if (timer_elapsed(key_timer) >= 250) {
|
||||
default_layer_set((1UL << _PP) | (1UL << _PPG));
|
||||
backlight_toggle();
|
||||
_delay_ms(100);
|
||||
backlight_toggle();
|
||||
} else {
|
||||
default_layer_set(1UL << _PP);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case KM_NUM:
|
||||
layer_on(_NM);
|
||||
break;
|
||||
case KM_SLP:
|
||||
if (record->event.pressed) {
|
||||
_delay_ms(250);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (record->event.pressed
|
||||
&& IS_LAYER_ON(_NM)
|
||||
&& keymap_key_to_keycode(_NM, record->event.key) == KC_TRNS) {
|
||||
|
||||
layer_off(_NM);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
return MACRO_NONE;
|
||||
}
|
Loading…
Reference in New Issue