@ -1,7 +1,7 @@
|
|||||||
#define ONESHOT_TIMEOUT 3000
|
#define ONESHOT_TIMEOUT 3000
|
||||||
#define TAPPING_TERM 200
|
#define TAPPING_TERM 200
|
||||||
#define PREVENT_STUCK_MODIFIERS
|
#define PREVENT_STUCK_MODIFIERS
|
||||||
|
#define FORCE_NKRO
|
||||||
#define LEADER_TIMEOUT 1000
|
#define LEADER_TIMEOUT 1000
|
||||||
|
|
||||||
#include "../../config.h"
|
#include "../../config.h"
|
||||||
|
Before Width: | Height: | Size: 448 KiB After Width: | Height: | Size: 446 KiB |
Before Width: | Height: | Size: 420 KiB After Width: | Height: | Size: 415 KiB |
Before Width: | Height: | Size: 423 KiB After Width: | Height: | Size: 423 KiB |
@ -0,0 +1,5 @@
|
|||||||
|
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||||
|
|
||||||
|
ifndef QUANTUM_DIR
|
||||||
|
include ../../../../Makefile
|
||||||
|
endif
|
@ -0,0 +1,12 @@
|
|||||||
|
#ifndef CONFIG_USER_H
|
||||||
|
#define CONFIG_USER_H
|
||||||
|
|
||||||
|
#include "../../config.h"
|
||||||
|
|
||||||
|
/* using UK layout for space-cadet-shift */
|
||||||
|
#define LSPO_KEY KC_9
|
||||||
|
#define RSPC_KEY KC_0
|
||||||
|
|
||||||
|
#define LEADER_TIMEOUT 800 // leader key sequence timeout in millis
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,661 @@
|
|||||||
|
#include "ergodox.h"
|
||||||
|
#include "debug.h"
|
||||||
|
#include "action_layer.h"
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
/* use UK keymap */
|
||||||
|
|
||||||
|
#define UK_HASH KC_NONUS_HASH
|
||||||
|
#define UK_BSLS KC_NONUS_BSLASH
|
||||||
|
#define UK_PIPE LSFT(UK_BSLS)
|
||||||
|
|
||||||
|
#define BASE 0 // default layer
|
||||||
|
#define SYMB 1 // symbols
|
||||||
|
#define NUMB 2 // numbers and hex
|
||||||
|
#define CRSR 3 // cursor keys
|
||||||
|
#define MOUS 4 // mouse keys
|
||||||
|
#define KEYW 5 // keyword macros
|
||||||
|
#define EMAC 6 // emacs
|
||||||
|
|
||||||
|
// my macros
|
||||||
|
#define UM_ECET M(0) // { }
|
||||||
|
#define UM_0x M(1)
|
||||||
|
#define UM_PUB M(2)
|
||||||
|
#define UM_PRO M(3)
|
||||||
|
#define UM_PRV M(4)
|
||||||
|
#define UM_CLS M(5)
|
||||||
|
#define UM_STR M(6)
|
||||||
|
#define UM_RET M(7)
|
||||||
|
#define UM_INC M(8)
|
||||||
|
#define UM_OBJ M(9)
|
||||||
|
#define UM_GITLOG M(10)
|
||||||
|
#define UM_GOODM M(11)
|
||||||
|
#define UM_NAMESP M(12)
|
||||||
|
#define UM_EMTR M(14) // emacs toggle read-only
|
||||||
|
#define UM_EMWR M(15) // emacs write buffer (save)
|
||||||
|
#define UM_EMUN M(16) // emacs undo
|
||||||
|
#define UM_EMRE M(17) // emacs redo
|
||||||
|
#define UM_EMPB M(18) // emacs previous buffer
|
||||||
|
#define UM_EMNB M(19) // emacs next buffer
|
||||||
|
#define UM_GOODN M(20)
|
||||||
|
#define UM_ECETS M(22) // { };
|
||||||
|
#define UM_TMPL M(23)
|
||||||
|
#define UM_TYPN M(24)
|
||||||
|
#define UM_CONT M(25)
|
||||||
|
#define UM_BREAK M(26)
|
||||||
|
#define UM_CONST M(27)
|
||||||
|
#define UM_SMILY M(28)
|
||||||
|
#define UM_SADF M(29)
|
||||||
|
#define UM_SCARF M(30)
|
||||||
|
#define UM_DECAF M(31)
|
||||||
|
#define UM_OPER M(32)
|
||||||
|
#define UM_NULP M(33)
|
||||||
|
#define UM_EXTR M(34)
|
||||||
|
#define UM_VIRT M(35)
|
||||||
|
#define UM_EMFB M(36) // emacs font bigger
|
||||||
|
#define UM_EMFS M(37) // emacs font smaller
|
||||||
|
#define UM_VOLAT M(38)
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
/* Keymap 0: Base layer
|
||||||
|
*
|
||||||
|
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||||
|
* | ESC | 1 | 2 | 3 | 4 | 5 | SfLt | | SfRt | 6 | 7 | 8 | 9 | 0 | BkSp |
|
||||||
|
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||||
|
* | Tab | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | Del |
|
||||||
|
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||||
|
* | Caps/L2| A | S | D | F | G |------| |------| H | J | K | L | ; |Enter/L2|
|
||||||
|
* |--------+------+------+------+------+------| L6 | | L6 |------+------+------+------+------+--------|
|
||||||
|
* | LSft/( | Z | X | C | V/L3 | B/L4 | | | | N/L4 | M/L3 | , | . | / | RSft/) |
|
||||||
|
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||||
|
* |Ctrl/[| Alt/]| # | Left |Right | | Up | Down | - | Alt/[|Ctrl/]|
|
||||||
|
* `----------------------------------' `----------------------------------'
|
||||||
|
* ,-------------. ,-------------.
|
||||||
|
* | L2 | lead | | lead | Ins |
|
||||||
|
* ,------|------|------| |------+------+------.
|
||||||
|
* | Space| BkSp | Home | | PgUp | Enter|Space |
|
||||||
|
* | / | / |------| |------| / | / |
|
||||||
|
* | Ctrl | Alt |End/L5| |PDn/L5| Alt | Ctrl |
|
||||||
|
* `--------------------' `--------------------'
|
||||||
|
*/
|
||||||
|
[BASE] = KEYMAP( // layer 0 : default
|
||||||
|
// left hand
|
||||||
|
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, LSFT(KC_LEFT),
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, MO(SYMB),
|
||||||
|
LT(NUMB, KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G,
|
||||||
|
KC_LSPO, KC_Z, KC_X, KC_C, LT(CRSR, KC_V), LT(MOUS, KC_B), MO(EMAC),
|
||||||
|
CTL_T(KC_LBRC), ALT_T(KC_RBRC), UK_HASH, KC_LEFT, KC_RGHT,
|
||||||
|
TG(NUMB), KC_LEAD,
|
||||||
|
KC_HOME,
|
||||||
|
CTL_T(KC_SPC), ALT_T(KC_BSPC), LT(KEYW, KC_END),
|
||||||
|
// right hand
|
||||||
|
LSFT(KC_RGHT), KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
|
||||||
|
MO(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DELT,
|
||||||
|
KC_H, KC_J, KC_K, KC_L, KC_SCLN, LT(NUMB, KC_ENT),
|
||||||
|
MO(EMAC), LT(MOUS, KC_N), LT(CRSR, KC_M), KC_COMM, KC_DOT, KC_SLSH, KC_RSPC,
|
||||||
|
KC_UP, KC_DOWN, KC_MINS, ALT_T(KC_LBRC), CTL_T(KC_RBRC),
|
||||||
|
KC_LEAD, KC_INS,
|
||||||
|
KC_PGUP,
|
||||||
|
LT(KEYW, KC_PGDN), ALT_T(KC_ENT), CTL_T(KC_SPC)
|
||||||
|
),
|
||||||
|
/* Keymap 1: Symbol Layer with F keys
|
||||||
|
*
|
||||||
|
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||||
|
* | ## | F1 | F2 | F3 | F4 | F5 | ## | | ## | F6 | F7 | F8 | F9 | F10 | F11 |
|
||||||
|
* |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------|
|
||||||
|
* | ## | ! | " | £ | $ | % | ## | | ## | - | + | = | @ | ~ | F12 |
|
||||||
|
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||||
|
* | ## | ^ | & | * | _ | # |------| |------| { | } | ; | ' | # | ## |
|
||||||
|
* |--------+------+------+------+------+------| ## | | ## |------+------+------+------+------+--------|
|
||||||
|
* | ## | \ | | | ` | - | / | | | | [ | ] | < | > | ? | ## |
|
||||||
|
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||||
|
* | ## | ## | ## | ## | ## | | ## | ## | ## | ## | ## |
|
||||||
|
* `----------------------------------' `----------------------------------'
|
||||||
|
* ,-------------. ,-------------.
|
||||||
|
* | ## | ## | | ## | ## |
|
||||||
|
* ,------|------|------| |------+------+------.
|
||||||
|
* | | | ## | | ## | | |
|
||||||
|
* | ## | ## |------| |------| ## | ## |
|
||||||
|
* | | | ## | | ## | | |
|
||||||
|
* `--------------------' `--------------------'
|
||||||
|
*/
|
||||||
|
[SYMB] = KEYMAP(
|
||||||
|
// left hand
|
||||||
|
KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
|
||||||
|
KC_TRNS, KC_EXLM, LSFT(KC_2), LSFT(KC_3), LSFT(KC_4), LSFT(KC_5), KC_TRNS,
|
||||||
|
KC_TRNS, LSFT(KC_6), LSFT(KC_7), LSFT(KC_8), LSFT(KC_MINS), UK_HASH,
|
||||||
|
KC_TRNS, UK_BSLS, UK_PIPE, KC_GRV, KC_MINS, 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,
|
||||||
|
// right hand
|
||||||
|
KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
|
||||||
|
KC_TRNS, KC_MINS, KC_PLUS, KC_EQL, LSFT(KC_QUOT), LSFT(UK_HASH), KC_F12,
|
||||||
|
KC_LCBR, KC_RCBR, KC_SCLN, KC_QUOT, UK_HASH, KC_TRNS,
|
||||||
|
KC_TRNS, KC_LBRC, KC_RBRC, LSFT(KC_COMM), LSFT(KC_DOT), LSFT(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
|
||||||
|
),
|
||||||
|
/* Keymap 2: Numerics and hex
|
||||||
|
*
|
||||||
|
* ,---------------------------------------------------. ,--------------------------------------------------.
|
||||||
|
* | ## | A | B | C | D | E | F | | A | B | C | D | E | F | ## |
|
||||||
|
* |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------|
|
||||||
|
* | ## | * | 7 | 8 | 9 | * | 0x | | 0x | * | 7 | 8 | 9 | * | ## |
|
||||||
|
* |---------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||||
|
* | ## | / | 4 | 5 | 6 | / |------| |------| / | 4 | 5 | 6 | / | ## |
|
||||||
|
* |---------+------+------+------+------+------| ## | | ## |------+------+------+------+------+--------|
|
||||||
|
* | ## | - | 1 | 2 | 3 | - | | | | - | 1 | 2 | 3 | - | ## |
|
||||||
|
* `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||||
|
* | = | + | 0 | , | . | | 0 | , | . | + | = |
|
||||||
|
* `-----------------------------------' `----------------------------------'
|
||||||
|
* ,-------------. ,-------------.
|
||||||
|
* | ## | ## | | ## | ## |
|
||||||
|
* ,------|------|------| |------+------+------.
|
||||||
|
* | | | ## | | ## | | |
|
||||||
|
* | ## | ## |------| |------| ## | ## |
|
||||||
|
* | | | ## | | ## | | |
|
||||||
|
* `--------------------' `--------------------'
|
||||||
|
*/
|
||||||
|
[NUMB] = KEYMAP(
|
||||||
|
// left hand
|
||||||
|
KC_TRNS, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F,
|
||||||
|
KC_TRNS, KC_ASTR, KC_7, KC_8, KC_9, KC_ASTR, UM_0x,
|
||||||
|
KC_TRNS, KC_SLSH, KC_4, KC_5, KC_6, KC_SLSH,
|
||||||
|
KC_TRNS, KC_MINS, KC_1, KC_2, KC_3, KC_MINS, KC_TRNS,
|
||||||
|
KC_EQL, KC_PLUS, KC_0, KC_COMM, KC_DOT,
|
||||||
|
KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
// right hand
|
||||||
|
KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_TRNS,
|
||||||
|
UM_0x, KC_ASTR, KC_7, KC_8, KC_9, KC_ASTR, KC_TRNS,
|
||||||
|
KC_SLSH, KC_4, KC_5, KC_6, KC_SLSH, KC_TRNS,
|
||||||
|
KC_TRNS, KC_MINS, KC_1, KC_2, KC_3, KC_MINS, KC_TRNS,
|
||||||
|
KC_0, KC_COMM, KC_DOT, KC_PLUS, KC_EQL,
|
||||||
|
KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS
|
||||||
|
),
|
||||||
|
/* Keymap 3: Cursor movement
|
||||||
|
*
|
||||||
|
* ,---------------------------------------------------. ,--------------------------------------------------.
|
||||||
|
* | | | | | | | | | | | | | | | |
|
||||||
|
* |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------|
|
||||||
|
* | | Home | | Up | | PgUp | | | | PgUp | | Up | | Home | |
|
||||||
|
* |---------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||||
|
* | | End | Left | Down | Right| PgDn |------| |------| PgDn | Left | Down | Right| End | |
|
||||||
|
* |---------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||||
|
* | ## | Up | | Down | ## | | | | | | ## | Down | | Up | ## |
|
||||||
|
* `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||||
|
* | Left | Down | Right| | | | | | Left | Down | Right|
|
||||||
|
* `-----------------------------------' `----------------------------------'
|
||||||
|
* ,-------------. ,-------------.
|
||||||
|
* | | | | | |
|
||||||
|
* ,------|------|------| |------+------+------.
|
||||||
|
* | | | | | | | |
|
||||||
|
* | ## | ## |------| |------| ## | ## |
|
||||||
|
* | | | | | | | |
|
||||||
|
* `--------------------' `--------------------'
|
||||||
|
*/
|
||||||
|
[CRSR] = KEYMAP(
|
||||||
|
// left hand
|
||||||
|
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||||
|
KC_NO, KC_HOME, KC_NO, KC_UP, KC_NO, KC_PGUP, KC_NO,
|
||||||
|
KC_NO, KC_END, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN,
|
||||||
|
KC_TRNS, KC_UP, KC_NO, KC_DOWN, KC_TRNS, KC_NO, KC_NO,
|
||||||
|
KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO,
|
||||||
|
KC_NO, KC_NO,
|
||||||
|
KC_NO,
|
||||||
|
KC_TRNS, KC_TRNS, KC_NO,
|
||||||
|
// right hand
|
||||||
|
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||||
|
KC_NO, KC_PGUP, KC_NO, KC_UP, KC_NO, KC_HOME, KC_NO,
|
||||||
|
KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_NO,
|
||||||
|
KC_NO, KC_NO, KC_TRNS, KC_DOWN, KC_NO, KC_UP, KC_TRNS,
|
||||||
|
KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT,
|
||||||
|
KC_NO, KC_NO,
|
||||||
|
KC_NO,
|
||||||
|
KC_NO, KC_TRNS, KC_TRNS
|
||||||
|
),
|
||||||
|
/* Keymap 4: Media and mouse keys
|
||||||
|
*
|
||||||
|
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||||
|
* | | | | | | | | | | | | | | | |
|
||||||
|
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||||
|
* | | | Lclk | MsUp | Rclk | | | | | | Lclk | MsUp | Rclk | | |
|
||||||
|
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||||
|
* | | |MsLeft|MsDown|MsRght| |------| |------| |MsLeft|MsDown|MsRght| | |
|
||||||
|
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||||
|
* | Lclk | MsUp | Rclk |MsDown| | ## | | | | ## | |MsDown| Lclk | MsUp | Rclk |
|
||||||
|
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||||
|
* |MsLeft|MsDown|MsRight | | | | |MsLeft|MsDown|MsRght|
|
||||||
|
* `----------------------------------' `----------------------------------'
|
||||||
|
* ,-------------. ,-------------.
|
||||||
|
* | | | | | |
|
||||||
|
* ,------|------|------| |------+------+------.
|
||||||
|
* | | | | | | | |
|
||||||
|
* | | |------| |------| | |
|
||||||
|
* | | | | | | | |
|
||||||
|
* `--------------------' `--------------------'
|
||||||
|
*/
|
||||||
|
[MOUS] = KEYMAP(
|
||||||
|
// left hand
|
||||||
|
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||||
|
KC_NO, KC_NO, KC_BTN1, KC_MS_U, KC_BTN2, KC_NO, KC_NO,
|
||||||
|
KC_NO, KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO,
|
||||||
|
KC_BTN1, KC_MS_U, KC_BTN2, KC_MS_D, KC_NO, KC_TRNS, KC_NO,
|
||||||
|
KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, KC_NO,
|
||||||
|
KC_NO, KC_NO,
|
||||||
|
KC_NO,
|
||||||
|
KC_NO, KC_NO, KC_NO,
|
||||||
|
// right hand
|
||||||
|
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||||
|
KC_NO, KC_NO, KC_BTN1, KC_MS_U, KC_BTN2, KC_NO, KC_NO,
|
||||||
|
KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, KC_NO,
|
||||||
|
KC_NO, KC_TRNS, KC_NO, KC_MS_D, KC_BTN1, KC_MS_U, KC_BTN2,
|
||||||
|
KC_NO, KC_NO, KC_MS_L, KC_MS_D, KC_MS_R,
|
||||||
|
KC_NO, KC_NO,
|
||||||
|
KC_NO,
|
||||||
|
KC_NO, KC_NO, KC_NO
|
||||||
|
),
|
||||||
|
/* Keymap 5: Keywords
|
||||||
|
*
|
||||||
|
* ,---------------------------------------------------. ,--------------------------------------------------.
|
||||||
|
* | | | | scarf| sadf | smily| | | | decaf| | | | | |
|
||||||
|
* |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------|
|
||||||
|
* | | const| volat| oper | ret | tmpl | | | | typen| cont | prv | pro | pub | |
|
||||||
|
* |---------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||||
|
* | | | str | obj | | gitl |------| |------| | | | nulp | | |
|
||||||
|
* |---------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||||
|
* | | | extr | cls | virt | break| | | |namesp| goodm| goodn| | | |
|
||||||
|
* `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||||
|
* | | | inc | | | | | | | | |
|
||||||
|
* `-----------------------------------' `----------------------------------'
|
||||||
|
* ,-------------. ,-------------.
|
||||||
|
* | | | | ecet | ecets|
|
||||||
|
* ,------|------|------| |------+------+------.
|
||||||
|
* | | | | | | | |
|
||||||
|
* | | |------| |------| | |
|
||||||
|
* | | | ## | | ## | | |
|
||||||
|
* `--------------------' `--------------------'
|
||||||
|
*/
|
||||||
|
[KEYW] = KEYMAP(
|
||||||
|
// left hand
|
||||||
|
KC_NO, KC_NO, KC_NO, UM_SCARF, UM_SADF, UM_SMILY, KC_NO,
|
||||||
|
KC_NO, UM_CONST, UM_VOLAT, UM_OPER, UM_RET, UM_TMPL, KC_NO,
|
||||||
|
KC_NO, KC_NO, UM_STR, UM_OBJ, KC_NO, UM_GITLOG,
|
||||||
|
KC_NO, KC_NO, UM_EXTR, UM_CLS, UM_VIRT, UM_BREAK, KC_NO,
|
||||||
|
KC_NO, KC_NO, UM_INC, KC_NO, KC_NO,
|
||||||
|
KC_NO, KC_NO,
|
||||||
|
KC_NO,
|
||||||
|
KC_NO, KC_NO, KC_TRNS,
|
||||||
|
// right hand
|
||||||
|
KC_NO, UM_DECAF, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||||
|
KC_NO, UM_TYPN, UM_CONT, UM_PRV, UM_PRO, UM_PUB, KC_NO,
|
||||||
|
KC_NO, KC_NO, KC_NO, UM_NULP, KC_NO, KC_NO,
|
||||||
|
KC_NO, UM_NAMESP, UM_GOODM, UM_GOODN, KC_NO, KC_NO, KC_NO,
|
||||||
|
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||||
|
UM_ECET, UM_ECETS,
|
||||||
|
KC_NO,
|
||||||
|
KC_TRNS, KC_NO, KC_NO
|
||||||
|
),
|
||||||
|
/* Keymap 6: emacs
|
||||||
|
*
|
||||||
|
* ,---------------------------------------------------. ,--------------------------------------------------.
|
||||||
|
* | | | | | | | empb | | emnb | emfs | emfb | | | | |
|
||||||
|
* |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------|
|
||||||
|
* | | emtr | | | | | | | | emun | emre | w-up | | | |
|
||||||
|
* |---------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||||
|
* | | | emwr | | | |------| |------| |w-left|w-down|w-rght| | |
|
||||||
|
* |---------+------+------+------+------+------| ## | | ## |------+------+------+------+------+--------|
|
||||||
|
* | | | | | | | | | | | |w-down| | | |
|
||||||
|
* `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||||
|
* | | | | | | | | | | | |
|
||||||
|
* `-----------------------------------' `----------------------------------'
|
||||||
|
* ,-------------. ,-------------.
|
||||||
|
* | | | | | |
|
||||||
|
* ,------|------|------| |------+------+------.
|
||||||
|
* | | | | | | | |
|
||||||
|
* | | |------| |------| | |
|
||||||
|
* | | | | | | | |
|
||||||
|
* `--------------------' `--------------------'
|
||||||
|
*/
|
||||||
|
[EMAC] = KEYMAP(
|
||||||
|
// left hand
|
||||||
|
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, UM_EMPB,
|
||||||
|
KC_NO, UM_EMTR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||||
|
KC_NO, KC_NO, UM_EMWR, 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_NO,
|
||||||
|
KC_NO,
|
||||||
|
KC_NO, KC_NO, KC_NO,
|
||||||
|
// right hand
|
||||||
|
UM_EMNB, UM_EMFS, UM_EMFB, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||||
|
KC_NO, UM_EMUN, UM_EMRE, LSFT(KC_UP), KC_NO, KC_NO, KC_NO,
|
||||||
|
KC_NO, LSFT(KC_LEFT), LSFT(KC_DOWN), LSFT(KC_RGHT), KC_NO, KC_NO,
|
||||||
|
KC_TRNS, KC_NO, KC_NO, LSFT(KC_DOWN), 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
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
enum next_key_down_up {
|
||||||
|
NK_DOWN_UP,
|
||||||
|
NK_DOWN,
|
||||||
|
NK_UP // a bit of a hack, this works as long as NK_UP < KC_A
|
||||||
|
};
|
||||||
|
|
||||||
|
void send_keystrokes(uint8_t key, ...)
|
||||||
|
{
|
||||||
|
va_list vl;
|
||||||
|
va_start(vl, key);
|
||||||
|
enum next_key_down_up nkdu = NK_DOWN_UP;
|
||||||
|
while (key != KC_NO) {
|
||||||
|
if (key < KC_A) {
|
||||||
|
nkdu = key;
|
||||||
|
} else {
|
||||||
|
switch (nkdu) {
|
||||||
|
case NK_DOWN_UP:
|
||||||
|
register_code(key);
|
||||||
|
case NK_UP:
|
||||||
|
unregister_code(key);
|
||||||
|
break;
|
||||||
|
case NK_DOWN:
|
||||||
|
register_code(key);
|
||||||
|
}
|
||||||
|
nkdu = NK_DOWN_UP;
|
||||||
|
}
|
||||||
|
key = va_arg(vl, int);
|
||||||
|
}
|
||||||
|
va_end(vl);
|
||||||
|
}
|
||||||
|
|
||||||
|
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) {
|
||||||
|
return MACRO(T(ENT), D(LSFT), T(LBRC), U(LSFT), T(ENT),
|
||||||
|
D(LSFT), T(RBRC), U(LSFT), T(UP),
|
||||||
|
T(TAB), END);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
return MACRO(T(0), T(X), END);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("public");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("protected");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("private");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 5: // class
|
||||||
|
if (record->event.pressed) {
|
||||||
|
return MACRO(T(C), T(L), T(A), T(S), T(S), T(ENT),
|
||||||
|
D(LSFT), T(LBRC), U(LSFT), T(ENT),
|
||||||
|
T(P), T(U), T(B), T(L), T(I), T(C),
|
||||||
|
D(LSFT), T(SCLN), U(LSFT), T(ENT), T(ENT),
|
||||||
|
T(P), T(R), T(I), T(V), T(A), T(T), T(E),
|
||||||
|
D(LSFT), T(SCLN), U(LSFT), T(ENT),
|
||||||
|
D(LSFT), T(RBRC), U(LSFT), T(SCLN), T(ENT),
|
||||||
|
T(UP), T(UP), T(UP), T(UP), T(UP), T(UP), T(UP),
|
||||||
|
T(END), T(SPC), END);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 6: // struct
|
||||||
|
if (record->event.pressed) {
|
||||||
|
return MACRO(T(S), T(T), T(R), T(U), T(C), T(T), T(ENT),
|
||||||
|
D(LSFT), T(LBRC), U(LSFT), T(ENT),
|
||||||
|
D(LSFT), T(RBRC), U(LSFT), T(SCLN), T(ENT),
|
||||||
|
T(UP), T(UP), T(UP), T(UP),
|
||||||
|
T(END), T(SPC), END);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("return");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 8: // #include
|
||||||
|
if (record->event.pressed) {
|
||||||
|
return MACRO(T(NONUS_HASH), T(I), T(N), T(C), T(L), T(U), T(D), T(E), END);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("objdump -CT -x -d");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("git log --oneline --graph --decorate=short");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 11:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("good morning");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 12:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("namespace");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 14: // emacs toggle read-only
|
||||||
|
if (record->event.pressed) {
|
||||||
|
return MACRO(D(LCTL), T(X), T(Q), U(LCTL), END);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 15: // emacs write buffer
|
||||||
|
if (record->event.pressed) {
|
||||||
|
return MACRO(D(LCTL), T(X), T(S), U(LCTL), END);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 16: // emacs undo
|
||||||
|
if (record->event.pressed) {
|
||||||
|
return MACRO(D(LCTL), D(LSFT), T(MINS), U(LSFT), U(LCTL), END);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 17: // emacs redo
|
||||||
|
if (record->event.pressed) {
|
||||||
|
return MACRO(D(LALT), D(LSFT), T(MINS), U(LSFT), U(LALT), END);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 18: // emacs previous buffer
|
||||||
|
if (record->event.pressed) {
|
||||||
|
return MACRO(D(LCTL), T(X), U(LCTL), T(LEFT), END);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 19: // emacs next buffer
|
||||||
|
if (record->event.pressed) {
|
||||||
|
return MACRO(D(LCTL), T(X), U(LCTL), T(RGHT), END);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 20:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("good night");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 22: // { };
|
||||||
|
if (record->event.pressed) {
|
||||||
|
return MACRO(T(ENT), D(LSFT), T(LBRC), U(LSFT), T(ENT),
|
||||||
|
D(LSFT), T(RBRC), U(LSFT), T(SCLN), T(UP),
|
||||||
|
T(TAB), END);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 23:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("template");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 24:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("typename");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 25:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("continue");
|
||||||
|
return MACRO(T(SCLN), END);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 26:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("break");
|
||||||
|
return MACRO(T(SCLN), END);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 27:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("const");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 28:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING(":-)");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 29:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING(":-(");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 30: // dazed
|
||||||
|
if (record->event.pressed) {
|
||||||
|
send_keystrokes(NK_DOWN, KC_LSFT, KC_8, KC_MINS, KC_8, NK_UP, KC_LSFT, KC_NO);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 31: // decaf
|
||||||
|
if (record->event.pressed) {
|
||||||
|
send_keystrokes(NK_DOWN, KC_LSFT, KC_C, KC_9, KC_MINS, KC_0, NK_UP, KC_LSFT, KC_NO);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 32:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("operator");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 33:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("nullptr");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 34:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("extern");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 35:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("virtual");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 36: // emacs font smaller
|
||||||
|
if (record->event.pressed) {
|
||||||
|
return MACRO(D(LCTL), T(X), T(EQL), U(LCTL), END);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 37: // emacs font bigger
|
||||||
|
if (record->event.pressed) {
|
||||||
|
return MACRO(D(LCTL), T(X), T(MINS), U(LCTL), END);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 38:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("volatile");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return MACRO_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
LEADER_EXTERNS();
|
||||||
|
|
||||||
|
// Runs constantly in the background, in a loop.
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
|
||||||
|
LEADER_DICTIONARY() {
|
||||||
|
leading = false;
|
||||||
|
leader_end();
|
||||||
|
|
||||||
|
SEQ_TWO_KEYS(KC_G, KC_A) {
|
||||||
|
SEND_STRING("git add .");
|
||||||
|
}
|
||||||
|
SEQ_TWO_KEYS(KC_G, KC_D) {
|
||||||
|
SEND_STRING("git diff");
|
||||||
|
}
|
||||||
|
SEQ_THREE_KEYS(KC_G, KC_D, KC_S) {
|
||||||
|
SEND_STRING("git diff --staged");
|
||||||
|
}
|
||||||
|
SEQ_TWO_KEYS(KC_G, KC_L) {
|
||||||
|
SEND_STRING("git log");
|
||||||
|
}
|
||||||
|
SEQ_THREE_KEYS(KC_G, KC_L, KC_O) {
|
||||||
|
SEND_STRING("git log --oneline");
|
||||||
|
}
|
||||||
|
SEQ_TWO_KEYS(KC_G, KC_F) {
|
||||||
|
SEND_STRING("git fetch");
|
||||||
|
}
|
||||||
|
SEQ_TWO_KEYS(KC_G, KC_O) {
|
||||||
|
SEND_STRING("git checkout");
|
||||||
|
}
|
||||||
|
SEQ_TWO_KEYS(KC_G, KC_P) {
|
||||||
|
SEND_STRING("git pull");
|
||||||
|
}
|
||||||
|
SEQ_TWO_KEYS(KC_G, KC_S) {
|
||||||
|
SEND_STRING("git status");
|
||||||
|
}
|
||||||
|
SEQ_TWO_KEYS(KC_G, KC_C) {
|
||||||
|
SEND_STRING("git commit -m ''");
|
||||||
|
send_keystrokes(KC_LEFT, KC_NO);
|
||||||
|
}
|
||||||
|
SEQ_THREE_KEYS(KC_G, KC_C, KC_A) {
|
||||||
|
SEND_STRING("git commit --amend");
|
||||||
|
}
|
||||||
|
|
||||||
|
SEQ_TWO_KEYS(KC_C, KC_C) {
|
||||||
|
SEND_STRING("const_cast<>");
|
||||||
|
send_keystrokes(KC_LEFT, KC_NO);
|
||||||
|
}
|
||||||
|
SEQ_TWO_KEYS(KC_C, KC_D) {
|
||||||
|
SEND_STRING("dynamic_cast<>");
|
||||||
|
send_keystrokes(KC_LEFT, KC_NO);
|
||||||
|
}
|
||||||
|
SEQ_TWO_KEYS(KC_C, KC_R) {
|
||||||
|
SEND_STRING("reinterpret_cast<>");
|
||||||
|
send_keystrokes(KC_LEFT, KC_NO);
|
||||||
|
}
|
||||||
|
SEQ_TWO_KEYS(KC_C, KC_S) {
|
||||||
|
SEND_STRING("static_cast<>");
|
||||||
|
send_keystrokes(KC_LEFT, KC_NO);
|
||||||
|
}
|
||||||
|
|
||||||
|
SEQ_ONE_KEY(KC_SLSH) {
|
||||||
|
send_keystrokes(KC_SLSH, NK_DOWN, KC_LSFT, KC_8, KC_8, NK_UP, KC_LSFT, KC_ENT,
|
||||||
|
NK_DOWN, KC_LSFT, KC_8, NK_UP, KC_LSFT, KC_ENT,
|
||||||
|
NK_DOWN, KC_LSFT, KC_8, NK_UP, KC_LSFT, KC_SLSH, KC_UP, KC_END, KC_SPC,
|
||||||
|
KC_NO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,188 @@
|
|||||||
|
# ErgoDox EZ Configuration for typing like a boss.
|
||||||
|
|
||||||
|
This layout has 7 layers:
|
||||||
|
0. Base layers
|
||||||
|
1. Symbols and F-keys
|
||||||
|
2. Number pad (with hexadecimal)
|
||||||
|
3. Cursor keys
|
||||||
|
4. Mouse movement and clicks
|
||||||
|
5. Keyword macros
|
||||||
|
6. Emacs
|
||||||
|
|
||||||
|
There are also some leader keys defined for frequently used commands (git etc).
|
||||||
|
|
||||||
|
## The layers
|
||||||
|
|
||||||
|
Double hashes (`##`) indicate transparent keys (`KC_TRNS`) and blanks indicate no key (`KC_NO`).
|
||||||
|
|
||||||
|
### 0. Base layer
|
||||||
|
|
||||||
|
```
|
||||||
|
,--------------------------------------------------. ,--------------------------------------------------.
|
||||||
|
| ESC | 1 | 2 | 3 | 4 | 5 | SfLt | | SfRt | 6 | 7 | 8 | 9 | 0 | BkSp |
|
||||||
|
|--------|------|------|------|------|-------------| |------|------|------|------|------|------|--------|
|
||||||
|
| Tab | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | Del |
|
||||||
|
|--------|------|------|------|------|------| | | |------|------|------|------|------|--------|
|
||||||
|
| Caps/L2| A | S | D | F | G |------| |------| H | J | K | L | ; |Enter/L2|
|
||||||
|
|--------|------|------|------|------|------| L6 | | L6 |------|------|------|------|------|--------|
|
||||||
|
| LSft/( | Z | X | C | V/L3 | B/L4 | | | | N/L4 | M/L3 | , | . | / | RSft/) |
|
||||||
|
`--------|------|------|------|------|-------------' `-------------|------|------|------|------|--------'
|
||||||
|
|Ctrl/[| Alt/]| # | Left |Right | | Up | Down | - | Alt/[|Ctrl/]|
|
||||||
|
`----------------------------------' `----------------------------------'
|
||||||
|
,-------------. ,-------------.
|
||||||
|
| L2 | lead | | lead | Ins |
|
||||||
|
,------|------|------| |------|------|------.
|
||||||
|
| Space| BkSp | Home | | PgUp | Enter|Space |
|
||||||
|
| / | / |------| |------| / | / |
|
||||||
|
| Ctrl | Alt |End/L5| |PDn/L5| Alt | Ctrl |
|
||||||
|
`--------------------' `--------------------'
|
||||||
|
```
|
||||||
|
|
||||||
|
Space Cadet shift is enabled. Ctrl and Alt doubles up as normal keys when tapped.
|
||||||
|
SfLt and SfRt sends Shift + left and Shift + Right respectively - for use with emacs with `windmove-default-keybindings`.
|
||||||
|
Caps and Enter may be held down to activate layer 2 (hexadecimal number pad).
|
||||||
|
Please see `matrix_scan_user` function in `keymap.c` for list of commands available via `lead` key.
|
||||||
|
|
||||||
|
### 1. Symbols and F-keys
|
||||||
|
|
||||||
|
```
|
||||||
|
,--------------------------------------------------. ,--------------------------------------------------.
|
||||||
|
| ## | F1 | F2 | F3 | F4 | F5 | ## | | ## | F6 | F7 | F8 | F9 | F10 | F11 |
|
||||||
|
|--------|------|------|------|------|------|------| |------|------|------|------|------|------|--------|
|
||||||
|
| ## | ! | " | £ | $ | % | ## | | ## | - | + | = | @ | ~ | F12 |
|
||||||
|
|--------|------|------|------|------|------| | | |------|------|------|------|------|--------|
|
||||||
|
| ## | ^ | & | * | _ | # |------| |------| { | } | ; | ' | # | ## |
|
||||||
|
|--------|------|------|------|------|------| ## | | ## |------|------|------|------|------|--------|
|
||||||
|
| ## | \ | | | ` | - | / | | | | [ | ] | < | > | ? | ## |
|
||||||
|
`--------|------|------|------|------|-------------' `-------------|------|------|------|------|--------'
|
||||||
|
| ## | ## | ## | ## | ## | | ## | ## | ## | ## | ## |
|
||||||
|
`----------------------------------' `----------------------------------'
|
||||||
|
,-------------. ,-------------.
|
||||||
|
| ## | ## | | ## | ## |
|
||||||
|
,------|------|------| |------|------|------.
|
||||||
|
| | | ## | | ## | | |
|
||||||
|
| ## | ## |------| |------| ## | ## |
|
||||||
|
| | | ## | | ## | | |
|
||||||
|
`--------------------' `--------------------'
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. Number pad (with hexadecimal)
|
||||||
|
|
||||||
|
```
|
||||||
|
,---------------------------------------------------. ,--------------------------------------------------.
|
||||||
|
| ## | A | B | C | D | E | F | | A | B | C | D | E | F | ## |
|
||||||
|
|---------|------|------|------|------|------|------| |------|------|------|------|------|------|--------|
|
||||||
|
| ## | * | 7 | 8 | 9 | * | 0x | | 0x | * | 7 | 8 | 9 | * | ## |
|
||||||
|
|---------|------|------|------|------|------| | | |------|------|------|------|------|--------|
|
||||||
|
| ## | / | 4 | 5 | 6 | / |------| |------| / | 4 | 5 | 6 | / | ## |
|
||||||
|
|---------|------|------|------|------|------| ## | | ## |------|------|------|------|------|--------|
|
||||||
|
| ## | - | 1 | 2 | 3 | - | | | | - | 1 | 2 | 3 | - | ## |
|
||||||
|
`---------|------|------|------|------|-------------' `-------------|------|------|------|------|--------'
|
||||||
|
| = | + | 0 | , | . | | 0 | , | . | + | = |
|
||||||
|
`-----------------------------------' `----------------------------------'
|
||||||
|
,-------------. ,-------------.
|
||||||
|
| ## | ## | | ## | ## |
|
||||||
|
,------|------|------| |------|------|------.
|
||||||
|
| | | ## | | ## | | |
|
||||||
|
| ## | ## |------| |------| ## | ## |
|
||||||
|
| | | ## | | ## | | |
|
||||||
|
`--------------------' `--------------------'
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. Cursor keys
|
||||||
|
|
||||||
|
```
|
||||||
|
,---------------------------------------------------. ,--------------------------------------------------.
|
||||||
|
| | | | | | | | | | | | | | | |
|
||||||
|
|---------|------|------|------|------|------|------| |------|------|------|------|------|------|--------|
|
||||||
|
| | Home | | Up | | PgUp | | | | PgUp | | Up | | Home | |
|
||||||
|
|---------|------|------|------|------|------| | | |------|------|------|------|------|--------|
|
||||||
|
| | End | Left | Down | Right| PgDn |------| |------| PgDn | Left | Down | Right| End | |
|
||||||
|
|---------|------|------|------|------|------| | | |------|------|------|------|------|--------|
|
||||||
|
| ## | Up | | Down | ## | | | | | | ## | Down | | Up | ## |
|
||||||
|
`---------|------|------|------|------|-------------' `-------------|------|------|------|------|--------'
|
||||||
|
| Left | Down | Right| | | | | | Left | Down | Right|
|
||||||
|
`-----------------------------------' `----------------------------------'
|
||||||
|
,-------------. ,-------------.
|
||||||
|
| | | | | |
|
||||||
|
,------|------|------| |------|------|------.
|
||||||
|
| | | | | | | |
|
||||||
|
| ## | ## |------| |------| ## | ## |
|
||||||
|
| | | | | | | |
|
||||||
|
`--------------------' `--------------------'
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4. Mouse movement and clicks
|
||||||
|
|
||||||
|
```
|
||||||
|
,--------------------------------------------------. ,--------------------------------------------------.
|
||||||
|
| | | | | | | | | | | | | | | |
|
||||||
|
|--------|------|------|------|------|-------------| |------|------|------|------|------|------|--------|
|
||||||
|
| | | Lclk | MsUp | Rclk | | | | | | Lclk | MsUp | Rclk | | |
|
||||||
|
|--------|------|------|------|------|------| | | |------|------|------|------|------|--------|
|
||||||
|
| | |MsLeft|MsDown|MsRght| |------| |------| |MsLeft|MsDown|MsRght| | |
|
||||||
|
|--------|------|------|------|------|------| | | |------|------|------|------|------|--------|
|
||||||
|
| Lclk | MsUp | Rclk |MsDown| | ## | | | | ## | |MsDown| Lclk | MsUp | Rclk |
|
||||||
|
`--------|------|------|------|------|-------------' `-------------|------|------|------|------|--------'
|
||||||
|
|MsLeft|MsDown|MsRight | | | | |MsLeft|MsDown|MsRght|
|
||||||
|
`----------------------------------' `----------------------------------'
|
||||||
|
,-------------. ,-------------.
|
||||||
|
| | | | | |
|
||||||
|
,------|------|------| |------|------|------.
|
||||||
|
| | | | | | | |
|
||||||
|
| | |------| |------| | |
|
||||||
|
| | | | | | | |
|
||||||
|
`--------------------' `--------------------'
|
||||||
|
```
|
||||||
|
|
||||||
|
### 5. Keyword macros
|
||||||
|
|
||||||
|
```
|
||||||
|
,---------------------------------------------------. ,--------------------------------------------------.
|
||||||
|
| | | | scarf| sadf | smily| | | | decaf| | | | | |
|
||||||
|
|---------|------|------|------|------|------|------| |------|------|------|------|------|------|--------|
|
||||||
|
| | const| volat| oper | ret | tmpl | | | | typen| cont | prv | pro | pub | |
|
||||||
|
|---------|------|------|------|------|------| | | |------|------|------|------|------|--------|
|
||||||
|
| | | str | obj | | gitl |------| |------| | | | nulp | | |
|
||||||
|
|---------|------|------|------|------|------| | | |------|------|------|------|------|--------|
|
||||||
|
| | | extr | cls | virt | break| | | |namesp| goodm| goodn| | | |
|
||||||
|
`---------|------|------|------|------|-------------' `-------------|------|------|------|------|--------'
|
||||||
|
| | | inc | | | | | | | | |
|
||||||
|
`-----------------------------------' `----------------------------------'
|
||||||
|
,-------------. ,-------------.
|
||||||
|
| | | | ecet | ecets|
|
||||||
|
,------|------|------| |------|------|------.
|
||||||
|
| | | | | | | |
|
||||||
|
| | |------| |------| | |
|
||||||
|
| | | ## | | ## | | |
|
||||||
|
`--------------------' `--------------------'
|
||||||
|
```
|
||||||
|
Please see `keymap.c` for the keywords/commands.
|
||||||
|
Some are const, volatile, operator, return, template, typename, continue, private,
|
||||||
|
protected, public, struct, class, extern, virtual, break, namespace.
|
||||||
|
Also a git log command I use a lot (`git log --oneline --graph --decorate=short` (I know git can be configured but that is boring)).
|
||||||
|
|
||||||
|
### 6. Emacs
|
||||||
|
|
||||||
|
```
|
||||||
|
,---------------------------------------------------. ,--------------------------------------------------.
|
||||||
|
| | | | | | | empb | | emnb | emfs | emfb | | | | |
|
||||||
|
|---------|------|------|------|------|------|------| |------|------|------|------|------|------|--------|
|
||||||
|
| | emtr | | | | | | | | emun | emre | w-up | | | |
|
||||||
|
|---------|------|------|------|------|------| | | |------|------|------|------|------|--------|
|
||||||
|
| | | emwr | | | |------| |------| |w-left|w-down|w-rght| | |
|
||||||
|
|---------|------|------|------|------|------| ## | | ## |------|------|------|------|------|--------|
|
||||||
|
| | | | | | | | | | | |w-down| | | |
|
||||||
|
`---------|------|------|------|------|-------------' `-------------|------|------|------|------|--------'
|
||||||
|
| | | | | | | | | | | |
|
||||||
|
`-----------------------------------' `----------------------------------'
|
||||||
|
,-------------. ,-------------.
|
||||||
|
| | | | | |
|
||||||
|
,------|------|------| |------|------|------.
|
||||||
|
| | | | | | | |
|
||||||
|
| | |------| |------| | |
|
||||||
|
| | | | | | | |
|
||||||
|
`--------------------' `--------------------'
|
||||||
|
```
|
||||||
|
Some emacs shortcuts like toggle read/write mode (emtr), write file (emwr), previous-buffer (empb),
|
||||||
|
next-buffer (emnb), smaller font(emfs), larger font (emfb), undo (emun), redo (emre) and switching between windows in a frame.
|
@ -0,0 +1 @@
|
|||||||
|
UNICODE_ENABLE = yes
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 58 KiB |
@ -0,0 +1,3 @@
|
|||||||
|
ifndef MAKEFILE_INCLUDED
|
||||||
|
include ../../Makefile
|
||||||
|
endif
|
@ -0,0 +1,43 @@
|
|||||||
|
#ifndef CONFIG_H
|
||||||
|
#define CONFIG_H
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
/* USB Device descriptor parameter */
|
||||||
|
#define VENDOR_ID 0xFEED
|
||||||
|
#define PRODUCT_ID 0x6060
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER GON
|
||||||
|
#define PRODUCT NerD
|
||||||
|
#define DESCRIPTION QMK port for the GON Nerd PCB
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 10
|
||||||
|
#define MATRIX_COLS 9
|
||||||
|
|
||||||
|
/* backlight */
|
||||||
|
#define BACKLIGHT_PIN B7
|
||||||
|
#define BACKLIGHT_LEVELS 3
|
||||||
|
|
||||||
|
/* matrix pins */
|
||||||
|
#define MATRIX_ROW_PINS { B4, E2, F4, F7, F1, F6, C6, F5, D7, C7 }
|
||||||
|
#define MATRIX_COL_PINS { E6, B0, B1, B2, B3, F0, D0, D5, D1 }
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
/* COL2ROW or ROW2COL */
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not 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 magic key command */
|
||||||
|
#define IS_COMMAND() ( \
|
||||||
|
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||||
|
)
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1 @@
|
|||||||
|
#include "gonnerd.h"
|
@ -0,0 +1,42 @@
|
|||||||
|
#ifndef GONNERD_H
|
||||||
|
#define GONNERD_H
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
#define KEYMAP_TKL( \
|
||||||
|
K08, K09, K18, K19, K28, K29, K38, K39, K48, K49, K58, K59, K68, K69, K88, K89, \
|
||||||
|
K00, K01, K10, K11, K20, K21, K30, K31, K40, K41, K50, K51, K60, K61, K80, K81, K84, \
|
||||||
|
K02, K03, K12, K13, K22, K23, K32, K33, K42, K43, K52, K53, K62, K63, K82, K83, K85, \
|
||||||
|
K04, K14, K15, K24, K25, K34, K35, K44, K45, K54, K55, K64, K71, K65, \
|
||||||
|
K07, K79, K16, K17, K26, K27, K36, K37, K46, K47, K56, K57, K66, K67, K86, \
|
||||||
|
K06, K05, K78, K70, K72, K73, K74, K75, K76, K77, K87 \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ K00, K10, K20, K30, K40, K50, K60, K70, K80 }, \
|
||||||
|
{ K01, K11, K21, K31, K41, K51, K61, K71, K81 }, \
|
||||||
|
{ K02, K12, K22, K32, K42, K52, K62, K72, K82 }, \
|
||||||
|
{ K03, K13, K23, K33, K43, K53, K63, K73, K83 }, \
|
||||||
|
{ K04, K14, K24, K34, K44, K54, K64, K74, K84 }, \
|
||||||
|
{ K05, K15, K25, K35, K45, K55, K65, K75, K85 }, \
|
||||||
|
{ K06, K16, K26, K36, K46, K56, K66, K76, K86 }, \
|
||||||
|
{ K07, K17, K27, K37, K47, K57, K67, K77, K87 }, \
|
||||||
|
{ K08, K18, K28, K38, K48, K58, K68, K78, K88 }, \
|
||||||
|
{ K09, K19, K29, K39, K49, K59, K69, K79, K89 } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define KEYMAP_60( \
|
||||||
|
K08, K01, K10, K11, K20, K21, K30, K31, K40, K41, K50, K51, K60, K61, \
|
||||||
|
K02, K03, K12, K13, K22, K23, K32, K33, K42, K43, K52, K53, K62, K63, \
|
||||||
|
K04, K14, K15, K24, K25, K34, K35, K44, K45, K54, K55, K64, K71, K65, \
|
||||||
|
K07, K79, K16, K17, K26, K27, K36, K37, K46, K47, K56, K57, K66, K67, \
|
||||||
|
K06, K05, K78, K70, K72, K73, K74, K75 \
|
||||||
|
) KEYMAP_TKL( \
|
||||||
|
K08, 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, K01, K10, K11, K20, K21, K30, K31, K40, K41, K50, K51, K60, K61, KC_NO, KC_NO, KC_NO, \
|
||||||
|
K02, K03, K12, K13, K22, K23, K32, K33, K42, K43, K52, K53, K62, K63, KC_NO, KC_NO, KC_NO, \
|
||||||
|
K04, K14, K15, K24, K25, K34, K35, K44, K45, K54, K55, K64, K71, K65, \
|
||||||
|
K07, K79, K16, K17, K26, K27, K36, K37, K46, K47, K56, K57, K66, K67, KC_NO, \
|
||||||
|
K06, K05, K78, K70, K72, K73, K74, K75, KC_NO, KC_NO, KC_NO \
|
||||||
|
)
|
||||||
|
|
||||||
|
#endif
|
@ -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 = yes # Mouse keys(+4700)
|
||||||
|
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||||
|
CONSOLE_ENABLE = no # 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 = no # 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.
|
||||||
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
|
||||||
|
ifndef QUANTUM_DIR
|
||||||
|
include ../../../../Makefile
|
||||||
|
endif
|
@ -0,0 +1,16 @@
|
|||||||
|
#include "gonnerd.h"
|
||||||
|
|
||||||
|
// Keymap layers
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = KEYMAP_60( /* Base */
|
||||||
|
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC,\
|
||||||
|
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,\
|
||||||
|
KC_LCTL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_NO, KC_ENT, \
|
||||||
|
KC_LSFT,KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT,KC_NO, \
|
||||||
|
KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,MO(1), KC_RCTL),
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM fn_actions[] = {
|
||||||
|
|
||||||
|
};
|
@ -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 = yes # Mouse keys(+4700)
|
||||||
|
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||||
|
CONSOLE_ENABLE = no # 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 = no # 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.
|
||||||
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
|
||||||
|
ifndef QUANTUM_DIR
|
||||||
|
include ../../../../Makefile
|
||||||
|
endif
|
@ -0,0 +1,78 @@
|
|||||||
|
#include "gonnerd.h"
|
||||||
|
|
||||||
|
// Keymap layers
|
||||||
|
#define BASE_LAYER 0
|
||||||
|
#define FUNCTION_LAYER 1
|
||||||
|
#define SYSTEM_LAYER 2
|
||||||
|
|
||||||
|
// Key aliases
|
||||||
|
#define __x__ KC_NO
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
/* Layer 0: Default Layer
|
||||||
|
* ,-----------------------------------------------------------.
|
||||||
|
* |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| = | BSp |
|
||||||
|
* |-----------------------------------------------------------|
|
||||||
|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \|
|
||||||
|
* |-----------------------------------------------------------|
|
||||||
|
* |Funct | A| S| D| F| G| H| J| K| L| ;| '|Enter |
|
||||||
|
* |-----------------------------------------------------------|
|
||||||
|
* |Shift | Z| X| C| V| B| N| M| ,| .| /| Shift |
|
||||||
|
* |-----------------------------------------------------------'
|
||||||
|
* | Ctl|Alt|Gui | Space |Gui |Alt| F2| Ctl |
|
||||||
|
* `-----------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[BASE_LAYER] = KEYMAP_60(
|
||||||
|
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \
|
||||||
|
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, \
|
||||||
|
MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, __x__, KC_ENT, \
|
||||||
|
KC_LSFT, __x__, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, __x__, \
|
||||||
|
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, MO(3), KC_RCTL \
|
||||||
|
),
|
||||||
|
|
||||||
|
/* Layer 1: Function Layer
|
||||||
|
* ,-----------------------------------------------------------.
|
||||||
|
* | | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11| F12| Del |
|
||||||
|
* |-----------------------------------------------------------|
|
||||||
|
* | |Prv|Ply|Nxt| | |Pg^|Hme|Up |End| |Br-|Br+| |
|
||||||
|
* |-----------------------------------------------------------|
|
||||||
|
* |Hold |Mte|Vl-|Vl+| | |Pgv|Lft|Dwn|Rgt| | | |
|
||||||
|
* |-----------------------------------------------------------|
|
||||||
|
* | | | | | | | | | | | | |
|
||||||
|
* |-----------------------------------------------------------'
|
||||||
|
* | | | | | | | | |
|
||||||
|
* `-----------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[FUNCTION_LAYER] = KEYMAP_60(
|
||||||
|
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \
|
||||||
|
__x__, KC_MPRV, KC_MPLY, KC_MNXT, __x__, __x__, KC_PGUP, KC_HOME, KC_UP, KC_END, __x__, KC_SLCK, KC_PAUS, __x__, \
|
||||||
|
KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, __x__, __x__, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, __x__, __x__, __x__, __x__, \
|
||||||
|
KC_LSFT, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, \
|
||||||
|
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, __x__, __x__, __x__, __x__ \
|
||||||
|
),
|
||||||
|
|
||||||
|
/* Layer 2: System Layer
|
||||||
|
* ,-----------------------------------------------------------.
|
||||||
|
* |Reset| | | | | | | | | | | | | |
|
||||||
|
* |-----------------------------------------------------------|
|
||||||
|
* | | | | | | | | | | | | | | |
|
||||||
|
* |-----------------------------------------------------------|
|
||||||
|
* | | | | | | | | | | | | | |
|
||||||
|
* |-----------------------------------------------------------|
|
||||||
|
* | | | | | | | | | | | | |
|
||||||
|
* |-----------------------------------------------------------'
|
||||||
|
* | | | | | | | | |
|
||||||
|
* `-----------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[SYSTEM_LAYER] = KEYMAP_60(
|
||||||
|
RESET, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, \
|
||||||
|
__x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, \
|
||||||
|
__x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, \
|
||||||
|
__x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, __x__, \
|
||||||
|
__x__, __x__, __x__, __x__, __x__, __x__, KC_TRNS, __x__ \
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM fn_actions[] = {
|
||||||
|
|
||||||
|
};
|
@ -0,0 +1,5 @@
|
|||||||
|
# Mauin's keymap for the GON NerD
|
||||||
|
|
||||||
|
This layout is based on a Pok3r style layout with a standard base layer.
|
||||||
|
|
||||||
|
Function layers provide access to navigation and media keys.
|
@ -0,0 +1,34 @@
|
|||||||
|
GON NerD keyboard firmware
|
||||||
|
======================
|
||||||
|
|
||||||
|
## Changing Bootloader
|
||||||
|
|
||||||
|
It's not possible to simply flash this firmware on the GON NerD keyboard as the original bootloader does not support DFU connections.
|
||||||
|
|
||||||
|
It is possible to change the bootloader of the GON NerD with an ISP programmer. A guide on how to change the bootloader on your GON NerD can be found here:
|
||||||
|
[Converting NerD60 to TMK](https://deskthority.net/wiki/Converting_NerD60_to_TMK). After changing the bootloader you can flash your QMK keymap onto the keyboard.
|
||||||
|
|
||||||
|
_After changing the bootloader on your GON NerD PCB you will not be able to go back to the original firmware and the official configuration software will
|
||||||
|
not work anymore. You will lose your warranty and official support from GON!_
|
||||||
|
|
||||||
|
## Building
|
||||||
|
|
||||||
|
Download or clone the whole firmware and navigate to the keyboards/gonnerd folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file.
|
||||||
|
|
||||||
|
Depending on which keymap you would like to use, you will have to compile slightly differently.
|
||||||
|
|
||||||
|
### Default
|
||||||
|
|
||||||
|
To build with the default keymap, simply run `make default`.
|
||||||
|
|
||||||
|
### Other Keymaps
|
||||||
|
|
||||||
|
Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files.
|
||||||
|
|
||||||
|
To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ make [default|jack|<name>]
|
||||||
|
```
|
||||||
|
|
||||||
|
Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.
|
@ -0,0 +1,66 @@
|
|||||||
|
# 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 = 8000000
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# 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=4096
|
||||||
|
|
||||||
|
|
||||||
|
# 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 ?= no # 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 ?= yes # 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
|
@ -1,5 +1,5 @@
|
|||||||
#include "onekey.h"
|
#include "onekey.h"
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
{ KC_A }
|
{{ KC_A }}
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,38 @@
|
|||||||
#include "promethium.h"
|
#include "promethium.h"
|
||||||
|
#include "analog.h"
|
||||||
|
#include "timer.h"
|
||||||
|
#include "matrix.h"
|
||||||
|
|
||||||
void matrix_init_kb(void) {
|
// cubic fit {3.3, 0}, {3.5, 2.9}, {3.6, 5}, {3.7, 8.6}, {3.8, 36}, {3.9, 62}, {4.0, 73}, {4.05, 83}, {4.1, 89}, {4.15, 94}, {4.2, 100}
|
||||||
|
|
||||||
|
uint8_t battery_level(void) {
|
||||||
|
float voltage = analogRead(BATTERY_PIN) * 2 * 3.3 / 1024;
|
||||||
|
if (voltage < MIN_VOLTAGE) return 0;
|
||||||
|
if (voltage > MAX_VOLTAGE) return 255;
|
||||||
|
return (voltage - MIN_VOLTAGE) / (MAX_VOLTAGE - MIN_VOLTAGE) * 255;
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void battery_poll(uint8_t level) {
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_init_kb(void) {
|
||||||
matrix_init_user();
|
matrix_init_user();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void matrix_scan_kb(void) {
|
||||||
|
static uint16_t counter = BATTERY_POLL;
|
||||||
|
counter++;
|
||||||
|
|
||||||
|
if (counter > BATTERY_POLL) {
|
||||||
|
counter = 0;
|
||||||
|
battery_poll(battery_level());
|
||||||
|
}
|
||||||
|
|
||||||
|
matrix_scan_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
void led_set_kb(uint8_t usb_led) {
|
||||||
|
led_set_user(usb_led);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
ifndef MAKEFILE_INCLUDED
|
||||||
|
include ../../../Makefile
|
||||||
|
endif
|
@ -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 0xFEED
|
||||||
|
#define PRODUCT_ID 0x6060
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER upils
|
||||||
|
#define PRODUCT reddot
|
||||||
|
#define DESCRIPTION A custom keyboard
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 5
|
||||||
|
#define MATRIX_COLS 19
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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 { B0, B1, B2, B3, E6 }
|
||||||
|
#define MATRIX_COL_PINS { B7, D0, D1, D2, D3, C6, C7, D5, D4, D7, B4, B5, B6, F7, F6, F5, F4, F1, F0 }
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
|
||||||
|
/* COL2ROW or ROW2COL */
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
// #define BACKLIGHT_PIN B7
|
||||||
|
// #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
|
||||||
|
|
||||||
|
|
||||||
|
/* 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,29 @@
|
|||||||
|
#include "reddot.h"
|
||||||
|
#include "../../../../../quantum/keymap_extras/keymap_french.h"
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
[0] = KEYMAP(
|
||||||
|
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TAB, KC_CAPS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_FN0, KC_KP_SLASH, KC_KP_ASTERISK, KC_KP_MINUS,\
|
||||||
|
KC_LALT, FR_AMP, FR_EACU, FR_QUOT, FR_APOS, FR_LPRN, KC_BSPACE, KC_DELETE, FR_MINS, FR_EGRV, FR_UNDS, FR_CCED, FR_AGRV, FR_RPRN, FR_EQL, KC_INSERT, KC_HOME, KC_PGUP,\
|
||||||
|
KC_LGUI, FR_A, FR_Z, KC_E, KC_R, KC_T, KC_LSFT, KC_ENT, KC_Y, KC_U, KC_I, KC_O, KC_P, FR_CIRC, FR_DLR, KC_DELETE, KC_END, KC_PGDOWN, KC_KP_PLUS,\
|
||||||
|
KC_LCTL, FR_Q, KC_S, KC_D, KC_F, KC_G, KC_ENT, KC_H, KC_J, KC_K, KC_L, FR_M, FR_UGRV, FR_ASTR, KC_KP_1, KC_UP, KC_KP_3,\
|
||||||
|
FR_LESS, FR_W, KC_X, KC_C, KC_V, KC_B, KC_SPACE, KC_SPACE, KC_N, FR_COMM, FR_SCLN, FR_COLN, FR_EXLM, NO_ALGR, KC_LEFT, KC_DOWN, KC_RIGHT, KC_KP_ENTER),
|
||||||
|
|
||||||
|
[1] = KEYMAP(
|
||||||
|
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TAB, KC_CAPS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_FN0, KC_KP_SLASH, KC_KP_ASTERISK, KC_KP_MINUS,\
|
||||||
|
KC_LALT, FR_AMP, FR_EACU, FR_QUOT, FR_APOS, FR_LPRN, KC_BSPACE, KC_DELETE, FR_MINS, FR_EGRV, FR_UNDS, FR_CCED, FR_AGRV, FR_RPRN, FR_EQL, KC_7, KC_8, KC_9,\
|
||||||
|
KC_LGUI, FR_A, FR_Z, KC_E, KC_R, KC_T, KC_LSFT, KC_ENT, KC_Y, KC_U, KC_I, KC_O, KC_P, FR_CIRC, FR_DLR, KC_4, KC_5, KC_6, KC_KP_PLUS,\
|
||||||
|
KC_LCTL, FR_Q, KC_S, KC_D, KC_F, KC_G, KC_ENT, KC_H, KC_J, KC_K, KC_L, FR_M, FR_UGRV, FR_ASTR, KC_1, KC_2, KC_3,\
|
||||||
|
FR_LESS, FR_W, KC_X, KC_C, KC_V, KC_B, KC_SPACE, KC_SPACE, KC_N, FR_COMM, FR_SCLN, FR_COLN, FR_EXLM, NO_ALGR, KC_LEFT, KC_DOWN, KC_RIGHT, KC_KP_ENTER),
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const uint16_t PROGMEM fn_actions[] = {
|
||||||
|
ACTION_LAYER_TOGGLE(1),
|
||||||
|
};
|
||||||
|
|
||||||
|
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||||
|
return MACRO_NONE;
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
# The default keymap for handwired/reddot
|
@ -0,0 +1,24 @@
|
|||||||
|
## RedDot Specific Info ##
|
||||||
|
|
||||||
|
|
||||||
|
## Quantum MK Firmware
|
||||||
|
|
||||||
|
For the full Quantum feature list, see [the parent README.md](/README.md).
|
||||||
|
|
||||||
|
## Building
|
||||||
|
|
||||||
|
Download or clone the whole firmware and navigate to the keyboard/reddot folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file.
|
||||||
|
|
||||||
|
Depending on which keymap you would like to use, you will have to compile slightly differently.
|
||||||
|
|
||||||
|
### Default
|
||||||
|
To build with the default keymap, simply run `make`.
|
||||||
|
|
||||||
|
### Other Keymaps
|
||||||
|
Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `<name>.c` and see keymap document (you can find in top README.md) and existent keymap files.
|
||||||
|
|
||||||
|
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 **__\<name\>.c__** and are stored in the `keymaps` folder.
|
@ -0,0 +1,7 @@
|
|||||||
|
#include "reddot.h"
|
||||||
|
|
||||||
|
void matrix_init_kb(void) {
|
||||||
|
|
||||||
|
matrix_init_user();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,20 @@
|
|||||||
|
#ifndef REDDOT_H
|
||||||
|
#define REDDOT_H
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
#define KEYMAP( \
|
||||||
|
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k10, k11, k12, k13, \
|
||||||
|
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, k30, k31, k32, \
|
||||||
|
k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k50, k51, k52, k53, \
|
||||||
|
k60, k61, k62, k63, k64, k65, k66, k68, k69, k6A, k6B, k6C, k6D, k6E, k70, k71, k72, \
|
||||||
|
k80, k81, k82, k83, k84, k85, k86, k88, k89, k8A, k8B, k8C, k8D, k8E, k90, k91, k92, k93\
|
||||||
|
) { \
|
||||||
|
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k10, k11, k12, k13 }, \
|
||||||
|
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, k30, k31, k32, KC_NO }, \
|
||||||
|
{ k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k50, k51, k52, k53 }, \
|
||||||
|
{ k60, k61, k62, k63, k64, k65, k66, KC_NO, k68, k69, k6A, k6B, k6C, k6D, k6E, k70, k71, k72, KC_NO }, \
|
||||||
|
{ k80, k81, k82, k83, k84, k85, k86, KC_NO, k88, k89, k8A, k8B, k8C, k8D, k8E, k90, k91, k92, k93 } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,88 @@
|
|||||||
|
|
||||||
|
#MCU = at90usb1287
|
||||||
|
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
|
||||||
|
|
||||||
|
# for avr upload
|
||||||
|
USB ?= /dev/cu.usbmodem1421
|
||||||
|
#
|
||||||
|
# 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)
|
||||||
|
|
||||||
|
|
||||||
|
ifdef TEENSY2
|
||||||
|
OPT_DEFS += -DATREUS_TEENSY2
|
||||||
|
ATREUS_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex
|
||||||
|
else
|
||||||
|
OPT_DEFS += -DATREUS_ASTAR
|
||||||
|
OPT_DEFS += -DCATERINA_BOOTLOADER
|
||||||
|
ATREUS_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \
|
||||||
|
avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB)
|
||||||
|
endif
|
||||||
|
# Interrupt driven control endpoint task(+60)
|
||||||
|
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||||
|
|
||||||
|
|
||||||
|
# MCU name
|
||||||
|
|
||||||
|
# Boot Section Size in *bytes*
|
||||||
|
# Teensy halfKay 512
|
||||||
|
# Teensy++ halfKay 1024
|
||||||
|
# Atmel DFU loader 4096
|
||||||
|
# LUFA bootloader 4096
|
||||||
|
# USBaspLoader 2048
|
||||||
|
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||||
|
|
||||||
|
|
||||||
|
# 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 ?= no # Console for debug(+400)
|
||||||
|
COMMAND_ENABLE ?= no # 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
|
||||||
|
|
||||||
|
upload: build
|
||||||
|
$(ATREUS_UPLOAD_COMMAND)
|
||||||
|
|
@ -1 +1,16 @@
|
|||||||
#include "kc60.h"
|
#include "kc60.h"
|
||||||
|
|
||||||
|
void led_set_kb(uint8_t usb_led)
|
||||||
|
{
|
||||||
|
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
|
||||||
|
// output low
|
||||||
|
DDRB |= (1<<2);
|
||||||
|
PORTB &= ~(1<<2);
|
||||||
|
} else {
|
||||||
|
// Hi-Z
|
||||||
|
DDRB &= ~(1<<2);
|
||||||
|
PORTB &= ~(1<<2);
|
||||||
|
}
|
||||||
|
|
||||||
|
led_set_user(usb_led);
|
||||||
|
}
|
@ -1,3 +1,5 @@
|
|||||||
|
SUBPROJECT_DEFAULT = rev2
|
||||||
|
|
||||||
ifndef MAKEFILE_INCLUDED
|
ifndef MAKEFILE_INCLUDED
|
||||||
include ../../Makefile
|
include ../../Makefile
|
||||||
endif
|
endif
|
@ -1,2 +1,2 @@
|
|||||||
:080000000000000000000001F7
|
:0B0000000000000000000000000001F4
|
||||||
:00000001FF
|
:00000001FF
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
:080000000000000000000000F8
|
:0B0000000000000000000000000000F5
|
||||||
:00000001FF
|
:00000001FF
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
ifndef MAKEFILE_INCLUDED
|
||||||
|
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 0x3060
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER Wootpatoot
|
||||||
|
#define PRODUCT Lets Split v2
|
||||||
|
#define DESCRIPTION A split keyboard for the cheap makers
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
// Rows are doubled-up
|
||||||
|
#define MATRIX_ROWS 8
|
||||||
|
#define MATRIX_COLS 6
|
||||||
|
|
||||||
|
// wiring of each half
|
||||||
|
#define MATRIX_ROW_PINS { D7, E6, B4, B5 }
|
||||||
|
//#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 }
|
||||||
|
#define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6 } //uncomment this line and comment line above if you need to reverse left-to-right key order
|
||||||
|
|
||||||
|
//#define CATERINA_BOOTLOADER
|
||||||
|
|
||||||
|
/* 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)) \
|
||||||
|
)
|
||||||
|
|
||||||
|
/* ws2812 RGB LED */
|
||||||
|
#define RGB_DI_PIN D3
|
||||||
|
#define RGBLIGHT_TIMER
|
||||||
|
#define RGBLED_NUM 12 // Number of LEDs
|
||||||
|
#define ws2812_PORTREG PORTD
|
||||||
|
#define ws2812_DDRREG DDRD
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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,32 @@
|
|||||||
|
#include "lets_split.h"
|
||||||
|
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
float tone_startup[][2] = SONG(STARTUP_SOUND);
|
||||||
|
float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void matrix_init_kb(void) {
|
||||||
|
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
_delay_ms(20); // gets rid of tick
|
||||||
|
PLAY_NOTE_ARRAY(tone_startup, false, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// // green led on
|
||||||
|
// DDRD |= (1<<5);
|
||||||
|
// PORTD &= ~(1<<5);
|
||||||
|
|
||||||
|
// // orange led on
|
||||||
|
// DDRB |= (1<<0);
|
||||||
|
// PORTB &= ~(1<<0);
|
||||||
|
|
||||||
|
matrix_init_user();
|
||||||
|
};
|
||||||
|
|
||||||
|
void shutdown_user(void) {
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
|
||||||
|
_delay_ms(150);
|
||||||
|
stop_all_notes();
|
||||||
|
#endif
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
#ifndef REV2FLIPHALF_H
|
||||||
|
#define REV2FLIPHALF_H
|
||||||
|
|
||||||
|
#include "../lets_split.h"
|
||||||
|
|
||||||
|
//void promicro_bootloader_jmp(bool program);
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
//void promicro_bootloader_jmp(bool program);
|
||||||
|
|
||||||
|
#define KEYMAP( \
|
||||||
|
k00, k01, k02, k03, k04, k05, k40, k41, k42, k43, k44, k45, \
|
||||||
|
k10, k11, k12, k13, k14, k15, k50, k51, k52, k53, k54, k55, \
|
||||||
|
k20, k21, k22, k23, k24, k25, k60, k61, k62, k63, k64, k65, \
|
||||||
|
k30, k31, k32, k33, k34, k35, k70, k71, k72, k73, k74, k75 \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ k00, k01, k02, k03, k04, k05 }, \
|
||||||
|
{ k10, k11, k12, k13, k14, k15 }, \
|
||||||
|
{ k20, k21, k22, k23, k24, k25 }, \
|
||||||
|
{ k30, k31, k32, k33, k34, k35 }, \
|
||||||
|
{ k40, k41, k42, k43, k44, k45 }, \
|
||||||
|
{ k50, k51, k52, k53, k54, k55 }, \
|
||||||
|
{ k60, k61, k62, k63, k64, k65 }, \
|
||||||
|
{ k70, k71, k72, k73, k74, k75 } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,5 @@
|
|||||||
|
BACKLIGHT_ENABLE = no
|
||||||
|
|
||||||
|
ifndef QUANTUM_DIR
|
||||||
|
include ../../../Makefile
|
||||||
|
endif
|
@ -1,7 +1,8 @@
|
|||||||
#ifndef CONFIG_USER_H
|
#ifndef CONFIG_USER_H
|
||||||
#define CONFIG_USER_H
|
#define CONFIG_USER_H
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "../../config.h"
|
#include "../../config.h"
|
||||||
|
|
||||||
#define PREVENT_STUCK_MODIFIERS
|
#define PREVENT_STUCK_MODIFIERS
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,63 @@
|
|||||||
|
#----------------------------------------------------------------------------
|
||||||
|
# On command line:
|
||||||
|
#
|
||||||
|
# make all = Make software.
|
||||||
|
#
|
||||||
|
# make clean = Clean out built project files.
|
||||||
|
#
|
||||||
|
# make coff = Convert ELF to AVR COFF.
|
||||||
|
#
|
||||||
|
# make extcoff = Convert ELF to AVR Extended COFF.
|
||||||
|
#
|
||||||
|
# make program = Download the hex file to the device.
|
||||||
|
# Please customize your programmer settings(PROGRAM_CMD)
|
||||||
|
#
|
||||||
|
# make teensy = Download the hex file to the device, using teensy_loader_cli.
|
||||||
|
# (must have teensy_loader_cli installed).
|
||||||
|
#
|
||||||
|
# make dfu = Download the hex file to the device, using dfu-programmer (must
|
||||||
|
# have dfu-programmer installed).
|
||||||
|
#
|
||||||
|
# make flip = Download the hex file to the device, using Atmel FLIP (must
|
||||||
|
# have Atmel FLIP installed).
|
||||||
|
#
|
||||||
|
# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
|
||||||
|
# (must have dfu-programmer installed).
|
||||||
|
#
|
||||||
|
# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
|
||||||
|
# (must have Atmel FLIP installed).
|
||||||
|
#
|
||||||
|
# make debug = Start either simulavr or avarice as specified for debugging,
|
||||||
|
# with avr-gdb or avr-insight as the front end for debugging.
|
||||||
|
#
|
||||||
|
# make filename.s = Just compile filename.c into the assembler code only.
|
||||||
|
#
|
||||||
|
# make filename.i = Create a preprocessed source file for use in submitting
|
||||||
|
# bug reports to the GCC project.
|
||||||
|
#
|
||||||
|
# To rebuild project do "make clean" then "make all".
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
# change to "no" to disable the options, or define them in the makefile.mk in
|
||||||
|
# the appropriate keymap folder that will get included automatically
|
||||||
|
#
|
||||||
|
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 = no # 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
|
After Width: | Height: | Size: 52 KiB |
@ -0,0 +1,151 @@
|
|||||||
|
#include "planck.h"
|
||||||
|
#include "action_layer.h"
|
||||||
|
#include "eeconfig.h"
|
||||||
|
#ifdef BACKLIGHT_ENABLE
|
||||||
|
#include "backlight.h"
|
||||||
|
#endif
|
||||||
|
#define PREVENT_STUCK_MODIFIERS
|
||||||
|
extern keymap_config_t keymap_config;
|
||||||
|
|
||||||
|
// Symbolic names for macro IDs.
|
||||||
|
#define _QWERTY 0 // QUERTY layer
|
||||||
|
#define _LOWER 1 // Lower layer
|
||||||
|
#define _RAISE 2 // Raise layer
|
||||||
|
#define _CUSTOM 3 // Custom layer (LOWER + RAISE)
|
||||||
|
#define _BL 4 // Backlight
|
||||||
|
#define _CUS0 5 // Mobile#
|
||||||
|
#define _CUS1 6 // signature
|
||||||
|
#define _CUS2 7 // macro 2
|
||||||
|
#define _CUS3 8 // macro 3
|
||||||
|
#define _CUS4 9 // macro 4
|
||||||
|
#define _CUS5 10 // email
|
||||||
|
#define _COPY 11 // copy
|
||||||
|
#define _PASTE 12 // paste
|
||||||
|
#define _CUT 13 // cut
|
||||||
|
|
||||||
|
// Macro shortcuts.
|
||||||
|
#define QWERTY M(_LOWER)
|
||||||
|
#define LOWER M(_LOWER)
|
||||||
|
#define RAISE M(_RAISE)
|
||||||
|
#define CUSTOM M(_CUSTOM)
|
||||||
|
#define BL M(_BL)
|
||||||
|
#define CUS0 M(_CUS0)
|
||||||
|
#define CUS1 M(_CUS1)
|
||||||
|
#define CUS2 M(_CUS2)
|
||||||
|
#define CUS3 M(_CUS3)
|
||||||
|
#define CUS4 M(_CUS4)
|
||||||
|
#define CUS5 M(_CUS5)
|
||||||
|
#define COPY M(_COPY)
|
||||||
|
#define PASTE M(_PASTE)
|
||||||
|
#define CUT M(_CUT)
|
||||||
|
|
||||||
|
// Func macro definitions.
|
||||||
|
#define LWR_PGDN FUNC(0) // Tap for PgDn, hold for LOWER
|
||||||
|
#define RSE_PGUP FUNC(1) // Tap for PgUp, hold for RAISE
|
||||||
|
#define CTL_CAPS FUNC(2) // Tap for Caps, hold for Ctrl (DOESN'T SEEM TO WORK)
|
||||||
|
#define SFT_ENT FUNC(3) // Tap for Enter, hold for Shift
|
||||||
|
#define ZM_NRM FUNC(4) // Zoom normal
|
||||||
|
#define ZM_IN FUNC(5) // Zoom out
|
||||||
|
#define ZM_OUT FUNC(6) // Zoom in
|
||||||
|
|
||||||
|
// Enable these functions using FUNC(n) macro.
|
||||||
|
const uint16_t PROGMEM fn_actions[] = {
|
||||||
|
[0] = ACTION_LAYER_TAP_KEY(_LOWER, KC_PGDN),
|
||||||
|
[1] = ACTION_LAYER_TAP_KEY(_RAISE, KC_PGUP),
|
||||||
|
[2] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_CAPS),
|
||||||
|
[3] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT),
|
||||||
|
[4] = ACTION_MODS_KEY(MOD_LCTL, KC_0),
|
||||||
|
[5] = ACTION_MODS_KEY(MOD_LCTL, KC_MINS),
|
||||||
|
[6] = ACTION_MODS_KEY(MOD_LCTL, KC_PLUS),
|
||||||
|
[7] = ACTION_MODS_KEY(MOD_LCTL, KC_UNDS),
|
||||||
|
};
|
||||||
|
|
||||||
|
// This config can be found at Keyboard layout editor site: http://goo.gl/zjXL2l
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[_QWERTY] = { /* 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},
|
||||||
|
{KC_DEL, 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_DOT, KC_SLSH, SFT_ENT},
|
||||||
|
{KC_LCTL, KC_ESC, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
|
||||||
|
},
|
||||||
|
[_LOWER] = { /* LOWER */
|
||||||
|
{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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LPRN, KC_RPRN, KC_LCBR, KC_RCBR, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS},
|
||||||
|
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_QUOT, KC_DQT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS},
|
||||||
|
{KC_TRNS, ZM_NRM, ZM_IN, ZM_OUT, KC_TRNS, KC_PGDN, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}
|
||||||
|
},
|
||||||
|
[_RAISE] = { /* RAISE */
|
||||||
|
{KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12},
|
||||||
|
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LCBR, KC_LCBR, KC_BSLS, KC_TRNS},
|
||||||
|
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, KC_PIPE, KC_GRV, KC_TILD, KC_LBRC, KC_LBRC, KC_TRNS, KC_TRNS},
|
||||||
|
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_PGUP, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
|
||||||
|
},
|
||||||
|
[_CUSTOM] = { /* CUSTOM */
|
||||||
|
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, CUS4, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS},
|
||||||
|
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, CUS0, CUS3, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS},
|
||||||
|
{KC_TRNS, KC_TRNS, CUT, COPY, PASTE, CUS1, CUS5, CUS2, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS},
|
||||||
|
{BL, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Set a layer persistantly.
|
||||||
|
void persistant_default_layer_set(uint16_t default_layer) {
|
||||||
|
eeconfig_update_default_layer(default_layer);
|
||||||
|
default_layer_set(default_layer);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Macro actions for each corresponding ID.
|
||||||
|
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||||
|
{
|
||||||
|
switch(id) {
|
||||||
|
case _RAISE: // Raised layer.
|
||||||
|
if (record->event.pressed) {
|
||||||
|
layer_on(_RAISE);
|
||||||
|
update_tri_layer(_LOWER, _RAISE, _CUSTOM);
|
||||||
|
} else {
|
||||||
|
layer_off(_RAISE);
|
||||||
|
update_tri_layer(_LOWER, _RAISE, _CUSTOM);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case _LOWER: // Lowered layer.
|
||||||
|
if (record->event.pressed) {
|
||||||
|
layer_on(_LOWER);
|
||||||
|
update_tri_layer(_LOWER, _RAISE, _CUSTOM);
|
||||||
|
} else {
|
||||||
|
layer_off(_LOWER);
|
||||||
|
update_tri_layer(_LOWER, _RAISE, _CUSTOM);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case _BL: // Backlight
|
||||||
|
if (record->event.pressed) {
|
||||||
|
register_code(KC_RSFT);
|
||||||
|
#ifdef BACKLIGHT_ENABLE
|
||||||
|
backlight_step();
|
||||||
|
#endif
|
||||||
|
} else {
|
||||||
|
unregister_code(KC_RSFT);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case _CUS0: // enter your mobile# here
|
||||||
|
return MACRODOWN(T(9), T(9), T(9), T(MINS),T(9), T(9), T(9), T(MINS),T(9), T(9), T(9), T(9),END);
|
||||||
|
case _CUS1: // signature line for email
|
||||||
|
return MACRODOWN(T(ENT), T(ENT), T(MINS), T(J), T(W), END);
|
||||||
|
case _CUS2: // Custom macro 2
|
||||||
|
return MACRODOWN( DOWN(KC_LSFT), TYPE(KC_L), UP(KC_LSFT), END );
|
||||||
|
case _CUS3: // custom macro 3
|
||||||
|
return MACRODOWN( DOWN(KC_LSFT), TYPE(KC_F), UP(KC_LSFT), END );
|
||||||
|
case _CUS4: // custom macro 4
|
||||||
|
return MACRODOWN( DOWN(KC_LSFT), TYPE(KC_I), UP(KC_LSFT), END );
|
||||||
|
case _CUS5: // Enter your email here
|
||||||
|
return MACRODOWN( TYPE(KC_F),
|
||||||
|
DOWN(KC_LSFT), TYPE(KC_2), UP(KC_LSFT),
|
||||||
|
TYPE(KC_G), TYPE(KC_M), TYPE(KC_A), TYPE(KC_I), TYPE(KC_L), TYPE(KC_DOT), TYPE(KC_C), TYPE(KC_O), TYPE(KC_M), END );
|
||||||
|
case _CUT: //cut macro
|
||||||
|
return MACRODOWN( DOWN(KC_LCTL), TYPE(KC_X), UP(KC_LCTL), END );
|
||||||
|
case _COPY: // copy macro
|
||||||
|
return MACRODOWN( DOWN(KC_LCTL), TYPE(KC_C), UP(KC_LCTL), END );
|
||||||
|
case _PASTE: // paste macro
|
||||||
|
return MACRODOWN( DOWN(KC_LCTL), TYPE(KC_V), UP(KC_LCTL), END );
|
||||||
|
};
|
||||||
|
return MACRO_NONE;
|
||||||
|
}
|
@ -0,0 +1,271 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"backcolor": "#858585",
|
||||||
|
"name": "Planck 40%",
|
||||||
|
"author": "James Folkert",
|
||||||
|
"background": {
|
||||||
|
"name": "Aluminium brushed",
|
||||||
|
"style": "background-image: url('/bg/metal/aluminum_texture1642.jpg');"
|
||||||
|
},
|
||||||
|
"switchMount": "cherry",
|
||||||
|
"switchBrand": "cherry",
|
||||||
|
"switchType": "MX1A-A1xx",
|
||||||
|
"pcb": true,
|
||||||
|
"plate": true
|
||||||
|
},
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"fa": [
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"F1\n1\n\n!\n\n\n\n\n\n<i class='kb kb-Tab-2'></i>",
|
||||||
|
"F2\n2\n\n@\n\n\n\n\n\nQ",
|
||||||
|
"F3\n3\n\n#\n\n\n\n\n\nW",
|
||||||
|
"F4\n4\n\n$\n\n\n\n\n\nE",
|
||||||
|
"F5\n5\n\n%\n\n\n\n\n\nR",
|
||||||
|
"F6\n6\n\n^\n\n\n\n\n\nT",
|
||||||
|
"F7\n6\n\n&\n\n\n\n\n\nY",
|
||||||
|
"F8\n8\n\n*\nMacro4\n\n\n\n\nU",
|
||||||
|
"F9\n9\n\n(\n\n\n\n\n\nI",
|
||||||
|
{
|
||||||
|
"fa": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"F10\n0\n\n)\n\n\n\n\n\nO",
|
||||||
|
{
|
||||||
|
"fa": [
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"F11\n-\n\n_\n\n\n\n\n\nP",
|
||||||
|
"F12\n=\n\n+\n\n\n\n\n\n<i class='kb kb-Unicode-BackSpace-DeleteLeft-Big'></i>"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"a": 7,
|
||||||
|
"f": 3
|
||||||
|
},
|
||||||
|
"<i class='mss mss-Unicode-DeleteRight-Big-2'></i>",
|
||||||
|
{
|
||||||
|
"f": 3
|
||||||
|
},
|
||||||
|
"A",
|
||||||
|
{
|
||||||
|
"f": 3
|
||||||
|
},
|
||||||
|
"S",
|
||||||
|
{
|
||||||
|
"f": 3
|
||||||
|
},
|
||||||
|
"D",
|
||||||
|
{
|
||||||
|
"t": "#ff0000",
|
||||||
|
"a": 4,
|
||||||
|
"f": 3
|
||||||
|
},
|
||||||
|
"\n(\n\n\n\n\n\n\n\nF",
|
||||||
|
{
|
||||||
|
"t": "#000000",
|
||||||
|
"f": 3
|
||||||
|
},
|
||||||
|
"\n)\n\n\n\n\n\n\n\nG",
|
||||||
|
{
|
||||||
|
"f": 3
|
||||||
|
},
|
||||||
|
"\n{\n\n\nMacro0\n\n\n\n\nH",
|
||||||
|
{
|
||||||
|
"t": "#ff0000",
|
||||||
|
"f": 3
|
||||||
|
},
|
||||||
|
"\n}\n\n\nMacro3\n\n\n\n\nJ",
|
||||||
|
{
|
||||||
|
"t": "#000000",
|
||||||
|
"f": 3
|
||||||
|
},
|
||||||
|
"{\n\n\n\n\n\n\n\n\nK",
|
||||||
|
{
|
||||||
|
"f": 3
|
||||||
|
},
|
||||||
|
"{\n\n\n\n\n\n\n\n\nL",
|
||||||
|
{
|
||||||
|
"fa": [
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"\\\n\n|\n\n\n\n\n:\n\n;",
|
||||||
|
{
|
||||||
|
"a": 7,
|
||||||
|
"fa": [
|
||||||
|
9
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"<i class='mss mss-Unicode-Enter-3'></i>"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"f": 3
|
||||||
|
},
|
||||||
|
"Shift",
|
||||||
|
{
|
||||||
|
"f": 3
|
||||||
|
},
|
||||||
|
"Z",
|
||||||
|
{
|
||||||
|
"f": 3
|
||||||
|
},
|
||||||
|
"X\n\n\n\nCut",
|
||||||
|
{
|
||||||
|
"f": 3
|
||||||
|
},
|
||||||
|
"C\n\n\n\nCopy",
|
||||||
|
{
|
||||||
|
"a": 4,
|
||||||
|
"fa": [
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"\\\n[\n|\n{\nPaste\n\n\n\n\nV",
|
||||||
|
"|\n]\n\n}\nMacro1\n\n\n\n\nB",
|
||||||
|
"`\n'\n~\n\"\nMacro5\n\n\n\n\nN",
|
||||||
|
"~\n\"\n\n\nMacro2\n\n\n\n\nM",
|
||||||
|
{
|
||||||
|
"fa": [
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"[\n\n{\n\n\n\n\n<\n\n,",
|
||||||
|
"[\n\n{\n\n\n\n\n\n\n.",
|
||||||
|
{
|
||||||
|
"a": 6
|
||||||
|
},
|
||||||
|
"\n\n?\n\n\n\n\n\n/",
|
||||||
|
{
|
||||||
|
"a": 4,
|
||||||
|
"fa": [
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
9,
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"\n\n\n<i class='kb kb-Arrows-Bottom-4'></i>Shift\n\n\n\n\n<i class='mss mss-Unicode-Enter-3'></i>\n\n<i class='kb kb-Arrows-Bottom-4'></i>Shift"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"a": 7,
|
||||||
|
"f": 3
|
||||||
|
},
|
||||||
|
"Ctrl\n\n\n\nBLight",
|
||||||
|
{
|
||||||
|
"a": 4,
|
||||||
|
"fa": [
|
||||||
|
2,
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
9,
|
||||||
|
9
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"\nZNorm\n\n\nRESET\n\n\n\n\n<i class='mss mss-Unicode-Escape-3'></i>",
|
||||||
|
{
|
||||||
|
"fa": [
|
||||||
|
2,
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
9,
|
||||||
|
6
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"\nZIn\n\n\n\n\n\n\n\n<i class='kb kb-logo-windows-8'></i>",
|
||||||
|
{
|
||||||
|
"fa": [
|
||||||
|
2,
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
9,
|
||||||
|
9
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"\nZOut\n\n\n\n\n\n\n\n<i class='kb kb-Unicode-Alternate-1'></i>",
|
||||||
|
{
|
||||||
|
"a": 7,
|
||||||
|
"fa": [
|
||||||
|
9
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"⇓",
|
||||||
|
{
|
||||||
|
"a": 4,
|
||||||
|
"fa": [
|
||||||
|
9,
|
||||||
|
5,
|
||||||
|
5
|
||||||
|
],
|
||||||
|
"w": 2
|
||||||
|
},
|
||||||
|
"\n<i class='kb kb-Unicode-Page-Down-3'></i>\n<i class='kb kb-Unicode-Page-Up-3'></i>",
|
||||||
|
{
|
||||||
|
"a": 7
|
||||||
|
},
|
||||||
|
"⇑",
|
||||||
|
{
|
||||||
|
"a": 4,
|
||||||
|
"fa": [
|
||||||
|
2
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"<i class='kb kb-Multimedia-FastForward-End'></i>\n\n\n\n\n\n\n\n\n←",
|
||||||
|
"<i class='kb kb-Multimedia-Volume-Down-1'></i>\n\n\n\n\n\n\n\n\n↓",
|
||||||
|
"<i class='kb kb-Multimedia-Volume-Up-1'></i>\n\n\n\n\n\n\n\n\n↑",
|
||||||
|
"<i class='kb kb-Multimedia-Play-Pause'></i>\n\n\n\n\n\n\n\n\n→"
|
||||||
|
]
|
||||||
|
]
|
@ -0,0 +1,18 @@
|
|||||||
|
# Espynn's keymap for Planck Ortholinear 40% Mechanical Keyboard
|
||||||
|
Created by James Folkert: https://twitter.com/trekloFsemaJ
|
||||||
|
Added several custom functions to the keymap from the "ab" map. Special thanks to "mollat" for demonstration of macros in their keymap.c
|
||||||
|
|
||||||
|
|
||||||
|
![Layout](keyboard-layout.png "Practical Keymap")
|
||||||
|
|
||||||
|
|
||||||
|
* Online keyboard layout editor: http://www.keyboard-layout-editor.com/
|
||||||
|
* [JSON of raw layout] (layout.json "JSON of raw layout")
|
||||||
|
|
||||||
|
# Notes
|
||||||
|
* Simultaneous RAISE+LOWER enters CUSTOM layer. Several custom keymaps are here
|
||||||
|
* I disregarded the advice of Jack and used macros for passwords. I accept my fate. These have been abstracted to macros 2, 3, and 4
|
||||||
|
* add your mobile and email to the keymap before make
|
||||||
|
* RAISE and LOWER also acts as PgUp and PgDn when tapped.
|
||||||
|
* [CapsLock] also acts as [Ctrl] key when you press and hold. It is convenient for GNU Emacs users. (not sure if this works)
|
||||||
|
* Bracket/ paran/ brace keys are placed in the center of the keyboard for programmer's convenience.
|
@ -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 = no # Virtual DIP switch configuration(+1000)
|
||||||
|
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||||
|
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||||
|
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||||
|
COMMAND_ENABLE = no # 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 = yes # 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,355 @@
|
|||||||
|
/*
|
||||||
|
* A keyboard layout for the gridded planck.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2017 Luke Silva
|
||||||
|
*
|
||||||
|
* 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, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | | | | | | | | | | | | |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | | | | | |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | | | | | |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | | | | | |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*
|
||||||
|
* This layout uses colemak by default, and is designed for programming, with easy access to symbols
|
||||||
|
* through either double purpose modifiers or colemak style rolling for commonly used symbol clusters
|
||||||
|
* Eg: compare colemak 'this' to '(){\n}' on the symbol layer.
|
||||||
|
*
|
||||||
|
* The layout also supports a range of multilingual characters, covering those
|
||||||
|
* needed for French, German, Swedish and likely some other European Languages.
|
||||||
|
* In the future full support for Colemak's multilingual deadkeys may be introduced.
|
||||||
|
*
|
||||||
|
* The multilingual characters are inputted through QMK's unicode engine, using
|
||||||
|
* the Linux input method by default, however this can be changed at runtime.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "planck.h"
|
||||||
|
|
||||||
|
#define _______ KC_TRNS
|
||||||
|
#define XXXXXXX KC_NO
|
||||||
|
|
||||||
|
|
||||||
|
// Layers
|
||||||
|
#define _COLEMAK 0
|
||||||
|
#define _QWERTY 1
|
||||||
|
#define _SYM 2
|
||||||
|
#define _NUM 3
|
||||||
|
#define _GR 4
|
||||||
|
#define _GR_S 5
|
||||||
|
#define _ADJ 6
|
||||||
|
#define _NAV 7
|
||||||
|
#define _PLOVER 8
|
||||||
|
|
||||||
|
// Macro ID numbers
|
||||||
|
#define M_ALT_HASH 1
|
||||||
|
#define M_GR_DASH 2
|
||||||
|
#define M_SYM_LPRN 3
|
||||||
|
#define M_NAV_UNDS 4
|
||||||
|
#define M_NUM_RPRN 5
|
||||||
|
#define M_CTRL_DLR 6
|
||||||
|
#define M_LCBR_ENT 7
|
||||||
|
#define M_PLOVER 8
|
||||||
|
#define M_EXT_PLV 9
|
||||||
|
#define M_WINDOWS 10
|
||||||
|
#define M_LINUX 11
|
||||||
|
#define M_OSX 12
|
||||||
|
#define M_FUNCTION 13
|
||||||
|
#define M_THEN 14
|
||||||
|
#define M_CATCH 15
|
||||||
|
|
||||||
|
// Macro keys
|
||||||
|
#define ALT_HASH MACROTAP(M_ALT_HASH) // tap for #, hold for Alt
|
||||||
|
#define GR_DASH MACROTAP(M_GR_DASH) // tap for -, hold for GR layer a-class-name
|
||||||
|
#define SYM_LPRN MACROTAP(M_SYM_LPRN) // tap for (, hold for symbols layer if()
|
||||||
|
#define NAV_UNDS MACROTAP(M_NAV_UNDS) // tap for _, hold for navigation layer snake_case_variable
|
||||||
|
#define NUM_RPRN MACROTAP(M_NUM_RPRN) // tap for ), hold for numbers layer else if()
|
||||||
|
#define CTRL_DLR MACROTAP(M_CTRL_DLR) // tap for $, hold for ctrl $php_is_really_weird
|
||||||
|
#define LCBR_ENT M(M_LCBR_ENT) // {\n easier code formatting
|
||||||
|
#define PLOVER M(M_PLOVER) // PHROPB (plover) or ERFVIK(qwerty) starts plover
|
||||||
|
#define EXT_PLV M(M_EXT_PLV) // PHRO*F (plover) or ERFVYU(qwerty) stops plover
|
||||||
|
#define WINDOWS M(M_WINDOWS) // Sets Unicode handler to windows
|
||||||
|
#define LINUX M(M_LINUX) // Sets Unicode handler to linux
|
||||||
|
#define OSX M(M_OSX) // Sets Unicode handler to OSX
|
||||||
|
#define FUNCTION M(M_FUNCTION)
|
||||||
|
#define THEN M(M_THEN)
|
||||||
|
#define CATCH M(M_CATCH)
|
||||||
|
|
||||||
|
|
||||||
|
// Renames of QMK keys... (would have otherwise been a macro)
|
||||||
|
#define QWERTY DF(_QWERTY)
|
||||||
|
#define COLEMAK DF(_COLEMAK)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
/* Colemak
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | Tab | Q | W | F | P | G | J | L | U | Y | ;: | Bksp |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | Bksp | A | R | S | T | D | H | N | E | I | O | '" |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------`---.
|
||||||
|
* |Shift=| Z | X | C | V | B | K | M | ,< | .> | /? |Shift/Ent |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+----------|
|
||||||
|
* |CtCaps|GUIF4 | Alt# | Gr- | Sym( | Nav_ |Space | Num) |Ctrl$ | F11 | F12 |Nav toggle|
|
||||||
|
* `---------------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
[_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},
|
||||||
|
{KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT},
|
||||||
|
{SFT_T(KC_EQL), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT) },
|
||||||
|
{CTL_T(KC_CAPS), KC_LGUI, ALT_HASH, GR_DASH, SYM_LPRN, NAV_UNDS, KC_SPC, NUM_RPRN, CTRL_DLR, KC_F11, KC_F12, TG(_NAV)}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* QWERTY
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | Bksp | A | S | D | F | G | H | J | K | L | ;: | '" |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------`---.
|
||||||
|
* |Shift=| Z | X | C | V | B | N | M | ,< | .> | /? |Shift/Ent |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+----------|
|
||||||
|
* |CtCaps|GUIF4 | Alt# | Gr- | Sym( | Nav_ |Space | Num) |Ctrl$ | F11 | F12 |Nav toggle|
|
||||||
|
* `---------------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
[_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},
|
||||||
|
{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_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT) },
|
||||||
|
{CTL_T(KC_CAPS), KC_LGUI, KC_LALT, GR_DASH, SYM_LPRN,KC_SPC, KC_SPC, NUM_RPRN, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/* Symbols
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | Tab | ` | @ | / | * | ^ | % | : | + | - | Del | Bksp |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | [ | ; | } | ( | " | ' | ) | {\n | ! | ] | \ |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* |Shift | . | { | < | > | ~ | X2 | = | & | | | ? |Enter |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | | | | Sym | _ |Space | NUM | X2 | | | |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
[_SYM] = {
|
||||||
|
{KC_TAB, KC_GRV, KC_AT, KC_SLSH, KC_ASTR, KC_CIRC, KC_PERC, KC_COLN, KC_PLUS, KC_MINS, KC_DEL, KC_BSPC},
|
||||||
|
{FUNCTION,KC_LBRC, KC_SCLN, KC_RCBR, KC_LPRN, KC_DQT, KC_QUOT, KC_RPRN, LCBR_ENT,KC_EXLM, KC_RBRC, KC_BSLS},
|
||||||
|
{KC_LSFT, KC_DOT, KC_LCBR, KC_LABK, KC_RABK, KC_TILD, _______, KC_EQL, KC_AMPR, KC_PIPE, KC_QUES, KC_ENT },
|
||||||
|
{THEN, CATCH, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, _______}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/* Numbers
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | Tab | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | Bksp | x | D | E | F | + | - | 4 | 5 | 6 | 0 |Enter |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* |Shift | ( | A | B | C | * | / | 1 | 2 | 3 | ) |Enter |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | | | GR | SYM | _ |Space | NUM | 0 | . | f | |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
[_NUM] = {
|
||||||
|
{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_BSPC, KC_X, S(KC_D), S(KC_E), S(KC_F), KC_PLUS, KC_MINS, KC_4, KC_5, KC_6, KC_0, KC_ENT },
|
||||||
|
{KC_LSFT, KC_LPRN, S(KC_A), S(KC_B), S(KC_C), KC_ASTR, KC_SLSH, KC_1, KC_2, KC_3, KC_RPRN, KC_ENT },
|
||||||
|
{_______, _______, _______, _______, _______, _______, _______, _______, KC_0, KC_DOT, KC_F, _______}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/* Gr layer / international keys
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | | ä | å | | ¢£ | €¥ | | ë | ê | ü | ù | |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | â | à | ß | | | | è | é | ï | ö | |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | æ | ô | ç | œ | | | û | « | » | î | |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | | | | | |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
[_GR] = {
|
||||||
|
{_______, UC(0xE4),UC(0xE5), _______,UC(0xA2), UC(0x20AC),_______,UC(0xEB),UC(0xEA),UC(0xFC),UC(0xF9), _______},
|
||||||
|
{_______, UC(0xE2),UC(0xE0),UC(0xDF), _______, _______, _______,UC(0xE8),UC(0xE9),UC(0xEF),UC(0xF6), _______},
|
||||||
|
{MO(_GR_S),UC(0xE6),UC(0xF4),UC(0xE7),UC(0x153),_______, _______,UC(0xFB),UC(0xAB),UC(0xBB),UC(0xEE), MO(_GR_S)},
|
||||||
|
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
|
||||||
|
},
|
||||||
|
|
||||||
|
// Shifted layer of the above
|
||||||
|
[_GR_S] = {
|
||||||
|
{_______, UC(0xC4),UC(0xC5), _______, UC(0xA3), UC(0xA5),_______, UC(0xCB),UC(0xCA),UC(0xDC),UC(0xD9),_______},
|
||||||
|
{_______, UC(0xC2),UC(0xC0), UC(0xDF),_______, _______, _______, UC(0xC8),UC(0xC9),UC(0xCF),UC(0xD6),_______},
|
||||||
|
{MO(_GR_S),UC(0xC6),UC(0xD4), UC(0xC7),UC(0x152),_______, _______, UC(0xDB),UC(0xAB),UC(0xBB),UC(0xCE),MO(_GR_S)},
|
||||||
|
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/* Adjust Layer (Gr + Num)
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
|
||||||
|
* |------+-------------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | |Prntscr| ESC |VOLUP | PLAY | PREV |QWERTY|COLEMAK|PLOVER| | |
|
||||||
|
* |------+-------------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | |BACKLIT| INS |VOLDWN| MUTE | NEXT | WIND |LINUX | OSX | | |
|
||||||
|
* |------+-------------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | | | | | |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
[_ADJ] = {
|
||||||
|
{KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 },
|
||||||
|
{XXXXXXX, XXXXXXX, KC_PSCR, KC_ESC, KC_VOLU, KC_MPLY, KC_MPRV, QWERTY, COLEMAK, PLOVER, XXXXXXX, XXXXXXX},
|
||||||
|
{XXXXXXX, XXXXXXX, BL_STEP, KC_INS, KC_VOLD, KC_MUTE, KC_MNXT, WINDOWS, LINUX, OSX, XXXXXXX, XXXXXXX},
|
||||||
|
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/* Navigation
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | | | BTN3 | BTN2 | BTN1 | | ACL0 | HOME | PGDN | PGUP | END | Bksp |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | |MSLEFT| MSDN | MSUP |MSRGHT| | ACL1 | LEFT | DOWN | UP | RGHT |Enter |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | |WHLEFT| WHDN | WHUP |WHRGHT| | ACL2 |C-LEFT|C-PGDN|C-PGUP|C-RGHT|Enter |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | | | | | _ |Space | ACL0 | ACL1 | ACL2 | |TGLNAV|
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
[_NAV] = {
|
||||||
|
{XXXXXXX, XXXXXXX, KC_BTN3, KC_BTN2, KC_BTN1, XXXXXXX, KC_ACL0, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_BSPC},
|
||||||
|
{XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, XXXXXXX, KC_ACL1, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT,KC_ENT },
|
||||||
|
{XXXXXXX, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, XXXXXXX, KC_ACL2, LCTL(KC_LEFT), LCTL(KC_PGDN), LCTL(KC_PGUP), LCTL(KC_RIGHT), KC_ENT },
|
||||||
|
{_______, _______, _______, _______, _______, _______, _______, KC_ACL0, KC_ACL1, KC_ACL2, _______, _______}
|
||||||
|
},
|
||||||
|
|
||||||
|
/* Plover Layer
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | | S | T | P | H | * | * | F | P | L | T | D |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* |TogOut| S | K | W | R | * | * | R | B | G | S | Z |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | # | # | # | # | # | # | # | # | # | # | # | # |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | Exit | | | # | A | O | E | U | | | | |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
[_PLOVER] = {
|
||||||
|
{XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC},
|
||||||
|
{XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
|
||||||
|
{KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 },
|
||||||
|
{EXT_PLV, XXXXXXX, XXXXXXX, KC_1, KC_C, KC_V, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM fn_actions[] = {
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
void matrix_init_user(){
|
||||||
|
set_unicode_input_mode(UC_LNX);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||||
|
{
|
||||||
|
switch(id) {
|
||||||
|
case M_ALT_HASH:
|
||||||
|
return MACRO_TAP_SHFT_KEY_HOLD_MOD(record, 3, LALT);
|
||||||
|
case M_GR_DASH:
|
||||||
|
{
|
||||||
|
const macro_t* macro = MACRO_TAP_HOLD_LAYER(record, MACRO(T(MINS)), _GR);
|
||||||
|
update_tri_layer(_NUM, _GR, _ADJ);
|
||||||
|
return macro;
|
||||||
|
}
|
||||||
|
case M_SYM_LPRN:
|
||||||
|
return MACRO_TAP_SHFT_KEY_HOLD_LAYER(record, 9, _SYM);
|
||||||
|
case M_NAV_UNDS:
|
||||||
|
return MACRO_TAP_SHFT_KEY_HOLD_LAYER(record, MINS, _NAV);
|
||||||
|
case M_NUM_RPRN:
|
||||||
|
{
|
||||||
|
const macro_t* macro = MACRO_TAP_SHFT_KEY_HOLD_LAYER(record, 0, _NUM);
|
||||||
|
update_tri_layer(_NUM, _GR, _ADJ);
|
||||||
|
return macro;
|
||||||
|
}
|
||||||
|
case M_CTRL_DLR:
|
||||||
|
return MACRO_TAP_SHFT_KEY_HOLD_MOD(record, 4, LCTL);
|
||||||
|
case M_LCBR_ENT:
|
||||||
|
return MACRODOWN(I(10), D(LSFT), T(LBRC), U(LSFT), T(ENT), END);
|
||||||
|
case M_PLOVER:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
layer_and(0);
|
||||||
|
layer_on(_PLOVER);
|
||||||
|
default_layer_set(_PLOVER);
|
||||||
|
|
||||||
|
// Starts plover
|
||||||
|
return MACRO(I(10), D(E), D(R), D(F), D(V), D(I), D(K), U(E), U(R), U(F), U(V), U(I), U(K), END);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case M_EXT_PLV:
|
||||||
|
if (!record->event.pressed) {
|
||||||
|
layer_off(_PLOVER);
|
||||||
|
default_layer_set(_COLEMAK);
|
||||||
|
|
||||||
|
//Pauses plover
|
||||||
|
return MACRO(I(10), D(E), D(R), D(F), D(V), D(Y), D(U), U(E), U(R), U(F), U(V), U(Y), U(U), END);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case M_WINDOWS:
|
||||||
|
set_unicode_input_mode(UC_WIN);
|
||||||
|
break;
|
||||||
|
case M_LINUX:
|
||||||
|
set_unicode_input_mode(UC_LNX);
|
||||||
|
break;
|
||||||
|
case M_OSX:
|
||||||
|
set_unicode_input_mode(UC_OSX);
|
||||||
|
break;
|
||||||
|
case M_FUNCTION:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("function");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case M_THEN:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("then");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case M_CATCH:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("catch");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return MACRO_NONE;
|
||||||
|
};
|
@ -0,0 +1,2 @@
|
|||||||
|
# A more basic Planck Layout for copying
|
||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
ifndef QUANTUM_DIR
|
||||||
|
include ../../../../Makefile
|
||||||
|
endif
|
@ -0,0 +1,229 @@
|
|||||||
|
#include "planck.h"
|
||||||
|
#include "action_layer.h"
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
#include "audio.h"
|
||||||
|
#endif
|
||||||
|
#include "eeconfig.h"
|
||||||
|
|
||||||
|
extern keymap_config_t keymap_config;
|
||||||
|
|
||||||
|
// 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.
|
||||||
|
#define _DVORAK 0
|
||||||
|
#define _QWERTY 1
|
||||||
|
#define _LOWER 2
|
||||||
|
#define _RAISE 3
|
||||||
|
#define _ADJUST 16
|
||||||
|
|
||||||
|
enum planck_keycodes {
|
||||||
|
DVORAK = SAFE_RANGE,
|
||||||
|
QWERTY,
|
||||||
|
LOWER,
|
||||||
|
RAISE,
|
||||||
|
BACKLIT
|
||||||
|
};
|
||||||
|
|
||||||
|
// Fillers to make layering more clear
|
||||||
|
#define _______ KC_TRNS
|
||||||
|
#define XXXXXXX KC_NO
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
/* Dvorak
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | Esc | A | O | E | U | I | D | H | T | N | S | - |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | ` | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_DVORAK] = {
|
||||||
|
{KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC},
|
||||||
|
{KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS},
|
||||||
|
{SFT_T(KC_ESC), KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_T(KC_ENT)},
|
||||||
|
{ALL_T(KC_GRV), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
|
||||||
|
},
|
||||||
|
|
||||||
|
/* Qwerty
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | Esc | A | S | D | F | G | H | J | K | L | ; | " |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | ` | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_QWERTY] = {
|
||||||
|
{_______, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
|
||||||
|
{_______, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
|
||||||
|
{_______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______},
|
||||||
|
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
|
||||||
|
},
|
||||||
|
|
||||||
|
/* Lower
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | | F1 | F2 | F3 | F4 | F5 | F6 | 4 | 5 | 6 | Home |PageUp|
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | | F7 | F8 | F9 | F10 | F11 | F12 | 1 | 2 | 3 | End |PageDn|
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | Next | Vol- | Vol+ | Play |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_LOWER] = {
|
||||||
|
{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_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_4, KC_5, KC_6, KC_HOME, KC_PGUP},
|
||||||
|
{_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_1, KC_2, KC_3, KC_END, KC_PGDN},
|
||||||
|
{_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
|
||||||
|
},
|
||||||
|
|
||||||
|
/* Raise
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | | | | | | | _ | ? | + | { | } | | |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | | | | | | | - | / | = | [ | ] | \ |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | Next | Vol- | Vol+ | Play |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_RAISE] = {
|
||||||
|
{KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL},
|
||||||
|
{_______, _______, _______, _______, _______, _______, KC_UNDS, KC_QUES, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
|
||||||
|
{_______, _______, _______, _______, _______, _______, KC_MINS, KC_SLSH, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
|
||||||
|
{_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
|
||||||
|
},
|
||||||
|
|
||||||
|
/* Adjust (Lower + Raise)
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | | Reset| | | | | | | | | | Del |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | | | |Aud on|Audoff|AGnorm|AGswap|Dvorak|Qwerty| | | |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | | | | |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_ADJUST] = {
|
||||||
|
{_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL},
|
||||||
|
{_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, DVORAK, QWERTY, _______, _______, _______},
|
||||||
|
{_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______},
|
||||||
|
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
|
||||||
|
float tone_startup[][2] = SONG(STARTUP_SOUND);
|
||||||
|
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
|
||||||
|
float tone_dvorak[][2] = SONG(DVORAK_SOUND);
|
||||||
|
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
|
||||||
|
|
||||||
|
float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
void persistant_default_layer_set(uint16_t default_layer) {
|
||||||
|
eeconfig_update_default_layer(default_layer);
|
||||||
|
default_layer_set(default_layer);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
switch (keycode) {
|
||||||
|
case DVORAK:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
|
||||||
|
#endif
|
||||||
|
persistant_default_layer_set(1UL<<_DVORAK);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case QWERTY:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
|
||||||
|
#endif
|
||||||
|
persistant_default_layer_set(1UL<<_QWERTY);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case LOWER:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
layer_on(_LOWER);
|
||||||
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||||
|
} else {
|
||||||
|
layer_off(_LOWER);
|
||||||
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case RAISE:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
layer_on(_RAISE);
|
||||||
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||||
|
} else {
|
||||||
|
layer_off(_RAISE);
|
||||||
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case BACKLIT:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
register_code(KC_RSFT);
|
||||||
|
#ifdef BACKLIGHT_ENABLE
|
||||||
|
backlight_step();
|
||||||
|
#endif
|
||||||
|
} else {
|
||||||
|
unregister_code(KC_RSFT);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
startup_user();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
|
||||||
|
void startup_user()
|
||||||
|
{
|
||||||
|
_delay_ms(20); // gets rid of tick
|
||||||
|
PLAY_NOTE_ARRAY(tone_startup, false, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void shutdown_user()
|
||||||
|
{
|
||||||
|
PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
|
||||||
|
_delay_ms(150);
|
||||||
|
stop_all_notes();
|
||||||
|
}
|
||||||
|
|
||||||
|
void music_on_user(void)
|
||||||
|
{
|
||||||
|
music_scale_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
void music_scale_user(void)
|
||||||
|
{
|
||||||
|
PLAY_NOTE_ARRAY(music_scale, false, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,103 @@
|
|||||||
|
# smt's Planck keymap
|
||||||
|
|
||||||
|
This keymap is primarily based on the default Planck keymap.
|
||||||
|
|
||||||
|
Notable differences from the default are:
|
||||||
|
|
||||||
|
1. **Dvorak by default**
|
||||||
|
|
||||||
|
I happen to type in Dvorak, and prefer that layer to be the default on my keyboard. This is easy enough to switch around with Qwerty, Colemak, or whatever.
|
||||||
|
|
||||||
|
2. **Right Shift**
|
||||||
|
|
||||||
|
I use both the left and right shift keys when I type. When I want to modify a key with shift, I hold shift with the hand opposite the one typing the key. In the default keymap, Enter is where shift would be on a standard keyboard layout. Oh, muscle memory.
|
||||||
|
|
||||||
|
Thankfully, QMK supports [mod-tap](https://github.com/jackhumbert/qmk_firmware/wiki#fun-with-modifier-keys) keys, and this allows me to set the Enter key to send a modifier (MOD_LSFT) when held, and KC_ENT when tapped. Awesome!
|
||||||
|
|
||||||
|
3. Escape
|
||||||
|
|
||||||
|
I am experimenting with using Left Shift as a mod-tap key for Escape, similar to how I use the Enter key. It's set up like this on my Minivan, so in the interest of consistency...
|
||||||
|
|
||||||
|
4. Backtick
|
||||||
|
|
||||||
|
I don't currently have LEDs on any of my keyboards, and even if I did, I don't think I would want their controls on a base layer.
|
||||||
|
|
||||||
|
So, why use backtick in the lower left corner? I use it as my tmux prefix key, so I need to type it more frequently than most people. Putting it on the base layer works well for me.
|
||||||
|
|
||||||
|
## Dvorak (default)
|
||||||
|
|
||||||
|
```
|
||||||
|
,-----------------------------------------------------------------------------------.
|
||||||
|
| Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
|
||||||
|
|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
| Esc | A | O | E | U | I | D | H | T | N | S | - |
|
||||||
|
|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
| Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
|
||||||
|
|------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
| ` | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
|
||||||
|
`-----------------------------------------------------------------------------------'
|
||||||
|
```
|
||||||
|
|
||||||
|
## Qwerty (same as default)
|
||||||
|
|
||||||
|
```
|
||||||
|
,-----------------------------------------------------------------------------------.
|
||||||
|
| Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
||||||
|
|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
| Esc | A | S | D | F | G | H | J | K | L | ; | " |
|
||||||
|
|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
| Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
|
||||||
|
|------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
| ` | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
|
||||||
|
`-----------------------------------------------------------------------------------'
|
||||||
|
```
|
||||||
|
|
||||||
|
## Lower
|
||||||
|
|
||||||
|
This is where I put the number row, a numpad cluster, function keys, and some light navigation via Home/End/PageUp/PageDn. Like the "Raise" layer, the top row is redundant to help with Planck compatibility.
|
||||||
|
|
||||||
|
```
|
||||||
|
,-----------------------------------------------------------------------------------.
|
||||||
|
| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del |
|
||||||
|
|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
| | F1 | F2 | F3 | F4 | F5 | F6 | 4 | 5 | 6 | Home |PageUp|
|
||||||
|
|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
| | F7 | F8 | F9 | F10 | F11 | F12 | 1 | 2 | 3 | End |PageDn|
|
||||||
|
|------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
| | | | | | | | Next | Vol- | Vol+ | Play |
|
||||||
|
`-----------------------------------------------------------------------------------'
|
||||||
|
```
|
||||||
|
|
||||||
|
## Raise
|
||||||
|
|
||||||
|
As a developer, it makes the most sense for me to group all the commonly-used symbols that don't fit on the main layer. In particular, having the dual-column of parens-braces-brackets really helps a lot.
|
||||||
|
|
||||||
|
I haven't completely filled this layer, which leaves room for future mappings and macros.
|
||||||
|
|
||||||
|
```
|
||||||
|
,-----------------------------------------------------------------------------------.
|
||||||
|
| ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
|
||||||
|
|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
| | | | | | | _ | ? | + | { | } | | |
|
||||||
|
|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
| | | | | | | - | / | = | [ | ] | \ |
|
||||||
|
|------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
| | | | | | | | Next | Vol- | Vol+ | Play |
|
||||||
|
`-----------------------------------------------------------------------------------'
|
||||||
|
```
|
||||||
|
|
||||||
|
## Adjust (Lower + Raise)
|
||||||
|
|
||||||
|
Utility layer. This is where I'd switch to Qwerty, or ~~fool around with~~ adjust the audio/music settings.
|
||||||
|
|
||||||
|
```
|
||||||
|
,-----------------------------------------------------------------------------------.
|
||||||
|
| | Reset| | | | | | | | | | Del |
|
||||||
|
|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
| | | |Aud on|AudOff|AGnorm|AGswap|Dvorak|Qwerty| | | |
|
||||||
|
|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
| |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | |
|
||||||
|
|------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
| | | | | | | | | | | |
|
||||||
|
`-----------------------------------------------------------------------------------'
|
||||||
|
```
|
@ -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 = no # Virtual DIP switch configuration(+1000)
|
||||||
|
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||||
|
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||||
|
CONSOLE_ENABLE = no # 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 = yes # 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,11 @@
|
|||||||
|
#ifndef CONFIG_USER_H
|
||||||
|
#define CONFIG_USER_H
|
||||||
|
|
||||||
|
#include "../../config.h"
|
||||||
|
|
||||||
|
#define PREVENT_STUCK_MODIFIERS
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,108 @@
|
|||||||
|
// 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
|
||||||
|
|
||||||
|
// 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.
|
||||||
|
#define _QWERTY 0
|
||||||
|
#define _NUM 5
|
||||||
|
#define _FUNC 6
|
||||||
|
#define _NAV 7
|
||||||
|
|
||||||
|
// Fillers to make layering more clear
|
||||||
|
#define _______ KC_TRNS
|
||||||
|
#define XXXXXXX KC_NO
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
/* _QWERTY
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* |Ctrl/Tab| A | S | D | F | G | H | J | K | L | ; | " |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | Shift| Z | X | C | V | B | N | M | , | . | / |Shift |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | Ctrl | Alt | GUI | GUI | Num | Space | FN | GUI | Alt | Ctrl | Enter|
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_QWERTY] = {
|
||||||
|
{KC_ESC, 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_TAB), 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_RSFT},
|
||||||
|
{KC_LCTL, KC_LALT, KC_LGUI, KC_LGUI, MO(_NUM), KC_SPC, KC_SPC, MO(_FUNC), KC_RGUI, KC_RALT, KC_RCTL, KC_ENT}
|
||||||
|
},
|
||||||
|
|
||||||
|
/* _NUM
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | ___ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ____ |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | Ctrl | ` | [ | { | ( | / | \ | ) | } | ] | - | = |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | ____ | ! | @ | # | $ | % | ^ | & | * | _ | + | ____ |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | ____ | ___ | ___ | ___ | XXXX | ______ | ____ | ____ | ____ | __ | ____ |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_NUM] = {
|
||||||
|
{_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______},
|
||||||
|
{KC_LCTL, KC_GRV, KC_LBRC, KC_LCBR, KC_LPRN, KC_SLSH, KC_BSLS, KC_RPRN, KC_RCBR, KC_RBRC, KC_MINS, KC_EQL},
|
||||||
|
{_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_UNDS, KC_PLUS, _______},
|
||||||
|
{_______, _______, _______, _______, _______, _______, _______, MO(_NAV), _______, _______, _______, _______}
|
||||||
|
},
|
||||||
|
|
||||||
|
/* _FUNC
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | ____ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ____ |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | ____ |Shift | Ctrl | Alt | GUI | ____ | Left | Down | Up |Right | Del | ____ |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | ____ |Light | ____ | Vol- | Prev | Play | Mute | Next | Vol+ | ____ | ____ | ____ |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | ____ | ____ | ____ | ____ | ____ | _____ | XXXX | ____ | ____ | ____ | ____ |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_FUNC] = {
|
||||||
|
{_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______},
|
||||||
|
{_______, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_DEL, _______},
|
||||||
|
{_______, M(0), _______, KC_VOLD, KC_MPRV, KC_MPLY, KC_MUTE, KC_MNXT, KC_VOLU, _______, _______, _______},
|
||||||
|
{_______, _______, _______, _______, MO(_NAV), _______, _______, _______, _______, _______, _______, _______}
|
||||||
|
},
|
||||||
|
|
||||||
|
[_NAV] = {
|
||||||
|
{KC_MS_ACCEL2, KC_FN1, KC_FN2, KC_FN3, KC_FN4, XXXXXXX, XXXXXXX, KC_WH_D, KC_WH_U, XXXXXXX, XXXXXXX, XXXXXXX},
|
||||||
|
{KC_MS_ACCEL1, KC_MS_BTN4, KC_MS_BTN3, KC_MS_BTN2, KC_MS_BTN1, XXXXXXX, KC_MS_LEFT, KC_MS_DOWN, KC_MS_UP, KC_MS_RIGHT, XXXXXXX, XXXXXXX},
|
||||||
|
{KC_MS_ACCEL0, KC_FN9, KC_FN10, KC_FN11, KC_FN12, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX},
|
||||||
|
{XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}
|
||||||
|
},
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM fn_actions[] = {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
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);
|
||||||
|
#ifdef BACKLIGHT_ENABLE
|
||||||
|
backlight_step();
|
||||||
|
#endif
|
||||||
|
} else {
|
||||||
|
unregister_code(KC_RSFT);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return MACRO_NONE;
|
||||||
|
};
|
After Width: | Height: | Size: 57 KiB |
@ -0,0 +1,3 @@
|
|||||||
|
ifndef QUANTUM_DIR
|
||||||
|
include ../../../../Makefile
|
||||||
|
endif
|
@ -0,0 +1,247 @@
|
|||||||
|
#include "preonic.h"
|
||||||
|
#include "action_layer.h"
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
#include "audio.h"
|
||||||
|
#endif
|
||||||
|
#include "eeconfig.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.
|
||||||
|
#define _DVORAK 0
|
||||||
|
#define _QWERTY 1
|
||||||
|
#define _LOWER 2
|
||||||
|
#define _RAISE 3
|
||||||
|
#define _ADJUST 16
|
||||||
|
|
||||||
|
enum preonic_keycodes {
|
||||||
|
DVORAK = SAFE_RANGE,
|
||||||
|
QWERTY,
|
||||||
|
LOWER,
|
||||||
|
RAISE,
|
||||||
|
BACKLIT
|
||||||
|
};
|
||||||
|
|
||||||
|
// Fillers to make layering more clear
|
||||||
|
#define _______ KC_TRNS
|
||||||
|
#define XXXXXXX KC_NO
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
/* Dvorak
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | Esc | A | O | E | U | I | D | H | T | N | S | - |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | ` | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_DVORAK] = {
|
||||||
|
{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
|
||||||
|
{KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC},
|
||||||
|
{KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS},
|
||||||
|
{SFT_T(KC_ESC), KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_T(KC_ENT)},
|
||||||
|
{ALL_T(KC_GRV), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
|
||||||
|
},
|
||||||
|
|
||||||
|
/* Qwerty
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | Esc | A | S | D | F | G | H | J | K | L | ; | " |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | ` | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_QWERTY] = {
|
||||||
|
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
|
||||||
|
{_______, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, _______},
|
||||||
|
{_______, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
|
||||||
|
{_______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______},
|
||||||
|
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
|
||||||
|
},
|
||||||
|
|
||||||
|
/* Lower
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | | F1 | F2 | F3 | F4 | F5 | F6 | 4 | 5 | 6 | Home |PageUp|
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | | F7 | F8 | F9 | F10 | F11 | F12 | 1 | 2 | 3 | End |PageDn|
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | Next | Vol- | Vol+ | Play |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_LOWER] = {
|
||||||
|
{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_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL},
|
||||||
|
{_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_4, KC_5, KC_6, KC_HOME, KC_PGUP},
|
||||||
|
{_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_1, KC_2, KC_3, KC_END, KC_PGDN},
|
||||||
|
{_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
|
||||||
|
},
|
||||||
|
|
||||||
|
/* Raise
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | | | | | | | _ | ? | + | { | } | | |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | | | | | | | - | / | = | [ | ] | \ |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | Next | Vol- | Vol+ | Play |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_RAISE] = {
|
||||||
|
{KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL},
|
||||||
|
{KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL},
|
||||||
|
{_______, _______, _______, _______, _______, _______, KC_UNDS, KC_QUES, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
|
||||||
|
{_______, _______, _______, _______, _______, _______, KC_MINS, KC_SLSH, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
|
||||||
|
{_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
|
||||||
|
},
|
||||||
|
|
||||||
|
/* Adjust (Lower + Raise)
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | Reset| | | | | | | | | | Del |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | | | |Aud on|AudOff|AGnorm|AGswap|Dvorak|Qwerty| | | |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | | | | |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_ADJUST] = {
|
||||||
|
{KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12},
|
||||||
|
{_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL},
|
||||||
|
{_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, DVORAK, QWERTY, _______, _______, _______},
|
||||||
|
{_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______},
|
||||||
|
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
float tone_startup[][2] = {
|
||||||
|
{NOTE_B5, 20},
|
||||||
|
{NOTE_B6, 8},
|
||||||
|
{NOTE_DS6, 20},
|
||||||
|
{NOTE_B6, 8}
|
||||||
|
};
|
||||||
|
|
||||||
|
float tone_dvorak[][2] = SONG(DVORAK_SOUND);
|
||||||
|
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
|
||||||
|
|
||||||
|
float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
|
||||||
|
|
||||||
|
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void persistant_default_layer_set(uint16_t default_layer) {
|
||||||
|
eeconfig_update_default_layer(default_layer);
|
||||||
|
default_layer_set(default_layer);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
switch (keycode) {
|
||||||
|
case DVORAK:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
|
||||||
|
#endif
|
||||||
|
persistant_default_layer_set(1UL<<_DVORAK);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case QWERTY:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
|
||||||
|
#endif
|
||||||
|
persistant_default_layer_set(1UL<<_QWERTY);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case LOWER:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
layer_on(_LOWER);
|
||||||
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||||
|
} else {
|
||||||
|
layer_off(_LOWER);
|
||||||
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case RAISE:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
layer_on(_RAISE);
|
||||||
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||||
|
} else {
|
||||||
|
layer_off(_RAISE);
|
||||||
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case BACKLIT:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
register_code(KC_RSFT);
|
||||||
|
#ifdef BACKLIGHT_ENABLE
|
||||||
|
backlight_step();
|
||||||
|
#endif
|
||||||
|
} else {
|
||||||
|
unregister_code(KC_RSFT);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
startup_user();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
|
||||||
|
void startup_user()
|
||||||
|
{
|
||||||
|
_delay_ms(20); // gets rid of tick
|
||||||
|
PLAY_NOTE_ARRAY(tone_startup, false, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void shutdown_user()
|
||||||
|
{
|
||||||
|
PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
|
||||||
|
_delay_ms(150);
|
||||||
|
stop_all_notes();
|
||||||
|
}
|
||||||
|
|
||||||
|
void music_on_user(void)
|
||||||
|
{
|
||||||
|
music_scale_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
void music_scale_user(void)
|
||||||
|
{
|
||||||
|
PLAY_NOTE_ARRAY(music_scale, false, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,113 @@
|
|||||||
|
# smt's Preonic keymap
|
||||||
|
|
||||||
|
This keymap is primarily based on the default Preonic keymap, which in turn is derived from Planck's default.
|
||||||
|
|
||||||
|
Notable differences from the default are:
|
||||||
|
|
||||||
|
1. **Dvorak by default**
|
||||||
|
|
||||||
|
I happen to type in Dvorak, and prefer that layer to be the default on my keyboard. This is easy enough to switch around with Qwerty, Colemak, or whatever.
|
||||||
|
|
||||||
|
2. **Right Shift**
|
||||||
|
|
||||||
|
I use both the left and right shift keys when I type. When I want to modify a key with shift, I hold shift with the hand opposite the one typing the key. In the default keymap, Enter is where shift would be on a standard keyboard layout. Oh, muscle memory.
|
||||||
|
|
||||||
|
Thankfully, QMK supports [mod-tap](https://github.com/jackhumbert/qmk_firmware/wiki#fun-with-modifier-keys) keys, and this allows me to set the Enter key to send a modifier (MOD_LSFT) when held, and KC_ENT when tapped. Awesome!
|
||||||
|
|
||||||
|
3. Escape
|
||||||
|
|
||||||
|
I am experimenting with using Left Shift as a mod-tap key for Escape, similar to how I use the Enter key. It's set up like this on my Minivan, so in the interest of consistency...
|
||||||
|
|
||||||
|
4. Backtick
|
||||||
|
|
||||||
|
I don't currently have LEDs on any of my keyboards, and even if I did, I don't think I would want their controls on a base layer.
|
||||||
|
|
||||||
|
So, why use backtick in the lower left corner? I use it as my tmux prefix key, so I need to type it more frequently than most people. Putting it on the base layer works well for me.
|
||||||
|
|
||||||
|
## Dvorak (default)
|
||||||
|
|
||||||
|
```
|
||||||
|
,-----------------------------------------------------------------------------------.
|
||||||
|
| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
|
||||||
|
|------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
| Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
|
||||||
|
|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
| Esc | A | O | E | U | I | D | H | T | N | S | - |
|
||||||
|
|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
| Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
|
||||||
|
|------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
| ` | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
|
||||||
|
`-----------------------------------------------------------------------------------'
|
||||||
|
```
|
||||||
|
|
||||||
|
## Qwerty (same as default)
|
||||||
|
|
||||||
|
```
|
||||||
|
,-----------------------------------------------------------------------------------.
|
||||||
|
| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
|
||||||
|
|------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
| Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
||||||
|
|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
| Esc | A | S | D | F | G | H | J | K | L | ; | " |
|
||||||
|
|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
| Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
|
||||||
|
|------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
| ` | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
|
||||||
|
`-----------------------------------------------------------------------------------'
|
||||||
|
```
|
||||||
|
|
||||||
|
## Lower
|
||||||
|
|
||||||
|
This is where I put the number row, a numpad cluster, function keys, and some light navigation via Home/End/PageUp/PageDn. Like the "Raise" layer, the top row is redundant to help with Planck compatibility.
|
||||||
|
|
||||||
|
```
|
||||||
|
,-----------------------------------------------------------------------------------.
|
||||||
|
| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del |
|
||||||
|
|------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del |
|
||||||
|
|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
| | F1 | F2 | F3 | F4 | F5 | F6 | 4 | 5 | 6 | Home |PageUp|
|
||||||
|
|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
| | F7 | F8 | F9 | F10 | F11 | F12 | 1 | 2 | 3 | End |PageDn|
|
||||||
|
|------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
| | | | | | | | Next | Vol- | Vol+ | Play |
|
||||||
|
`-----------------------------------------------------------------------------------'
|
||||||
|
```
|
||||||
|
|
||||||
|
## Raise
|
||||||
|
|
||||||
|
As a developer, it makes the most sense for me to group all the commonly-used symbols that don't fit on the main layer. In particular, having the dual-column of parens-braces-brackets really helps a lot.
|
||||||
|
|
||||||
|
I haven't completely filled this layer, which leaves room for future mappings and macros.
|
||||||
|
|
||||||
|
```
|
||||||
|
,-----------------------------------------------------------------------------------.
|
||||||
|
| ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
|
||||||
|
|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
| ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
|
||||||
|
|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
| | | | | | | _ | ? | + | { | } | | |
|
||||||
|
|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
| | | | | | | - | / | = | [ | ] | \ |
|
||||||
|
|------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
| | | | | | | | Next | Vol- | Vol+ | Play |
|
||||||
|
`-----------------------------------------------------------------------------------'
|
||||||
|
```
|
||||||
|
|
||||||
|
## Adjust (Lower + Raise)
|
||||||
|
|
||||||
|
Utility layer. This is where I'd switch to Qwerty, or ~~fool around with~~ adjust the audio/music settings.
|
||||||
|
|
||||||
|
```
|
||||||
|
,-----------------------------------------------------------------------------------.
|
||||||
|
| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
|
||||||
|
|------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
| | Reset| | | | | | | | | | Del |
|
||||||
|
|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
| | | |Aud on|AudOff|AGnorm|AGswap|Dvorak|Qwerty| | | |
|
||||||
|
|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
| |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | |
|
||||||
|
|------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
| | | | | | | | | | | |
|
||||||
|
`-----------------------------------------------------------------------------------'
|
||||||
|
```
|
@ -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 = yes # Mouse keys(+4700)
|
||||||
|
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||||
|
CONSOLE_ENABLE = no # 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 = no # 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.
|
||||||
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
|
||||||
|
ifndef QUANTUM_DIR
|
||||||
|
include ../../../../Makefile
|
||||||
|
endif
|
@ -0,0 +1,36 @@
|
|||||||
|
#ifndef CONFIG_USER_H
|
||||||
|
#define CONFIG_USER_H
|
||||||
|
|
||||||
|
#include "../../config.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
*TV44 keymap definition macro
|
||||||
|
*/
|
||||||
|
#define KEYMAP_TV44( \
|
||||||
|
K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, \
|
||||||
|
K13, K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, \
|
||||||
|
K25, K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, \
|
||||||
|
K37, K38, K39, K40, K41, K42, K43, K44 \
|
||||||
|
) { \
|
||||||
|
{ K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, }, \
|
||||||
|
{ K13, K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, }, \
|
||||||
|
{ K25, K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, }, \
|
||||||
|
{ K37, K38, K39, K40, KC_NO, KC_NO, KC_NO, K41, K42, K43, KC_NO, K44 } \
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*TV45 keymap definition macro (arrows layout)
|
||||||
|
*/
|
||||||
|
#define KEYMAP_TV45( \
|
||||||
|
K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, \
|
||||||
|
K13, K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, \
|
||||||
|
K25, K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, \
|
||||||
|
K37, K38, K39, K40, K41, K42, K43, K44, K45 \
|
||||||
|
) { \
|
||||||
|
{ K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, }, \
|
||||||
|
{ K13, K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, }, \
|
||||||
|
{ K25, K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, }, \
|
||||||
|
{ K37, K38, K39, K40, KC_NO, KC_NO, KC_NO, K41, K42, K43, K44, K45 } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
After Width: | Height: | Size: 65 KiB |
@ -0,0 +1,232 @@
|
|||||||
|
#include "tv44.h"
|
||||||
|
#include "action_layer.h"
|
||||||
|
#include "eeconfig.h"
|
||||||
|
|
||||||
|
extern keymap_config_t keymap_config;
|
||||||
|
|
||||||
|
// 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.
|
||||||
|
#define _QWERTY 0
|
||||||
|
#define _COLEMAK 1
|
||||||
|
#define _DVORAK 2
|
||||||
|
#define _LOWER 3
|
||||||
|
#define _RAISE 4
|
||||||
|
#define _ADJUST 16
|
||||||
|
|
||||||
|
// Keycodes
|
||||||
|
enum planck_keycodes {
|
||||||
|
QWERTY = SAFE_RANGE,
|
||||||
|
COLEMAK,
|
||||||
|
DVORAK,
|
||||||
|
LOWER,
|
||||||
|
RAISE,
|
||||||
|
BACKLIT
|
||||||
|
};
|
||||||
|
|
||||||
|
// Fillers to make layering more clear
|
||||||
|
#define _______ KC_TRNS
|
||||||
|
#define XXXXXXX KC_NO
|
||||||
|
|
||||||
|
// Custom macros
|
||||||
|
#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl
|
||||||
|
#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift
|
||||||
|
#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper
|
||||||
|
#define ALT_GRV ALT_T(KC_GRV) // Tap for Backtick, hold for Alt
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
/* Qwerty
|
||||||
|
*
|
||||||
|
* ,---------+------+------+------+------+------+------+------+------+------+------+---------.
|
||||||
|
* |Hyper/Tab| Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
||||||
|
* |---------`------`------`------`------`------`------`------`------`------`------`---------|
|
||||||
|
* | Ctrl/Esc | A | S | D | F | G | H | J | K | L | ; | ' |
|
||||||
|
* |----------`------`------`------`------`------`------`------`------`------`------`--------|
|
||||||
|
* | Shift | Z | X | C | V | B | N | M | , | . | / |Sft/Ent|
|
||||||
|
* |-----------`------`------`------`------`-----'-------`------`------`------`------`-------|
|
||||||
|
* | Alt/` | GUI | Lower | Space | Space | Raise | GUI | Alt | Ctrl |
|
||||||
|
* `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------'
|
||||||
|
*/
|
||||||
|
[_QWERTY] = KEYMAP_TV45(
|
||||||
|
/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
|
||||||
|
HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC ,
|
||||||
|
/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
|
||||||
|
CTL_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, SFT_ENT ,
|
||||||
|
/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
|
||||||
|
ALT_GRV , KC_LGUI , LOWER , KC_SPC , KC_SPC , RAISE , KC_RGUI, KC_RALT, KC_RCTL ),
|
||||||
|
/*`---------+---------------+---------+-------^^^------+-------^^^-------+----------+--------+--------+--------------'*/
|
||||||
|
|
||||||
|
/* Colemak
|
||||||
|
* ,---------+------+------+------+------+------+------+------+------+------+------+---------.
|
||||||
|
* |Hyper/Tab| Q | W | F | P | G | J | L | U | Y | ; | Bksp |
|
||||||
|
* |---------`------`------`------`------`------`------`------`------`------`------`---------|
|
||||||
|
* | Ctrl/Esc | A | R | S | T | D | H | N | E | I | O | ' |
|
||||||
|
* |----------`------`------`------`------`------`------`------`------`------`------`--------|
|
||||||
|
* | Shift | Z | X | C | V | B | K | M | , | . | / |Sft/Ent|
|
||||||
|
* |-----------`------`------`------`------`-----'-------`------`------`------`------`-------|
|
||||||
|
* | Alt/` | GUI | Lower | Space | Space | Raise | GUI | Alt | Ctrl |
|
||||||
|
* `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------'
|
||||||
|
*/
|
||||||
|
[_COLEMAK] = KEYMAP_TV45(
|
||||||
|
/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
|
||||||
|
HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC ,
|
||||||
|
/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
|
||||||
|
CTL_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, SFT_ENT ,
|
||||||
|
/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
|
||||||
|
ALT_GRV , KC_LGUI , LOWER , KC_SPC , KC_SPC , RAISE , KC_RGUI, KC_RALT, KC_RCTL ),
|
||||||
|
/*`---------+---------------+---------+-------^^^------+-------^^^-------+----------+--------+--------+--------------'*/
|
||||||
|
|
||||||
|
/* Dvorak
|
||||||
|
* ,---------+------+------+------+------+------+------+------+------+------+------+---------.
|
||||||
|
* |Hyper/Tab| ' | , | . | P | Y | F | G | C | R | L | Bksp |
|
||||||
|
* |---------`------`------`------`------`------`------`------`------`------`------`---------|
|
||||||
|
* | Ctrl/Esc | A | O | E | U | I | D | H | T | N | S | - |
|
||||||
|
* |----------`------`------`------`------`------`------`------`------`------`------`--------|
|
||||||
|
* | Shift | ; | Q | J | K | X | B | M | W | V | Z |Sft/Ent|
|
||||||
|
* |-----------`------`------`------`------`-----'-------`------`------`------`------`-------|
|
||||||
|
* | Alt/` | GUI | Lower | Space | Space | Raise | GUI | Alt | Ctrl |
|
||||||
|
* `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------'
|
||||||
|
*/
|
||||||
|
[_DVORAK] = KEYMAP_TV45(
|
||||||
|
/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
|
||||||
|
HPR_TAB,KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC ,
|
||||||
|
/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
|
||||||
|
CTL_ESC , KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS ,
|
||||||
|
/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
|
||||||
|
KC_LSFT , KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT ,
|
||||||
|
/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
|
||||||
|
ALT_GRV , KC_LGUI , LOWER , KC_SPC , KC_SPC , RAISE , KC_RGUI, KC_RALT, KC_RCTL ),
|
||||||
|
/*`---------+---------------+---------+-------^^^------+-------^^^-------+----------+--------+--------+--------------'*/
|
||||||
|
|
||||||
|
/* Lower
|
||||||
|
* ,---------+------+------+------+------+------+------+------+------+------+------+---------.
|
||||||
|
* | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del |
|
||||||
|
* |---------`------`------`------`------`------`------`------`------`------`------`---------|
|
||||||
|
* | $ | 4 | 5 | 6 | . | + | * | 4 | 5 | 6 | . | PageUp |
|
||||||
|
* |----------`------`------`------`------`------`------`------`------`------`------`--------|
|
||||||
|
* | = | 7 | 8 | 9 | 0 | - | / | 1 | 2 | 3 | Up |PageDn |
|
||||||
|
* |-----------`------`------`------`------`-----'-------`------`------`------`------`-------|
|
||||||
|
* | Brite | | | Home | End | | Left | Down | Right |
|
||||||
|
* `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------'
|
||||||
|
*/
|
||||||
|
[_LOWER] = KEYMAP_TV45(
|
||||||
|
/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
|
||||||
|
KC_0 , KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL ,
|
||||||
|
/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
|
||||||
|
KC_DLR , KC_4, KC_5, KC_6, KC_DOT, KC_PLUS, KC_ASTR, KC_4, KC_5, KC_6, KC_DOT, KC_PGUP ,
|
||||||
|
/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
|
||||||
|
KC_EQL , KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_SLSH, KC_1, KC_2, KC_3, KC_UP, KC_PGDN ,
|
||||||
|
/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
|
||||||
|
BACKLIT , _______ , _______ , KC_HOME , KC_END , _______ , KC_LEFT, KC_DOWN, KC_RGHT ),
|
||||||
|
/*`---------+---------------+---------+-------^^^------+-------^^^-------+----------+--------+--------+--------------'*/
|
||||||
|
|
||||||
|
/* Raise
|
||||||
|
* ,---------+------+------+------+------+------+------+------+------+------+------+---------.
|
||||||
|
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
|
||||||
|
* |---------`------`------`------`------`------`------`------`------`------`------`---------|
|
||||||
|
* | F1 | F2 | F3 | F4 | F5 | F6 | _ | ? | + | { | } | |
|
||||||
|
* |----------`------`------`------`------`------`------`------`------`------`------`--------|
|
||||||
|
* | F7 | F8 | F9 | F10 | F11 | F12 | - | / | = | [ | ] | |
|
||||||
|
* |-----------`------`------`------`------`-----'-------`------`------`------`------`-------|
|
||||||
|
* | Brite | | | Play | Next | | Mute | Vol- | Vol+ |
|
||||||
|
* `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------'
|
||||||
|
*/
|
||||||
|
[_RAISE] = KEYMAP_TV45(
|
||||||
|
/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
|
||||||
|
KC_TILD,KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL ,
|
||||||
|
/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
|
||||||
|
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_QUES, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE ,
|
||||||
|
/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
|
||||||
|
KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MINS, KC_SLSH, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS ,
|
||||||
|
/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
|
||||||
|
BACKLIT , _______ , _______ , KC_MPLY , KC_MNXT , _______ , KC_MUTE, KC_VOLD, KC_VOLU ),
|
||||||
|
/*`---------+---------------+---------+-------^^^------+-------^^^-------+----------+--------+--------+--------------'*/
|
||||||
|
|
||||||
|
/* Adjust (Lower + Raise)
|
||||||
|
* ,---------+------+------+------+------+------+------+------+------+------+------+---------.
|
||||||
|
* | | Reset| | | | | | | | | | Del |
|
||||||
|
* |---------`------`------`------`------`------`------`------`------`------`------`---------|
|
||||||
|
* | | | | | |AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
|
||||||
|
* |----------`------`------`------`------`------`------`------`------`------`------`--------|
|
||||||
|
* | | | | | | | | | | | | |
|
||||||
|
* |-----------`------`------`------`------`-----'-------`------`------`------`------`-------|
|
||||||
|
* | | | | | | | | | |
|
||||||
|
* `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------'
|
||||||
|
*/
|
||||||
|
[_ADJUST] = KEYMAP_TV45(
|
||||||
|
/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/
|
||||||
|
_______, RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL ,
|
||||||
|
/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/
|
||||||
|
_______ ,_______, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______ ,
|
||||||
|
/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
|
||||||
|
_______ ,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ,
|
||||||
|
/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
|
||||||
|
_______ , _______ , _______ , _______ , _______ , _______ , _______, _______, _______ ),
|
||||||
|
/*`---------+---------------+---------+-------^^^------+-------^^^-------+----------+--------+--------+--------------'*/
|
||||||
|
};
|
||||||
|
|
||||||
|
void persistant_default_layer_set(uint16_t default_layer) {
|
||||||
|
eeconfig_update_default_layer(default_layer);
|
||||||
|
default_layer_set(default_layer);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
switch (keycode) {
|
||||||
|
case QWERTY:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
persistant_default_layer_set(1UL<<_QWERTY);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case COLEMAK:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
persistant_default_layer_set(1UL<<_COLEMAK);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case DVORAK:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
persistant_default_layer_set(1UL<<_DVORAK);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case LOWER:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
layer_on(_LOWER);
|
||||||
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||||
|
} else {
|
||||||
|
layer_off(_LOWER);
|
||||||
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case RAISE:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
layer_on(_RAISE);
|
||||||
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||||
|
} else {
|
||||||
|
layer_off(_RAISE);
|
||||||
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case BACKLIT:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
register_code(KC_RSFT);
|
||||||
|
#ifdef BACKLIGHT_ENABLE
|
||||||
|
backlight_step();
|
||||||
|
#endif
|
||||||
|
} else {
|
||||||
|
unregister_code(KC_RSFT);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
@ -0,0 +1,126 @@
|
|||||||
|
# smt's TV44 keymap
|
||||||
|
|
||||||
|
This keymap is based on a combination of my Planck keymap and [jeebak's TV44 layout](https://github.com/qmk/qmk_firmware/tree/master/keyboards/tv44/keymaps/jeebak). I removed the macros and TouchCursor/MouseCursor layers, because I'm just not ready for that level of mind-mapping.
|
||||||
|
|
||||||
|
I had been using something close to the default Minivan layout, but after spending a bit of time with the Planck and Preonic, I decided it would be better for me to try to standardize to some degree, where possible.
|
||||||
|
|
||||||
|
Also, it's worth noting that my Minivan is one with the "arrows" layout, which has a 45th key, so I had to define a new KEYMAP_TV45 macro in config.h. In spite of this, the 45-key Minivan is still technically considered a "TV44" as far as I know.
|
||||||
|
|
||||||
|
![smt's TV44 keymap](keyboard-layout-minivan.png)
|
||||||
|
|
||||||
|
## Notable features (most of which can be found in my or jeebak's respective keymap file):
|
||||||
|
|
||||||
|
1. **Shift/Enter**
|
||||||
|
|
||||||
|
I use both the left and right shift keys when I type. When I want to modify a key with shift, I hold shift with the hand opposite the one typing the key. In the default keymap, Enter is where shift would be on a standard keyboard layout. Oh, muscle memory.
|
||||||
|
|
||||||
|
Thankfully, QMK supports [mod-tap](https://github.com/jackhumbert/qmk_firmware/wiki#fun-with-modifier-keys) keys, and this allows me to set the Enter key to send a modifier (MOD_LSFT) when held, and KC_ENT when tapped. Awesome!
|
||||||
|
|
||||||
|
2. **Hyper/Tab**
|
||||||
|
|
||||||
|
This key modifies with "Hyper" (see [Brett Terpstra's post](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/) on this) when held, and outputs the code for Tab when tapped. On the Mac, I use KeyboardMaestro to remap my hyper-keys to do a lot of crazy things.
|
||||||
|
|
||||||
|
3. **Ctrl/Escape**
|
||||||
|
|
||||||
|
I set up another mod-tap, this time for the Escape key that would act as a Control modifier when held.
|
||||||
|
|
||||||
|
4. **Alt/Backtick**
|
||||||
|
|
||||||
|
I don't currently have LEDs on most of my keyboards, and I certainly don't want LED controls on the base layer of a 40%.
|
||||||
|
|
||||||
|
So, why use backtick in the lower left corner? I use it as my tmux prefix key, so I need to type it more frequently than most people. Putting it on the base layer works well for my use case, and it's consistent with where I place it in my Planck and Preonic keymaps.
|
||||||
|
|
||||||
|
I also like Alt in that position, so it works well as yet another mod-tap key.
|
||||||
|
|
||||||
|
|
||||||
|
## Layers
|
||||||
|
|
||||||
|
### Qwerty
|
||||||
|
|
||||||
|
```
|
||||||
|
,---------+------+------+------+------+------+------+------+------+------+------+---------.
|
||||||
|
|Hyper/Tab| Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
||||||
|
|---------`------`------`------`------`------`------`------`------`------`------`---------|
|
||||||
|
| Ctrl/Esc | A | S | D | F | G | H | J | K | L | ; | ' |
|
||||||
|
|----------`------`------`------`------`------`------`------`------`------`------`--------|
|
||||||
|
| Shift | Z | X | C | V | B | N | M | , | . | / |Sft/Ent|
|
||||||
|
|-----------`------`------`------`------`-----'-------`------`------`------`------`-------|
|
||||||
|
| Alt/` | GUI | Lower | Space | Space | Raise | GUI | Alt | Ctrl |
|
||||||
|
`-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------'
|
||||||
|
```
|
||||||
|
|
||||||
|
### Colemak
|
||||||
|
|
||||||
|
```
|
||||||
|
,---------+------+------+------+------+------+------+------+------+------+------+---------.
|
||||||
|
|Hyper/Tab| Q | W | F | P | G | J | L | U | Y | ; | Bksp |
|
||||||
|
|---------`------`------`------`------`------`------`------`------`------`------`---------|
|
||||||
|
| Ctrl/Esc | A | R | S | T | D | H | N | E | I | O | ' |
|
||||||
|
|----------`------`------`------`------`------`------`------`------`------`------`--------|
|
||||||
|
| Shift | Z | X | C | V | B | K | M | , | . | / |Sft/Ent|
|
||||||
|
|-----------`------`------`------`------`-----'-------`------`------`------`------`-------|
|
||||||
|
| Alt/` | GUI | Lower | Space | Space | Raise | GUI | Alt | Ctrl |
|
||||||
|
`-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------'
|
||||||
|
```
|
||||||
|
|
||||||
|
### Dvorak
|
||||||
|
|
||||||
|
```
|
||||||
|
,---------+------+------+------+------+------+------+------+------+------+------+---------.
|
||||||
|
|Hyper/Tab| ' | , | . | P | Y | F | G | C | R | L | Bksp |
|
||||||
|
|---------`------`------`------`------`------`------`------`------`------`------`---------|
|
||||||
|
| Ctrl/Esc | A | O | E | U | I | D | H | T | N | S | - |
|
||||||
|
|----------`------`------`------`------`------`------`------`------`------`------`--------|
|
||||||
|
| Shift | ; | Q | J | K | X | B | M | W | V | Z |Sft/Ent|
|
||||||
|
|-----------`------`------`------`------`-----'-------`------`------`------`------`-------|
|
||||||
|
| Alt/` | GUI | Lower | Space | Space | Raise | GUI | Alt | Ctrl |
|
||||||
|
`-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------'
|
||||||
|
```
|
||||||
|
|
||||||
|
### Lower
|
||||||
|
|
||||||
|
This is where I put the number row, two numpad clusters, common arithmetic operators, and cursorkeys: Arrow cluster, Home/End, Page Up/Page Down. `0` and `$` are also placed on the left side for convenient access to beginning-of-line and end-of-line Vim commands. BRITE has been moved here from the base layer.
|
||||||
|
|
||||||
|
```
|
||||||
|
,---------+------+------+------+------+------+------+------+------+------+------+---------.
|
||||||
|
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del |
|
||||||
|
|---------`------`------`------`------`------`------`------`------`------`------`---------|
|
||||||
|
| $ | 4 | 5 | 6 | . | + | * | 4 | 5 | 6 | . | PageUp |
|
||||||
|
|----------`------`------`------`------`------`------`------`------`------`------`--------|
|
||||||
|
| = | 7 | 8 | 9 | 0 | - | / | 1 | 2 | 3 | Up |PageDn |
|
||||||
|
|-----------`------`------`------`------`-----'-------`------`------`------`------`-------|
|
||||||
|
| Brite | | | Home | End | | Left | Down | Right |
|
||||||
|
`-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------'
|
||||||
|
```
|
||||||
|
|
||||||
|
### Raise
|
||||||
|
|
||||||
|
As a developer, it makes the most sense for me to group all the commonly-used symbols that don't fit on the main layer. In particular, having the dual-column of parens-braces-brackets helps me keep them straight. I've dropped basic media controls onto this layer as well.
|
||||||
|
|
||||||
|
```
|
||||||
|
,---------+------+------+------+------+------+------+------+------+------+------+---------.
|
||||||
|
| ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
|
||||||
|
|---------`------`------`------`------`------`------`------`------`------`------`---------|
|
||||||
|
| F1 | F2 | F3 | F4 | F5 | F6 | _ | ? | + | { | } | | |
|
||||||
|
|----------`------`------`------`------`------`------`------`------`------`------`--------|
|
||||||
|
| F7 | F8 | F9 | F10 | F11 | F12 | - | / | = | [ | ] | \ |
|
||||||
|
|-----------`------`------`------`------`-----'-------`------`------`------`------`-------|
|
||||||
|
| Brite | | | Play | Next | | Mute | Vol- | Vol+ |
|
||||||
|
`-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------'
|
||||||
|
```
|
||||||
|
|
||||||
|
### Adjust (Lower + Raise)
|
||||||
|
|
||||||
|
Utility layer. There isn't much here; it's mainly for swapping the default keymap between Qwerty and Dvorak, or putting the keyboard into flash mode via the Reset key.
|
||||||
|
|
||||||
|
```
|
||||||
|
,---------+------+------+------+------+------+------+------+------+------+------+---------.
|
||||||
|
| | Reset| | | | | | | | | | Del |
|
||||||
|
|---------`------`------`------`------`------`------`------`------`------`------`---------|
|
||||||
|
| | | | | |AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
|
||||||
|
|----------`------`------`------`------`------`------`------`------`------`------`--------|
|
||||||
|
| | | | | | | | | | | | |
|
||||||
|
|-----------`------`------`------`------`-----'-------`------`------`------`------`-------|
|
||||||
|
| | | | | | | | | |
|
||||||
|
`-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------'
|
||||||
|
```
|
@ -0,0 +1,134 @@
|
|||||||
|
#include "process_combo.h"
|
||||||
|
#include "print.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define COMBO_TIMER_ELAPSED -1
|
||||||
|
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
combo_t key_combos[] = {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void process_combo_event(uint8_t combo_index, bool pressed) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static uint8_t current_combo_index = 0;
|
||||||
|
|
||||||
|
static inline void send_combo(uint16_t action, bool pressed)
|
||||||
|
{
|
||||||
|
if (action) {
|
||||||
|
if (pressed) {
|
||||||
|
register_code16(action);
|
||||||
|
} else {
|
||||||
|
unregister_code16(action);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
process_combo_event(current_combo_index, pressed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#define ALL_COMBO_KEYS_ARE_DOWN (((1<<count)-1) == combo->state)
|
||||||
|
#define NO_COMBO_KEYS_ARE_DOWN (0 == combo->state)
|
||||||
|
#define KEY_STATE_DOWN(key) do{ combo->state |= (1<<key); } while(0)
|
||||||
|
#define KEY_STATE_UP(key) do{ combo->state &= ~(1<<key); } while(0)
|
||||||
|
static bool process_single_combo(combo_t *combo, uint16_t keycode, keyrecord_t *record)
|
||||||
|
{
|
||||||
|
uint8_t count = 0;
|
||||||
|
uint8_t index = -1;
|
||||||
|
/* Find index of keycode and number of combo keys */
|
||||||
|
for (const uint16_t *keys = combo->keys; ;++count) {
|
||||||
|
uint16_t key = pgm_read_word(&keys[count]);
|
||||||
|
if (keycode == key) index = count;
|
||||||
|
if (COMBO_END == key) break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Return if not a combo key */
|
||||||
|
if (-1 == (int8_t)index) return false;
|
||||||
|
|
||||||
|
/* The combos timer is used to signal whether the combo is active */
|
||||||
|
bool is_combo_active = COMBO_TIMER_ELAPSED == combo->timer ? false : true;
|
||||||
|
|
||||||
|
if (record->event.pressed) {
|
||||||
|
KEY_STATE_DOWN(index);
|
||||||
|
|
||||||
|
if (is_combo_active) {
|
||||||
|
if (ALL_COMBO_KEYS_ARE_DOWN) { /* Combo was pressed */
|
||||||
|
send_combo(combo->keycode, true);
|
||||||
|
combo->timer = COMBO_TIMER_ELAPSED;
|
||||||
|
} else { /* Combo key was pressed */
|
||||||
|
combo->timer = timer_read();
|
||||||
|
#ifdef COMBO_ALLOW_ACTION_KEYS
|
||||||
|
combo->prev_record = *record;
|
||||||
|
#else
|
||||||
|
combo->prev_key = keycode;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (ALL_COMBO_KEYS_ARE_DOWN) { /* Combo was released */
|
||||||
|
send_combo(combo->keycode, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_combo_active) { /* Combo key was tapped */
|
||||||
|
#ifdef COMBO_ALLOW_ACTION_KEYS
|
||||||
|
record->event.pressed = true;
|
||||||
|
process_action(record, store_or_get_action(record->event.pressed, record->event.key));
|
||||||
|
record->event.pressed = false;
|
||||||
|
process_action(record, store_or_get_action(record->event.pressed, record->event.key));
|
||||||
|
#else
|
||||||
|
register_code16(keycode);
|
||||||
|
send_keyboard_report();
|
||||||
|
unregister_code16(keycode);
|
||||||
|
#endif
|
||||||
|
combo->timer = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
KEY_STATE_UP(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (NO_COMBO_KEYS_ARE_DOWN) {
|
||||||
|
combo->timer = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return is_combo_active;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_combo(uint16_t keycode, keyrecord_t *record)
|
||||||
|
{
|
||||||
|
bool is_combo_key = false;
|
||||||
|
|
||||||
|
for (current_combo_index = 0; current_combo_index < COMBO_COUNT; ++current_combo_index) {
|
||||||
|
combo_t *combo = &key_combos[current_combo_index];
|
||||||
|
is_combo_key |= process_single_combo(combo, keycode, record);
|
||||||
|
}
|
||||||
|
|
||||||
|
return !is_combo_key;
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_combo(void)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < COMBO_COUNT; ++i) {
|
||||||
|
combo_t *combo = &key_combos[i];
|
||||||
|
if (combo->timer &&
|
||||||
|
combo->timer != COMBO_TIMER_ELAPSED &&
|
||||||
|
timer_elapsed(combo->timer) > COMBO_TERM) {
|
||||||
|
|
||||||
|
/* This disables the combo, meaning key events for this
|
||||||
|
* combo will be handled by the next processors in the chain
|
||||||
|
*/
|
||||||
|
combo->timer = COMBO_TIMER_ELAPSED;
|
||||||
|
|
||||||
|
#ifdef COMBO_ALLOW_ACTION_KEYS
|
||||||
|
process_action(&combo->prev_record,
|
||||||
|
store_or_get_action(combo->prev_record.event.pressed,
|
||||||
|
combo->prev_record.event.key));
|
||||||
|
#else
|
||||||
|
unregister_code16(combo->prev_key);
|
||||||
|
register_code16(combo->prev_key);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,43 @@
|
|||||||
|
#ifndef PROCESS_COMBO_H
|
||||||
|
#define PROCESS_COMBO_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include "progmem.h"
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
const uint16_t *keys;
|
||||||
|
uint16_t keycode;
|
||||||
|
#ifdef EXTRA_EXTRA_LONG_COMBOS
|
||||||
|
uint32_t state;
|
||||||
|
#elif EXTRA_LONG_COMBOS
|
||||||
|
uint16_t state;
|
||||||
|
#else
|
||||||
|
uint8_t state;
|
||||||
|
#endif
|
||||||
|
uint16_t timer;
|
||||||
|
#ifdef COMBO_ALLOW_ACTION_KEYS
|
||||||
|
keyrecord_t prev_record;
|
||||||
|
#else
|
||||||
|
uint16_t prev_key;
|
||||||
|
#endif
|
||||||
|
} combo_t;
|
||||||
|
|
||||||
|
|
||||||
|
#define COMBO(ck, ca) {.keys = &(ck)[0], .keycode = (ca)}
|
||||||
|
#define COMBO_ACTION(ck) {.keys = &(ck)[0]}
|
||||||
|
|
||||||
|
#define COMBO_END 0
|
||||||
|
#ifndef COMBO_COUNT
|
||||||
|
#define COMBO_COUNT 0
|
||||||
|
#endif
|
||||||
|
#ifndef COMBO_TERM
|
||||||
|
#define COMBO_TERM TAPPING_TERM
|
||||||
|
#endif
|
||||||
|
|
||||||
|
bool process_combo(uint16_t keycode, keyrecord_t *record);
|
||||||
|
void matrix_scan_combo(void);
|
||||||
|
void process_combo_event(uint8_t combo_index, bool pressed);
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,56 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2017 Priyadi Iman Nurcahyo
|
||||||
|
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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "lufa.h"
|
||||||
|
#include "outputselect.h"
|
||||||
|
#ifdef ADAFRUIT_BLE_ENABLE
|
||||||
|
#include "adafruit_ble.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
uint8_t desired_output = OUTPUT_DEFAULT;
|
||||||
|
|
||||||
|
void set_output(uint8_t output) {
|
||||||
|
set_output_user(output);
|
||||||
|
desired_output = output;
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__((weak))
|
||||||
|
void set_output_user(uint8_t output) {
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t auto_detect_output(void) {
|
||||||
|
if (USB_DeviceState == DEVICE_STATE_Configured) {
|
||||||
|
return OUTPUT_USB;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef ADAFRUIT_BLE_ENABLE
|
||||||
|
if (adafruit_ble_is_connected()) {
|
||||||
|
return OUTPUT_ADAFRUIT_BLE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef BLUETOOTH_ENABLE
|
||||||
|
return OUTPUT_BLUETOOTH; // should check if BT is connected here
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return OUTPUT_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t where_to_send(void) {
|
||||||
|
if (desired_output == OUTPUT_AUTO) {
|
||||||
|
return auto_detect_output();
|
||||||
|
}
|
||||||
|
return desired_output;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
TRAVIS_COMMIT_MESSAGE="${TRAVIS_COMMIT_MESSAGE:-none}"
|
||||||
|
TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE:-HEAD~1..HEAD}"
|
||||||
|
|
||||||
|
if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then
|
||||||
|
exit_code=0
|
||||||
|
NEFM=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -Ev '^(keyboards/)' | wc -l)
|
||||||
|
if [[ $NEFM -gt 0 ]] ; then
|
||||||
|
echo "Making all keymaps for all keyboards"
|
||||||
|
make all-keyboards AUTOGEN="true"
|
||||||
|
: $((exit_code = $exit_code + $?))
|
||||||
|
else
|
||||||
|
MKB=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -oP '(?<=keyboards\/)([a-zA-Z0-9_]+)(?=\/)' | sort -u)
|
||||||
|
for KB in $MKB ; do
|
||||||
|
echo "Making all keymaps for $KB"
|
||||||
|
make "$KB" AUTOGEN=true
|
||||||
|
: $((exit_code = $exit_code + $?))
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
exit $exit_code
|
||||||
|
fi
|