@ -0,0 +1,3 @@
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
@ -0,0 +1,30 @@
|
||||
#include "amjpad.h"
|
||||
#include "led.h"
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
// put your keyboard start-up code here
|
||||
// runs once when the firmware starts up
|
||||
matrix_init_user();
|
||||
led_init_ports();
|
||||
};
|
||||
|
||||
void matrix_scan_kb(void) {
|
||||
// put your looping keyboard code here
|
||||
// runs every cycle (a lot)
|
||||
matrix_scan_user();
|
||||
};
|
||||
|
||||
void led_init_ports(void) {
|
||||
// * Set our LED pins as output
|
||||
DDRD |= (1<<6);
|
||||
}
|
||||
|
||||
void led_set_kb(uint8_t usb_led) {
|
||||
if (usb_led & (1<<USB_LED_NUM_LOCK)) {
|
||||
// Turn numlock on
|
||||
PORTD &= ~(1<<6);
|
||||
} else {
|
||||
// Turn numlock off
|
||||
PORTD |= (1<<6);
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
#ifndef AMJPAD_H
|
||||
#define ADMJPAD_H
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
// readability
|
||||
#define XXX KC_NO
|
||||
|
||||
/* AMJPAD matrix layout
|
||||
* ,-------------------.
|
||||
* | 00 | 01 | 02 | 03 |
|
||||
* |----|----|----|----|
|
||||
* | 10 | 11 | 12 | 13 |
|
||||
* |----|----|----|----|
|
||||
* | 20 | 21 | 22 | |
|
||||
* |----|----|----| 23 |
|
||||
* | 30 | 31 | 32 | |
|
||||
* |----|----|----|----|
|
||||
* | 40 | 41 | 42 | |
|
||||
* |----|----|----| 43 |
|
||||
* | 50 | 52 | |
|
||||
* `-------------------'
|
||||
*/
|
||||
// The first section contains all of the arguments
|
||||
// The second converts the arguments into a two-dimensional array
|
||||
#define KEYMAP( \
|
||||
k00, k01, k02, k03, \
|
||||
k10, k11, k12, k13, \
|
||||
k20, k21, k22, k23, \
|
||||
k30, k31, k32, \
|
||||
k40, k41, k42, k43, \
|
||||
k50, k52 \
|
||||
) \
|
||||
{ \
|
||||
{k00, k01, k02, k03}, \
|
||||
{k10, k11, k12, k13}, \
|
||||
{k20, k21, k22, k23}, \
|
||||
{k30, k31, k32, XXX}, \
|
||||
{k40, k41, k42, k43}, \
|
||||
{k50, XXX, k52, XXX} \
|
||||
}
|
||||
|
||||
void matrix_init_user(void);
|
||||
void matrix_scan_user(void);
|
||||
|
||||
#endif
|
@ -0,0 +1,94 @@
|
||||
/*
|
||||
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 0x0003
|
||||
#define MANUFACTURER AMJ
|
||||
#define PRODUCT PAD
|
||||
#define DESCRIPTION QMK keyboard firmware for AMJ PAD
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 6
|
||||
#define MATRIX_COLS 4
|
||||
|
||||
// ROWS: Top to bottom, COLS: Left to right
|
||||
|
||||
#define MATRIX_ROW_PINS { F7, F6, F5, F4, D5, D0 }
|
||||
#define MATRIX_COL_PINS { F1, F0, E6, C7 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
#define BACKLIGHT_PIN B6
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/* define if matrix has ghost */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* 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)) \
|
||||
)
|
||||
|
||||
/* Backlight configuration
|
||||
*/
|
||||
#define BACKLIGHT_LEVELS 4
|
||||
|
||||
/* Underlight configuration
|
||||
*/
|
||||
|
||||
#define RGB_DI_PIN E2
|
||||
#define RGBLIGHT_ANIMATIONS
|
||||
#define RGBLED_NUM 8 // Number of LEDs
|
||||
#define RGBLIGHT_HUE_STEP 10
|
||||
#define RGBLIGHT_SAT_STEP 17
|
||||
#define RGBLIGHT_VAL_STEP 17
|
||||
|
||||
/*
|
||||
* 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,101 @@
|
||||
#include "amjpad.h"
|
||||
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
#include "rgblight.h"
|
||||
#endif
|
||||
|
||||
// Used for SHIFT_ESC
|
||||
#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
|
||||
|
||||
// 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 _BL 0
|
||||
#define _FL 1
|
||||
|
||||
#define _______ KC_TRNS
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap _BL: (Base Layer) Default Layer
|
||||
* ,-------------------.
|
||||
* |Esc |TAB |BS | = |
|
||||
* |----|----|----|----|
|
||||
* | NL | / | * | - |
|
||||
* |----|----|----|----|
|
||||
* | 7 | 8 | 9 | |
|
||||
* |----|----|----| + |
|
||||
* | 4 | 5 | 6 | |
|
||||
* |----|----|----|----|
|
||||
* | 1 | 2 | 3 | |
|
||||
* |----|----|----| En |
|
||||
* | 0 |./FN| |
|
||||
* `-------------------'
|
||||
*/
|
||||
|
||||
[_BL] = KEYMAP(
|
||||
KC_ESC,KC_TAB,KC_BSPC,KC_PEQL, \
|
||||
KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS, \
|
||||
KC_P7, KC_P8, KC_P9, KC_PPLS, \
|
||||
KC_P4, KC_P5, KC_P6, \
|
||||
KC_P1, KC_P2, KC_P3, KC_PENT, \
|
||||
KC_P0, LT(_FL,KC_PDOT)),
|
||||
|
||||
/* Keymap _FL: Function Layer
|
||||
* ,-------------------.
|
||||
* |Esc |TAB |BS | = |
|
||||
* |----|----|----|----|
|
||||
* | NL | / | * | - |
|
||||
* |----|----|----|----|
|
||||
* | 7 | 8 | 9 | |
|
||||
* |----|----|----|RST |
|
||||
* | 4 | 5 | 6 | |
|
||||
* |----|----|----|----|
|
||||
* | 1 | 2 | 3 | |
|
||||
* |----|----|----| En |
|
||||
* | 0 |./FN| |
|
||||
* `-------------------'
|
||||
*/
|
||||
[_FL] = KEYMAP(
|
||||
|
||||
KC_ESC,KC_TAB,KC_BSPC,KC_PEQL, \
|
||||
KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \
|
||||
KC_P7, KC_P8, KC_P9, RESET, \
|
||||
KC_P4, KC_P5, KC_P6, \
|
||||
KC_P1, KC_P2, KC_P3, KC_PENT, \
|
||||
KC_P0, LT(_FL,KC_PDOT)),
|
||||
};
|
||||
|
||||
enum function_id {
|
||||
SHIFT_ESC,
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[0] = ACTION_FUNCTION(SHIFT_ESC),
|
||||
};
|
||||
|
||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
static uint8_t shift_esc_shift_mask;
|
||||
switch (id) {
|
||||
case SHIFT_ESC:
|
||||
shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK;
|
||||
if (record->event.pressed) {
|
||||
if (shift_esc_shift_mask) {
|
||||
add_key(KC_GRV);
|
||||
send_keyboard_report();
|
||||
} else {
|
||||
add_key(KC_ESC);
|
||||
send_keyboard_report();
|
||||
}
|
||||
} else {
|
||||
if (shift_esc_shift_mask) {
|
||||
del_key(KC_GRV);
|
||||
send_keyboard_report();
|
||||
} else {
|
||||
del_key(KC_ESC);
|
||||
send_keyboard_report();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
|
||||
# MCU name
|
||||
#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
|
||||
|
||||
|
||||
#
|
||||
# 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
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= no # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
RGBLIGHT_ENABLE ?= no # Enable keyboard underlight functionality (+4870)
|
||||
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality (+1150)
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
AUDIO_ENABLE ?= no
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
Before Width: | Height: | Size: 74 KiB |
After Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 90 KiB |
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 90 KiB |
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 73 KiB |
@ -0,0 +1,5 @@
|
||||
TAP_DANCE_ENABLE = yes
|
||||
NKRO_ENABLE = true
|
||||
MOUSEKEY_ENABLE = no
|
||||
EXTRAKEY_ENABLE = yes
|
||||
CONSOLE_ENABLE = no
|
@ -0,0 +1,58 @@
|
||||
<!-- -*- mode: markdown; fill-column: 8192 -*- -->
|
||||
|
||||
Mnemes Swedish Bonanza
|
||||
=======================
|
||||
|
||||
My Layout in process, most of the code is shamelessly stolen from [algernons][algernon] excellent layout
|
||||
|
||||
[algernon]: https://github.com/algernon/ergodox-layout
|
||||
|
||||
It's for Windows (current work forces me to) and Swedish (matter of birth) so ymmw.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
* [Layouts](#layouts)
|
||||
- [Base layer](#base-layer)
|
||||
- [Nav layer](#nav-layer)
|
||||
- [Sym layer](#sym-layer)
|
||||
- [LED states](#led-states)
|
||||
|
||||
# Layouts
|
||||
|
||||
## Base layer
|
||||
|
||||
![Base layer](img/base.png)
|
||||
|
||||
|
||||
* The number row doubles as a function row. Short presses produces numbers, long presses produces Fxx
|
||||
* The `Shift`, `Alt`, and `Control` modifiers are one-shot.
|
||||
* `Backspace` and `Enter` doubles as switches to the `sym` layer when held
|
||||
* The `ESC` key also doubles as a one-shot cancel key.
|
||||
* The **Lead** key is followed by a sequence of keys.
|
||||
- `LEAD l` : `lgui+l`.
|
||||
- `LEAD s l` : `λ`.
|
||||
- `LEAD s s` : `¯\_(ツ)_/¯`
|
||||
- `LEAD s f` : `凸(ツ)凸`
|
||||
- `LEAD u l` : Set unicode input mode to linux.
|
||||
- `LEAD s w` : Set unicode input mode to windows.
|
||||
- `LEAD a *` : Application switching based on position in start menu. Very specific to my computer.
|
||||
|
||||
|
||||
## Nav layer
|
||||
|
||||
![Nav layer](img/fun.png)
|
||||
|
||||
Basic navigation on the right hand and modifiers close
|
||||
by for the left. The latter because I tend to use `ctrl+arrows` quite a lot.
|
||||
|
||||
## Sym layer
|
||||
|
||||
![Sym layer](img/sym.png)
|
||||
|
||||
* Easy access to most symbols I use on a daily basis. Most common are on the home row, the rest are grouped as best as I could.
|
||||
|
||||
- `eq` : Tapdance, produces `===` and `!==`
|
||||
- `fun`: Tapdance, produces `=>` and `() => {\n`
|
||||
|
||||
# License
|
||||
GPL-3+
|
@ -0,0 +1,7 @@
|
||||
#define ONESHOT_TIMEOUT 3000
|
||||
#define TAPPING_TERM 200
|
||||
#define PREVENT_STUCK_MODIFIERS
|
||||
#define FORCE_NKRO
|
||||
#define LEADER_TIMEOUT 1000
|
||||
|
||||
#include "../../config.h"
|
After Width: | Height: | Size: 446 KiB |
After Width: | Height: | Size: 415 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,226 @@
|
||||
#include "ergodox.h"
|
||||
#include "debug.h"
|
||||
#include "action_layer.h"
|
||||
#include "version.h"
|
||||
|
||||
#define BASE 0 // default layer
|
||||
#define SYMB 1 // symbols
|
||||
#define MDIA 2 // media keys
|
||||
|
||||
enum custom_keycodes {
|
||||
PLACEHOLDER = SAFE_RANGE, // can always be here
|
||||
EPRM,
|
||||
VRSN,
|
||||
RGB_SLD
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap 0: Basic layer
|
||||
*
|
||||
* ,--------------------------------------------------------. ,--------------------------------------------------------.
|
||||
* | = | 1 | 2 | 3 | 4 | 5 | Cmd,Shft,[ | | Cmd,Shft,] | 6 | 7 | 8 | 9 | 0 | - |
|
||||
* |--------+------+------+------+------+-------------------| |------------+------+------+------+------+------+--------|
|
||||
* | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* |BkSp/Cmd| A | S | D | F | G |------------| |------------| H | J | K | L |; / L2|' / Cmd |
|
||||
* |--------+------+------+------+------+------| Hyper | | Meh |------+------+------+------+------+--------|
|
||||
* | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift |
|
||||
* `--------+------+------+------+------+-------------------' `-------------+------+------+------+------+--------'
|
||||
* |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* |Ctrl/Esc|PgUp| | App | LGui |
|
||||
* ,------|------|------| |------+--------+------.
|
||||
* | | | PgDn | | Home | | |
|
||||
* | Space|Backsp|------| |------| Tab |Enter |
|
||||
* | |ace | Esc | | Alt | | |
|
||||
* `--------------------' `----------------------'
|
||||
*/
|
||||
// If it accepts an argument (i.e, is a function), it doesn't need KC_.
|
||||
// Otherwise, it needs KC_*
|
||||
[BASE] = KEYMAP( // layer 0 : default
|
||||
// left hand
|
||||
KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, M(2),
|
||||
KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB),
|
||||
GUI_T(KC_BSPC), KC_A, KC_S, KC_D, KC_F, KC_G,
|
||||
KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO),
|
||||
LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT,
|
||||
CTL_T(KC_ESC),KC_PGUP,
|
||||
KC_PGDN,
|
||||
KC_SPC,KC_BSPC, KC_ESC,
|
||||
// right hand
|
||||
M(3), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
|
||||
TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
|
||||
KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT),
|
||||
MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT,
|
||||
KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1,
|
||||
|
||||
ALT_T(KC_APP), KC_LGUI,
|
||||
KC_HOME,
|
||||
KC_LALT,KC_TAB, KC_ENT
|
||||
),
|
||||
/* Keymap 1: Symbol Layer
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | % | ^ | [ | ] | ~ | | | | <- | 1 | 2 | 3 | \ | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | | | | | . | 0 | = | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* | | |------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// SYMBOLS
|
||||
[SYMB] = KEYMAP(
|
||||
// left hand
|
||||
KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
|
||||
KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS,
|
||||
KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV,
|
||||
KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,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_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12,
|
||||
KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS,
|
||||
KC_TRNS, M(1), KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS,
|
||||
KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS
|
||||
),
|
||||
// KC_COMM, KC_MINS
|
||||
|
||||
/* Keymap 2: Media and mouse keys
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | | | MsUp | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | | Prev | Next | | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | |Brwser|
|
||||
* | | |------| |------| |Back |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// MEDIA AND MOUSE
|
||||
[MDIA] = KEYMAP(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
// right hand
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS,
|
||||
KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_WBAK
|
||||
),
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols)
|
||||
};
|
||||
|
||||
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) {
|
||||
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (record->event.pressed) { // For resetting EEPROM
|
||||
eeconfig_init();
|
||||
}
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
// dynamically generate these.
|
||||
case EPRM:
|
||||
if (record->event.pressed) {
|
||||
eeconfig_init();
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case VRSN:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case RGB_SLD:
|
||||
if (record->event.pressed) {
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
rgblight_mode(1);
|
||||
#endif
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Runs just one time when the keyboard initializes.
|
||||
void matrix_init_user(void) {
|
||||
|
||||
};
|
||||
|
||||
|
||||
// Runs constantly in the background, in a loop.
|
||||
void matrix_scan_user(void) {
|
||||
|
||||
uint8_t layer = biton32(layer_state);
|
||||
|
||||
ergodox_board_led_off();
|
||||
ergodox_right_led_1_off();
|
||||
ergodox_right_led_2_off();
|
||||
ergodox_right_led_3_off();
|
||||
switch (layer) {
|
||||
// TODO: Make this relevant to the ErgoDox EZ.
|
||||
case 1:
|
||||
ergodox_right_led_1_on();
|
||||
break;
|
||||
case 2:
|
||||
ergodox_right_led_2_on();
|
||||
break;
|
||||
default:
|
||||
// none
|
||||
break;
|
||||
}
|
||||
|
||||
};
|
@ -0,0 +1,6 @@
|
||||
SUBPROJECT_DEFAULT = ez
|
||||
TAP_DANCE_ENABLE = yes
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
@ -0,0 +1,216 @@
|
||||
#include "ergodox.h"
|
||||
#include "debug.h"
|
||||
#include "action_layer.h"
|
||||
#include "version.h"
|
||||
|
||||
#define BASE 0 // default layer
|
||||
#define SYMB 1 // symbols
|
||||
#define MDIA 2 // media keys
|
||||
|
||||
//Tap Dance Declarations
|
||||
enum {
|
||||
TD_U_LBRC = 0,
|
||||
TD_I_RBRC,
|
||||
};
|
||||
|
||||
//Tap Dance Definitions
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
[TD_U_LBRC] = ACTION_TAP_DANCE_DOUBLE(KC_U, KC_LBRC),
|
||||
[TD_I_RBRC] = ACTION_TAP_DANCE_DOUBLE(KC_I, KC_RBRC)
|
||||
};
|
||||
|
||||
//Macro Declarations
|
||||
static uint16_t sunds_timer;
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap 0: Basic layer
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | _ | x | x | _ | Esc | Hypr | Home | | End | Hypr | [ | ] | `~ | `~ | Bks |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* |Ctrl/Tab| Q | W | E | R | T | Up | | PgUp | Y | U | I | O | P | Ctrl |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | Cmd/"' | A | S | D | F | G |------| |------| H | J | K | L | ;: |Cmd/Entr|
|
||||
* |--------+------+------+------+------+------| Down | | PgDn |------+------+------+------+------+--------|
|
||||
* | Shft | Z | X | C | V | B | | | | N | M | ,< | .> | /? | Shft |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | Alt | x | x | x | Left | |Right | Bks | x | x | Alt |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* |Teensy| VolUp| | Play | Del |
|
||||
* ,------|------|------| |------+--------+------.
|
||||
* | | | VolDn| | Next | | |
|
||||
* |Sp/~L1| L2 |------| |------| L2 |'"/~L1|
|
||||
* | | | Mute | | Prev | | |
|
||||
* `--------------------' `----------------------'
|
||||
*/
|
||||
[BASE] = KEYMAP( // layer 0 : default
|
||||
// left hand
|
||||
KC_UNDS, KC_1, KC_1, KC_UNDS, KC_ESC, ALL_T(KC_NO), KC_HOME,
|
||||
CTL_T(KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_UP,
|
||||
M(1), KC_A, KC_S, KC_D, KC_F, KC_G,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_DOWN,
|
||||
KC_LALT, KC_1, KC_1, KC_1, KC_LEFT,
|
||||
RESET, KC_VOLU,
|
||||
KC_VOLD,
|
||||
LT(SYMB, KC_SPC), TG(MDIA), KC_MUTE,
|
||||
// right hand
|
||||
KC_END, ALL_T(KC_NO), KC_LBRC, KC_RBRC, KC_GRV, KC_GRV, KC_BSPC,
|
||||
KC_PGUP, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LCTRL,
|
||||
KC_H, KC_J, KC_K, KC_L, KC_SCOLON, GUI_T(KC_ENT),
|
||||
KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
|
||||
KC_RGHT, KC_BSPC, KC_1, KC_1, KC_RALT,
|
||||
KC_MPLY, KC_DEL,
|
||||
KC_MNXT,
|
||||
KC_MPRV, TG(MDIA), LT(SYMB, KC_QUOT)
|
||||
),
|
||||
/* Keymap 1: Symbol Layer
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | ! | ^ | [ | ( | { | | | | = | 7 | 8 | 9 | 0 | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | & | $ | ] | ) | } |------| |------| + | 4 | 5 | 6 | * | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | \ | @ | # | % | | | | | | - | 1 | 2 | 3 | / | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | | | | 0 | 0 | . | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* | | |------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// SYMBOLS
|
||||
[SYMB] = KEYMAP(
|
||||
// left hand
|
||||
KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
|
||||
KC_TRNS, KC_EXLM, KC_CIRC, KC_LBRC, KC_LPRN, KC_LCBR, KC_TRNS,
|
||||
KC_TRNS, KC_AMPR, KC_DLR, KC_RBRC, KC_RPRN, KC_RCBR,
|
||||
KC_TRNS, KC_BSLS, KC_AT, KC_HASH, KC_PERC, KC_PIPE, 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_TRNS,
|
||||
KC_TRNS, KC_EQL, KC_7, KC_8, KC_9, KC_0, KC_TRNS,
|
||||
KC_PLUS, KC_4, KC_5, KC_6, KC_ASTR, KC_TRNS,
|
||||
KC_TRNS, KC_MINS, KC_1, KC_2, KC_3, KC_TRNS, KC_TRNS,
|
||||
KC_0, KC_0, KC_DOT, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS
|
||||
),
|
||||
/* Keymap 2: Media and mouse keys
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* |Version | | | | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | WhDn | WhUp | | | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | | | R-Ck | L-Ck | |------| |------| MsLt | MsDn | MsUp | MsRt | | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | | | | | | | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | |Brwser|
|
||||
* | | |------| |------| |Back |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// MEDIA AND MOUSE
|
||||
[MDIA] = KEYMAP(
|
||||
M(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN2, KC_BTN1, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
// right hand
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_WH_U, KC_WH_D, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_MS_LEFT, KC_MS_DOWN, KC_MS_UP, KC_MS_RIGHT, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_WBAK
|
||||
),
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols)
|
||||
};
|
||||
|
||||
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) {
|
||||
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if (record->event.pressed) {
|
||||
sunds_timer = timer_read();
|
||||
register_code (KC_LGUI);
|
||||
} else {
|
||||
if (timer_elapsed (sunds_timer) < TAPPING_TERM) {
|
||||
unregister_code (KC_LGUI);
|
||||
register_code (KC_LSFT);
|
||||
register_code (KC_QUOT);
|
||||
unregister_code (KC_QUOT);
|
||||
unregister_code (KC_LSFT);
|
||||
register_code (KC_LGUI);
|
||||
}
|
||||
unregister_code (KC_LGUI);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
// Runs just one time when the keyboard initializes.
|
||||
void matrix_init_user(void) {
|
||||
|
||||
};
|
||||
|
||||
// Runs constantly in the background, in a loop.
|
||||
void matrix_scan_user(void) {
|
||||
|
||||
uint8_t layer = biton32(layer_state);
|
||||
|
||||
ergodox_board_led_off();
|
||||
ergodox_right_led_1_off();
|
||||
ergodox_right_led_2_off();
|
||||
ergodox_right_led_3_off();
|
||||
switch (layer) {
|
||||
// TODO: Make this relevant to the ErgoDox EZ.
|
||||
case 1:
|
||||
ergodox_right_led_3_on();
|
||||
break;
|
||||
case 2:
|
||||
ergodox_right_led_2_on();
|
||||
break;
|
||||
default:
|
||||
// none
|
||||
break;
|
||||
}
|
||||
if (keyboard_report->mods & MOD_BIT(KC_LSFT)) {
|
||||
ergodox_right_led_1_on ();
|
||||
}
|
||||
};
|
@ -0,0 +1 @@
|
||||
UNICODE_ENABLE = yes
|
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 58 KiB |
@ -0,0 +1,517 @@
|
||||
#include "ergodox.h"
|
||||
#include "debug.h"
|
||||
#include "action_layer.h"
|
||||
#include "version.h"
|
||||
|
||||
#define BASE 0 // default layer
|
||||
#define SYMB 1 // symbols
|
||||
#define MDIA 2 // media keys
|
||||
#define NAVG 3 // navigation
|
||||
|
||||
enum macros {
|
||||
RUN
|
||||
};
|
||||
|
||||
enum function_ids {
|
||||
EMOJI,
|
||||
EMOJI2,
|
||||
EPRM,
|
||||
VRSN,
|
||||
RGB_SLD,
|
||||
GO_GROUP
|
||||
};
|
||||
|
||||
/* opt can only be 0-15 */
|
||||
enum emojis {
|
||||
SHRUG,
|
||||
YAY,
|
||||
HUG,
|
||||
SMILE,
|
||||
SMILE2,
|
||||
HMM1,
|
||||
HMM2,
|
||||
BEAR1,
|
||||
BEAR2,
|
||||
FUU,
|
||||
EGGY1,
|
||||
EGGY2,
|
||||
FACE1,
|
||||
FACE2,
|
||||
UHU,
|
||||
SMRK1
|
||||
};
|
||||
|
||||
enum emojis2 {
|
||||
SMRK2,
|
||||
LOVE
|
||||
};
|
||||
|
||||
enum progmem_ids {
|
||||
EMOJI_SHRUG,
|
||||
EMOJI_YAY,
|
||||
EMOJI_HUG,
|
||||
EMOJI_SMILE,
|
||||
EMOJI_SMILE2,
|
||||
EMOJI_HMM1,
|
||||
EMOJI_HMM2,
|
||||
EMOJI_BEAR1,
|
||||
EMOJI_BEAR2,
|
||||
EMOJI_FUU,
|
||||
EMOJI_EGGY1,
|
||||
EMOJI_EGGY2,
|
||||
EMOJI_FACE1,
|
||||
EMOJI_FACE2,
|
||||
EMOJI_UHU,
|
||||
EMOJI_SMRK1,
|
||||
EMOJI_SMRK2,
|
||||
EMOJI_LOVE,
|
||||
F_EPRM,
|
||||
F_VRSN,
|
||||
F_RGB_SLD,
|
||||
I3_GO_GROUP_10,
|
||||
I3_GO_GROUP_1,
|
||||
I3_GO_GROUP_2,
|
||||
I3_GO_GROUP_3,
|
||||
I3_GO_GROUP_4,
|
||||
I3_GO_GROUP_5,
|
||||
I3_GO_GROUP_6,
|
||||
I3_GO_GROUP_7,
|
||||
I3_GO_GROUP_8,
|
||||
I3_GO_GROUP_9,
|
||||
};
|
||||
|
||||
// TODO: Finish the macros for i3 (Macros should potentially be own function instead to make things easier? some of them at least, f. ex. the ones that use 1-0 keys so we can have a single switch)
|
||||
|
||||
// TODO: Do stuff with hyper and meh keys
|
||||
// TODO: Add macros for lots of stuff. (Lastpass cli, pushbullet cli, other push service cli, linode cli, more?)
|
||||
// TODO: Make macros for gnu screen and i3wm
|
||||
// TODO: Need to change hotkeys for lastpass, and potentially make my own keys for them on one of my layers
|
||||
// TODO: Look into using tap dance
|
||||
// TODO: Use leader key for stuff. See https://github.com/qmk/qmk_firmware/wiki
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap 0: Basic layer
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | Esc/L3 | 1 | 2 | 3 | 4 | 5 | 6 | | 6 | 7 | 8 | 9 | 0 | - | =/L3 |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | Tab/L1 | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \/L1 |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | LCtrl | A | S | D | F | G |------| |------| H | J | K | L |; / L2| ctrl/'|
|
||||
* |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------|
|
||||
* | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* |Grv/L1| UNI |AltShf| Lalt | Ralt | | Lalt | Ralt | LEAD | UNI | ~/L1 |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | App | Home | | PgUp | Ins |
|
||||
* ,------|------|------| |------+--------+------.
|
||||
* | | | End | | PgDn | | |
|
||||
* | Space| TAB |------| |------| BSPC |Enter |
|
||||
* | | | [ | | ] | | |
|
||||
* `--------------------' `----------------------'
|
||||
*/
|
||||
// If it accepts an argument (i.e, is a function), it doesn't need KC_.
|
||||
// Otherwise, it needs KC_*
|
||||
[BASE] = KEYMAP( // layer 0 : default
|
||||
// left hand
|
||||
LT(NAVG,KC_ESC), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6,
|
||||
LT(SYMB,KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB),
|
||||
KC_LCTL, LT(MDIA, KC_A), KC_S, KC_D, KC_F, KC_G,
|
||||
KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO),
|
||||
LT(SYMB,KC_GRV),LCTL(LSFT(KC_U)), LALT(KC_LSFT), KC_RALT,KC_LALT,
|
||||
ALT_T(KC_APP), KC_HOME,
|
||||
KC_END,
|
||||
KC_SPC,KC_TAB,KC_LBRC,
|
||||
// right hand
|
||||
KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, LT(NAVG,KC_EQL),
|
||||
TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, LT(SYMB, KC_BSLS),
|
||||
KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),CTL_T(KC_QUOT),
|
||||
MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT,
|
||||
KC_LALT, KC_RALT,KC_LEAD,LCTL(LSFT(KC_U)), LT(SYMB,KC_TILD),
|
||||
KC_PGUP, KC_INS,
|
||||
KC_PGDN,
|
||||
KC_RBRC,KC_BSPC, KC_ENT
|
||||
),
|
||||
/* Keymap 1: Symbol Layer LCTL(LSFT(KC_U))
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | F1 | F2 | F3 | F4 | F5 | F6 | | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | | | | | . | 0 | = | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* |Toggle|Animat| | Hue+ | Hue- |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* |Bright|Bright|Solid | | | | |
|
||||
* |ness- |ness+ |------| |------| DEL | |
|
||||
* | | | | | EPRM | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// SYMBOLS
|
||||
[SYMB] = KEYMAP(
|
||||
// left hand
|
||||
KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6,
|
||||
KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS,
|
||||
KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV,
|
||||
KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
RGB_TOG,RGB_MOD,
|
||||
F(F_RGB_SLD),
|
||||
RGB_VAD,RGB_VAI,KC_TRNS,
|
||||
// right hand
|
||||
KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
|
||||
KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_TRNS,
|
||||
KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS,
|
||||
KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS,
|
||||
KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS,
|
||||
RGB_HUD, RGB_HUI,
|
||||
KC_TRNS,
|
||||
F(F_EPRM), KC_DEL, KC_TRNS
|
||||
),
|
||||
/* Keymap 2: Media, mouse and navigation
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | gg(1)| | | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | | | MsUp | RUN | | | | | | | Up | | | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | |MsLeft|MsDown|MsRght| |------| |------| | Left | Down | Right| | Play |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | | Prev | Next | | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | |Brwser|
|
||||
* | | |------| |------| |Back |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// MEDIA , MOUSE and NAVIGATION
|
||||
[MDIA] = KEYMAP(
|
||||
KC_TRNS, F(I3_GO_GROUP_1), F(I3_GO_GROUP_2), F(I3_GO_GROUP_3), F(I3_GO_GROUP_4), F(I3_GO_GROUP_5), F(I3_GO_GROUP_6),
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, M(RUN), KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
// right hand
|
||||
F(I3_GO_GROUP_6), F(I3_GO_GROUP_7), F(I3_GO_GROUP_8), F(I3_GO_GROUP_9), F(I3_GO_GROUP_10), KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_MPLY,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS,
|
||||
KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_WBAK
|
||||
),
|
||||
|
||||
/* Keymap 3: Unicode
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | ┌ | ┐ | └ | ┘ | │ | ─ | | ╔ | ╗ | ╚ | ╝ | ║ | ═ | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | shrug| yay | hug | smile|smile2| | | | ■ | λ | → | ➙ | ▻ | █ |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | hmm1 | hmm2 | bear1| bear2| fuu |------| |------| ☺ | ☻ | ☹ | ♡ | ♥ | ░ |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | eggy1| eggy2| face1| face2| uhu | | | | ❤ | ☐ | ☑ | ☒ | ✓ | ▄ |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | smrk1| smrk2| love | VER | | ✔ | ✗ | ✘ | ● | ▀ |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | ▒ | ▓ |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* | | |------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// Unicode
|
||||
[NAVG] = KEYMAP(
|
||||
KC_TRNS, UC(0x250c), UC(0x2510), UC(0x2514), UC(0x2518), UC(0x2502), UC(0x2500),
|
||||
KC_TRNS, F(EMOJI_SHRUG), F(EMOJI_YAY), F(EMOJI_HUG), F(EMOJI_SMILE), F(EMOJI_SMILE2), KC_TRNS,
|
||||
KC_TRNS, F(EMOJI_HMM1), F(EMOJI_HMM2), F(EMOJI_BEAR1), F(EMOJI_BEAR2), F(EMOJI_FUU),
|
||||
KC_TRNS, F(EMOJI_EGGY1), F(EMOJI_EGGY2), F(EMOJI_FACE1), F(EMOJI_FACE2), F(EMOJI_UHU), KC_TRNS,
|
||||
KC_TRNS, F(EMOJI_SMRK1), F(EMOJI_SMRK2), F(EMOJI_LOVE), F(F_VRSN),
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
// right hand
|
||||
UC(0x2554), UC(0x2557), UC(0x255a), UC(0x255d), UC(0x2551), UC(0x2550), KC_TRNS,
|
||||
KC_TRNS, UC(0x25a0), UC(0x03bb), UC(0x2192), UC(0x2799), UC(0x25bb), UC(0x2588),
|
||||
UC(0x263a), UC(0x263b), UC(0x2639), UC(0x2661), UC(0x2665), UC(0x2591),
|
||||
KC_TRNS, UC(0x2764), UC(0x2610), UC(0x2611), UC(0x2612), UC(0x2713), UC(0x2584),
|
||||
UC(0x2714), UC(0x2717), UC(0x2718), UC(0x25cf), UC(0x2580),
|
||||
UC(0x2592), UC(0x2593),
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS
|
||||
),
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[EMOJI_SHRUG] = ACTION_FUNCTION_OPT(EMOJI, SHRUG),
|
||||
[EMOJI_YAY] = ACTION_FUNCTION_OPT(EMOJI, YAY),
|
||||
[EMOJI_HUG] = ACTION_FUNCTION_OPT(EMOJI,HUG),
|
||||
[EMOJI_SMILE] = ACTION_FUNCTION_OPT(EMOJI,SMILE),
|
||||
[EMOJI_SMILE2] = ACTION_FUNCTION_OPT(EMOJI,SMILE2),
|
||||
[EMOJI_HMM1] = ACTION_FUNCTION_OPT(EMOJI,HMM1),
|
||||
[EMOJI_HMM2] = ACTION_FUNCTION_OPT(EMOJI,HMM2),
|
||||
[EMOJI_BEAR1] = ACTION_FUNCTION_OPT(EMOJI,BEAR1),
|
||||
[EMOJI_BEAR2] = ACTION_FUNCTION_OPT(EMOJI,BEAR2),
|
||||
[EMOJI_FUU] = ACTION_FUNCTION_OPT(EMOJI,FUU),
|
||||
[EMOJI_EGGY1] = ACTION_FUNCTION_OPT(EMOJI,EGGY1),
|
||||
[EMOJI_EGGY2] = ACTION_FUNCTION_OPT(EMOJI,EGGY2),
|
||||
[EMOJI_FACE1] = ACTION_FUNCTION_OPT(EMOJI,FACE1),
|
||||
[EMOJI_FACE2] = ACTION_FUNCTION_OPT(EMOJI,FACE2),
|
||||
[EMOJI_UHU] = ACTION_FUNCTION_OPT(EMOJI,UHU),
|
||||
[EMOJI_SMRK1] = ACTION_FUNCTION_OPT(EMOJI,SMRK1),
|
||||
[EMOJI_SMRK2] = ACTION_FUNCTION_OPT(EMOJI2,SMRK2),
|
||||
[EMOJI_LOVE] = ACTION_FUNCTION_OPT(EMOJI2,LOVE),
|
||||
[F_EPRM] = ACTION_FUNCTION(EPRM),
|
||||
[F_VRSN] = ACTION_FUNCTION(VRSN),
|
||||
[F_RGB_SLD] = ACTION_FUNCTION(RGB_SLD),
|
||||
[I3_GO_GROUP_10]= ACTION_FUNCTION_OPT(GO_GROUP,0),
|
||||
[I3_GO_GROUP_1] = ACTION_FUNCTION_OPT(GO_GROUP,1),
|
||||
[I3_GO_GROUP_2] = ACTION_FUNCTION_OPT(GO_GROUP,2),
|
||||
[I3_GO_GROUP_3] = ACTION_FUNCTION_OPT(GO_GROUP,3),
|
||||
[I3_GO_GROUP_4] = ACTION_FUNCTION_OPT(GO_GROUP,4),
|
||||
[I3_GO_GROUP_5] = ACTION_FUNCTION_OPT(GO_GROUP,5),
|
||||
[I3_GO_GROUP_6] = ACTION_FUNCTION_OPT(GO_GROUP,6),
|
||||
[I3_GO_GROUP_7] = ACTION_FUNCTION_OPT(GO_GROUP,7),
|
||||
[I3_GO_GROUP_8] = ACTION_FUNCTION_OPT(GO_GROUP,8),
|
||||
[I3_GO_GROUP_9] = ACTION_FUNCTION_OPT(GO_GROUP,9),
|
||||
};
|
||||
|
||||
#define TAP_ONCE(code) \
|
||||
register_code (code); \
|
||||
unregister_code (code)
|
||||
|
||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
if (record->event.pressed) {
|
||||
switch(id) {
|
||||
case EPRM:
|
||||
eeconfig_init();
|
||||
break;
|
||||
case VRSN:
|
||||
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
|
||||
break;
|
||||
case RGB_SLD:
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
rgblight_mode(1);
|
||||
#endif
|
||||
break;
|
||||
case GO_GROUP:
|
||||
register_code(KC_LCTL); TAP_ONCE(KC_I); unregister_code(KC_LCTL);
|
||||
TAP_ONCE(KC_G);
|
||||
if (opt == 0) {
|
||||
TAP_ONCE(39);
|
||||
} else {
|
||||
TAP_ONCE(29+opt);
|
||||
}
|
||||
break;
|
||||
case EMOJI:
|
||||
switch(opt) {
|
||||
case SHRUG:
|
||||
unicode_input_start(); register_hex(0xaf); unicode_input_finish();
|
||||
TAP_ONCE (KC_BSLS);
|
||||
register_code (KC_RSFT); TAP_ONCE (KC_MINS); TAP_ONCE (KC_9); unregister_code (KC_RSFT);
|
||||
unicode_input_start (); register_hex(0x30c4); unicode_input_finish();
|
||||
register_code (KC_RSFT); TAP_ONCE (KC_0); TAP_ONCE (KC_MINS); unregister_code (KC_RSFT);
|
||||
TAP_ONCE (KC_SLSH);
|
||||
unicode_input_start (); register_hex(0xaf); unicode_input_finish();
|
||||
break;
|
||||
case YAY:
|
||||
SEND_STRING ("\\o/");
|
||||
break;
|
||||
case HUG:
|
||||
unicode_input_start(); register_hex(0x0f3c); unicode_input_finish();
|
||||
TAP_ONCE (KC_SPC);
|
||||
unicode_input_start(); register_hex(0x3064); unicode_input_finish();
|
||||
TAP_ONCE (KC_SPC);
|
||||
unicode_input_start(); register_hex(0x25d5); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x005f); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x25d5); unicode_input_finish();
|
||||
TAP_ONCE (KC_SPC);
|
||||
unicode_input_start(); register_hex(0x0f3d); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x3064); unicode_input_finish();
|
||||
break;
|
||||
case SMILE:
|
||||
unicode_input_start(); register_hex(0x0298); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x203f); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x0298); unicode_input_finish();
|
||||
break;
|
||||
case SMILE2:
|
||||
unicode_input_start(); register_hex(0x0028); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x0298); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x203f); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x0298); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x0029); unicode_input_finish();
|
||||
break;
|
||||
case HMM1:
|
||||
unicode_input_start(); register_hex(0x0ca0); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x005f); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x0ca0); unicode_input_finish();
|
||||
break;
|
||||
case HMM2:
|
||||
unicode_input_start(); register_hex(0x0028); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x0ca0); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x005f); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x0ca0); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x0029); unicode_input_finish();
|
||||
break;
|
||||
case BEAR1:
|
||||
unicode_input_start(); register_hex(0x0295); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x2022); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x1d25); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x2022); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x0294); unicode_input_finish();
|
||||
break;
|
||||
case BEAR2:
|
||||
unicode_input_start(); register_hex(0x0028); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x1d54); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x1d25); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x1d54); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x0029); unicode_input_finish();
|
||||
break;
|
||||
case FUU:
|
||||
unicode_input_start(); register_hex(0x256d); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x2229); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x256e); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x0028); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x002d); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x005f); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x002d); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x0029); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x256d); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x2229); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x256e); unicode_input_finish();
|
||||
break;
|
||||
case EGGY1:
|
||||
unicode_input_start(); register_hex(0x0028); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x256f); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x00b0); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x25a1); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x00b0); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0xff09); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x256f); unicode_input_finish();
|
||||
break;
|
||||
case EGGY2:
|
||||
unicode_input_start(); register_hex(0x30ce); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x0028); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x0020); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x309c); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x002d); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x309c); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x30ce); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x0029); unicode_input_finish();
|
||||
break;
|
||||
case FACE1:
|
||||
unicode_input_start(); register_hex(0x0028); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x002d); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x005f); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x002d); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x0029); unicode_input_finish();
|
||||
break;
|
||||
case FACE2:
|
||||
unicode_input_start(); register_hex(0x0028); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x2022); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x005f); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x2022); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x0029); unicode_input_finish();
|
||||
break;
|
||||
case UHU:
|
||||
unicode_input_start(); register_hex(0x2299); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0xfe4f); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x2299); unicode_input_finish();
|
||||
break;
|
||||
case SMRK1:
|
||||
unicode_input_start(); register_hex(0x005e); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x032e); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x005e); unicode_input_finish();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case EMOJI2:
|
||||
switch(opt) {
|
||||
case SMRK2:
|
||||
unicode_input_start(); register_hex(0x0028); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x005e); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x032e); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x005e); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x0029); unicode_input_finish();
|
||||
break;
|
||||
case LOVE:
|
||||
unicode_input_start(); register_hex(0x2665); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x203f); unicode_input_finish();
|
||||
unicode_input_start(); register_hex(0x2665); unicode_input_finish();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
if (record->event.pressed) {
|
||||
switch(id) {
|
||||
case RUN:
|
||||
return MACRO( D(LCTL), T(I), U(LCTL), T(R), END );
|
||||
break;
|
||||
}
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
// Runs just one time when the keyboard initializes.
|
||||
void matrix_init_user(void) {
|
||||
set_unicode_input_mode(UC_LNX);
|
||||
};
|
||||
|
||||
// Runs constantly in the background, in a loop.
|
||||
void matrix_scan_user(void) {
|
||||
uint8_t layer = biton32(layer_state);
|
||||
|
||||
ergodox_board_led_off();
|
||||
ergodox_right_led_1_off();
|
||||
ergodox_right_led_2_off();
|
||||
ergodox_right_led_3_off();
|
||||
switch (layer) {
|
||||
case 1:
|
||||
ergodox_right_led_1_on();
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
rgblight_setrgb(0xff,0x00,0x00);
|
||||
#endif
|
||||
break;
|
||||
case 2:
|
||||
ergodox_right_led_2_on();
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
rgblight_setrgb(0x00,0xff,0x00);
|
||||
#endif
|
||||
break;
|
||||
case 3:
|
||||
ergodox_right_led_3_on();
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
rgblight_setrgb(0x00,0x00,0xff);
|
||||
#endif
|
||||
break;
|
||||
case 4:
|
||||
ergodox_right_led_1_on(); // TODO: Make a fourth layer
|
||||
ergodox_right_led_3_on();
|
||||
break;
|
||||
default:
|
||||
// none
|
||||
break;
|
||||
}
|
||||
|
||||
};
|
@ -0,0 +1,72 @@
|
||||
# ErgoDox EZ 1337 configuration
|
||||
|
||||
Custom layout based on the default layout. Intended for interational
|
||||
users of us intl-altgr layout. Note that some common keys might be
|
||||
missing, as this layout is intented to be used on *nix systems by
|
||||
users familiar with their system. The layout is geared towards
|
||||
avoiding using the rat (mouse for those of you who are unfamiliar with
|
||||
tiling window managers) as much as possibly.
|
||||
|
||||
# Layouts
|
||||
|
||||
All layer images created using [keyboard-layout-editor](http://www.keyboard-layout-editor.com/)
|
||||
|
||||
## Base layer
|
||||
|
||||
[![Base layer](images/deadcyclo-base-layout.png)](http://www.keyboard-layout-editor.com/#/gists/0321b18620180a3e46c498206eb65366)
|
||||
|
||||
The base layer here is marked with the us international alt-gr layout,
|
||||
including characters bound to what on an iso keyboard would be alt-gr
|
||||
and on an ansi keyboard right alt.
|
||||
|
||||
Regular (and irregular) modifier keys are marked with a yellowish
|
||||
gray. Layer moderators are marked with blue, red and green, which are
|
||||
the same colors each layer displays on the LEDs when active.
|
||||
|
||||
All of the layer switch keys, except for the two center keys marked L1
|
||||
TOG, are dual purpose. Hence for example the top left key produces ESC
|
||||
if tapped, and temporarilly toggles L3 when hold down. The two center
|
||||
L1 TOG keys toggle L1 on and off for more permanent layer toggling.
|
||||
|
||||
The UNI keys enter the linux ibus unicode composer mode
|
||||
(ie. Ctrl+Shift+u). Use this to enter unicode characters. Hit the key,
|
||||
type in the unicode hex value, and hit enter.
|
||||
|
||||
## Layer 1 - Symbols and RGB
|
||||
|
||||
[![Layer 1 - Symbols and RGB](images/deadcyclo-layer-1-symbols.png)](http://www.keyboard-layout-editor.com/#/gists/96714e198054c9115bafb5267cc6bc73)
|
||||
|
||||
The Symbols and RGB layer contains function keys, commonly used
|
||||
symbols, a numpad and if you have the new Ergodox Ez shine keys for
|
||||
controlling various RGB-led functions. In addition, it provides an up
|
||||
and a down key for easy scrolling. RGB controller keys are yellow.
|
||||
|
||||
## Layer 2 - Media, Mouse and Navigation
|
||||
|
||||
[![Layer 2 - Media, Mouse and Navigation](images/deadcyclo-layer-2-media-and-mouse.png)](http://www.keyboard-layout-editor.com/#/gists/824759486e378bcec30784309a7e5731)
|
||||
|
||||
The Media, Mouse and unicode layer contains special keys for moving
|
||||
the mouse and clicking on it with the keyboard. In addition it
|
||||
provides standard media control keys, and default arrow keys.
|
||||
|
||||
## Layer 3 - Unicode
|
||||
|
||||
[![Layer 3 - Unicode](images/deadcyclo-layer-3-navigation.png)](http://www.keyboard-layout-editor.com/#/gists/67d9613dcd873c68693d11863d0fd289)
|
||||
|
||||
The unicode layer provides keys for directly typing unicode (utf-8)
|
||||
|
||||
# Changelog
|
||||
|
||||
- 02.01.2017 Added delete key on second layer
|
||||
- 10.01.2017 Added layer images to readme
|
||||
- 24.01.2017 Added support for Ergodox Shine. Added secondary L2 switch key on left hand
|
||||
- 24.01.2017 Added unicode keys. Added shrug hug and yay. Moved Navigation to layer 2
|
||||
- 25.01.2017 Added lots of new emojis and some unicode keys
|
||||
- 27.01.2017 Added new unicode keys and shortcut for ibus unicode composer key (CTRL+SHIFT+U)
|
||||
|
||||
# TODO
|
||||
|
||||
- Add macros for lots of stuff. (Lastpass cli, pushbullet cli, other push service cli, linode cli, more?)
|
||||
- Make macros for gnu screen and i3wm
|
||||
- Look into the app launch macros in algernon keymap
|
||||
|
After Width: | Height: | Size: 252 KiB |
After Width: | Height: | Size: 83 KiB |
After Width: | Height: | Size: 81 KiB |
After Width: | Height: | Size: 71 KiB |
@ -0,0 +1,54 @@
|
||||
This is a dual English-Japanese keymap that utilises a thumb-shift system for Japanese input. You can read more about this layout on my blog [here](https://ishigoya.com).
|
||||
|
||||
### Some Editing Necessary
|
||||
The system I created this on is a Chromebook, and uses a Japanese keymap, so some of the key mappings may not be the same as those on your system. In particular, the Escape key on layer 0 is mapped to KC_LCTL.
|
||||
|
||||
### Layouts
|
||||
------
|
||||
#### English layer - layer 0
|
||||
The English layout is a modified Workman layout, and is pictured below:
|
||||
|
||||
![English layout](img/keyboard-layout-enL.png)
|
||||
|
||||
Some of the punctuation keys have been moved to a separate number/symbol layer.
|
||||
|
||||
#### Number / Symbol layer - layer 6
|
||||
|
||||
The Number / Symbol layer is reachable through a ACTION_LAYER_MOMENTARY function. The blue LED is illuminated when this layer is active. It is accessible from the English or Japanese layers.
|
||||
|
||||
![Number layout](img/keyboard-layout-numL.png)
|
||||
|
||||
#### Japanese layers - layers 1-5
|
||||
|
||||
There are 5 layers involved in Japanese input. The TOJPLOUT macro is mapped to the En / 和 button, and switches default layer between layer 0 (English) and 1 (main Japanese layer). When layer 1 is the default layer, the red LED is on. It also outputs the ZKHK button to change the input method language.
|
||||
|
||||
On keypress, strings of romaji characters are output by the keyboard using macros, and these simulate the input of individual keys on a latin keyboard.
|
||||
|
||||
![Japanese layout](img/keyboard-layout-jpL.png)
|
||||
|
||||
Layer 1 is the JP layer. Keys on this layer correspond to singleton keys, or keys on the bottom row where a key is shared. For example, pressing the "ふ や" key outputs `ふ` (or "fu").
|
||||
|
||||
Layer 2 is the JPXON layer, and is active while holding the Fn key. This prints keys that are prefaced by "x" when writing in romaji. For example, pressing the "ふ や" key while holding the Fn key outputs `ゃ` (or "xya").
|
||||
|
||||
Layer 3 is the JPKAZARI layer, and is active while holding the 飾り key. This provides letters with dakuten. For example, pressing the "ふ や" key while holding the 飾り key outputs `ぶ` (or "bu").
|
||||
|
||||
Layer 4 is the JPTOPROW layer, and is active while holding the シフト key. Keys on this line correspond to top row keys on shared keys in the image. For example, pressing the "ふ や" key while holding the シフト key outputs `や` (or "ya").
|
||||
|
||||
Layer 5 is the JPTRKZ layer, and is active while holding both the シフト key and the 飾り key. This layer contains handakuten keys. For example, pressing the "ふ や" while holding both the シフト key and the 飾り key outputs `ぷ` (or "pu").
|
||||
|
||||
I've also separated out the #define sections and the macros required for kana for easy copying, in case anyone else should wish to make a kana-based layout.
|
||||
|
||||
When tapped, the シフト key acts as a space key, and the 飾り key acts as a return key. This allows them to function as 変換 and 無変換, respectively, in many IMEs.
|
||||
|
||||
Furthermore the Fn key, when tapped, acts as an F7 key, providing easy switching to katakana in many IMEs.
|
||||
|
||||
### Other features
|
||||
The cut/copy button gives copy functionality on a short press, and cut functionality on a long press.
|
||||
|
||||
The tmux prefix button outputs Control-B.
|
||||
|
||||
The Control & Shift key acts as holding the control and shift keys at the same time.
|
||||
|
||||
SelAll outputs Control-A.
|
||||
|
||||
Undo outputs Control-Z.
|
@ -0,0 +1,63 @@
|
||||
/*
|
||||
Config file - Ergodox QMK with replicaJunction layout
|
||||
|
||||
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 KEYBOARDS_ERGODOX_CONFIG_H_
|
||||
#define KEYBOARDS_ERGODOX_CONFIG_H_
|
||||
|
||||
#define MOUSEKEY_DELAY 100
|
||||
#define MOUSEKEY_INTERVAL 20
|
||||
#define MOUSEKEY_MAX_SPEED 3
|
||||
#define MOUSEKEY_TIME_TO_MAX 10
|
||||
|
||||
#define TAPPING_TOGGLE 1
|
||||
|
||||
/* define if matrix has ghost */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
// MS the button needs to be held before a tap becomes a hold (default: 200)
|
||||
#define TAPPING_TERM 200
|
||||
|
||||
#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.)
|
||||
|
||||
// I don't have any locking keys, so I don't need these features
|
||||
|
||||
|
||||
/* 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
|
||||
|
||||
/* Prevent modifiers from sticking when switching layers */
|
||||
/* Uses 5 bytes of memory per 8 keys, but makes sure modifiers don't get "stuck" switching layers */
|
||||
#define PREVENT_STUCK_MODIFIERS
|
||||
|
||||
/* key combination for command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \
|
||||
)
|
||||
|
||||
#ifdef SUBPROJECT_ez
|
||||
#include "ez/config.h"
|
||||
#endif
|
||||
#ifdef SUBPROJECT_infinity
|
||||
#include "infinity/config.h"
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* KEYBOARDS_ERGODOX_CONFIG_H_ */
|
@ -0,0 +1,336 @@
|
||||
/*
|
||||
* Keyboard: Ergodox
|
||||
* Keymap: replicaJunction
|
||||
* Version: 1.2
|
||||
*
|
||||
* This keymap is designed to complement my Atreus keyboard layout, found in keyboards/atreus.
|
||||
* The Atreus keyboard is a 40% board whose design was heavily influenced by the Ergodox, and I now
|
||||
* have both keyboards, so I've designed these layouts in an effort to make switching between the
|
||||
* two as easy as possible.
|
||||
*
|
||||
* I've also tried to make use of the extra keys on the Ergodox in as logical of a manner as possible,
|
||||
* adding to the layers in the Atreus config without disturbing what's there already. This allows for
|
||||
* things like F11-F20, the Application (Menu) key, and better media key placement.
|
||||
*
|
||||
* The default key layout in this keymap is Colemak-ModDH. Information on that layout can be found
|
||||
* here: https://colemakmods.github.io/mod-dh/
|
||||
*/
|
||||
|
||||
#include "ergodox.h"
|
||||
#include "debug.h"
|
||||
#include "action_layer.h"
|
||||
|
||||
#define _CO 0 // Colemak
|
||||
#define _QW 1 // QWERTY
|
||||
#define _ME 2 // media keys
|
||||
#define _NU 3 // numpad
|
||||
#define _EX 4 // extend
|
||||
#define _GA 5 // mouse overlay for gaming
|
||||
|
||||
// Some quick aliases, just to make it look pretty
|
||||
#define _______ KC_TRNS
|
||||
#define KCX_CGR LCTL(KC_GRV)
|
||||
#define KX_STAB LSFT(KC_TAB)
|
||||
#define KX_COPY LCTL(KC_C)
|
||||
#define KX_CUT LCTL(KC_X)
|
||||
#define KX_PAST LCTL(KC_V)
|
||||
#define KX_UNDO LCTL(KC_Z)
|
||||
|
||||
; // This doesn't do anything. It's just for VSCode because its syntax highlighting is weird for the above #define statements.
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/*
|
||||
* Keymap: Colemak-ModDH
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | ` | 1 | 2 | 3 | 4 | 5 | Esc | | | 6 | 7 | 8 | 9 | 0 | = |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | LCtrl | Q | W | F | P | B | Home | | BkSp | J | L | U | Y | ; | - |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | Tab | A | R | S | T | G |------| |------| M | N | E | I | O | ' |
|
||||
* |--------+------+------+------+------+------| Hyper| | \ |------+------+------+------+------+--------|
|
||||
* | LShft | Z | X | C | D | V | | | | K | H | , | , | / | RShft |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | LGui | [ | ] |CtlShf| LAlt | | _EX | - | ' | = | \ |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | LCtrl| ~GA | | Left | Right|
|
||||
* ,------|------|------| |------+------+------.
|
||||
* |LCtrl/| LAlt/| Home | | Up | Alt/| _NU/ |
|
||||
* | BkSp | Del |------| |------| Enter| Space|
|
||||
* | | | _NU | | Down | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
[_CO] = KEYMAP(
|
||||
// left hand
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC,
|
||||
KC_LCTL,KC_Q, KC_W, KC_F, KC_P, KC_B, KC_HOME,
|
||||
KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_G,
|
||||
KC_LSFT,KC_Z, KC_X, KC_C, KC_D, KC_V, ALL_T(KC_NO),
|
||||
KC_LGUI,KC_LBRC,KC_RBRC, LCTL(KC_LSFT), KC_LALT,
|
||||
|
||||
KC_LCTL, TG(_GA),
|
||||
KC_HOME,
|
||||
CTL_T(KC_BSPC), ALT_T(KC_DEL), MO(_NU),
|
||||
// right hand
|
||||
KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL,
|
||||
KC_BSPC, KC_J, KC_L, KC_U, KC_Y, KC_SCLN,KC_MINS,
|
||||
KC_M, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
|
||||
KC_BSLS, KC_K, KC_H, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT,
|
||||
MO(_EX),KC_MINS,KC_QUOT,KC_EQL, KC_BSLS,
|
||||
|
||||
KC_LEFT, KC_RGHT,
|
||||
KC_UP,
|
||||
KC_DOWN, ALT_T(KC_ENT), LT(_NU,KC_SPC)
|
||||
),
|
||||
|
||||
/*
|
||||
* Keymap: QWERTY layout.
|
||||
*
|
||||
* This is optimized for gaming, not typing, so there aren't as many macros
|
||||
* as the Dvorak layer. Some of the keys have also been moved to "game-
|
||||
* like" locations, such as making the spacebar available to the left thumb,
|
||||
* and repositioning the arrow keys at the bottom right corner.
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | ` | 1 | 2 | 3 | 4 | 5 | Esc | | | 6 | 7 | 8 | 9 | 0 | = |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | LCtrl | Q | W | E | R | T | Home | | BkSp | Y | U | I | O | P | - |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | Tab | A | S | D | F | G |------| |------| H | J | K | L | ; | ' |
|
||||
* |--------+------+------+------+------+------| Hyper| | \ |------+------+------+------+------+--------|
|
||||
* | LShft | Z | X | C | V | B | | | | N | M | , | . | / | RShft |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | LGui | ` | \ |CtlShf| _NU | | _EX | - | ' | = | \ |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | LCtrl| ~GA | | Left | Right|
|
||||
* ,------|------|------| |------+------+------.
|
||||
* |LCtrl/| LAlt/| Home | | Up | Alt/| _NU/ |
|
||||
* | BkSp | Del |------| |------| Enter| Space|
|
||||
* | | | _NU | | Down | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
[_QW] = KEYMAP( // Layer1: QWERTY
|
||||
// left hand
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC,
|
||||
KC_LCTL,KC_Q, KC_W, KC_E, KC_R, KC_T, KC_HOME,
|
||||
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G,
|
||||
KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO),
|
||||
KC_LGUI,KC_GRV, KC_SLSH,LCTL(KC_LSFT), MO(_NU),
|
||||
|
||||
KC_LCTL,TG(_GA),
|
||||
KC_HOME,
|
||||
CTL_T(KC_BSPC), ALT_T(KC_DEL), MO(_NU),
|
||||
// right hand
|
||||
KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL,
|
||||
KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS,
|
||||
KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,
|
||||
KC_BSLS, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT,
|
||||
MO(_EX),KC_MINS,KC_QUOT,KC_EQL, KC_BSLS,
|
||||
|
||||
KC_LEFT, KC_RGHT,
|
||||
KC_UP,
|
||||
KC_DOWN, ALT_T(KC_ENT), LT(_NU,KC_SPC)
|
||||
),
|
||||
|
||||
/*
|
||||
* Keymap: Numbers and symbols
|
||||
*
|
||||
* Note that the number keys here are actually numpad keystrokes. This often doesn't matter, but it may be relevant in a few cases.
|
||||
* That's why the Num Lock key exists on this layer - just in case.
|
||||
*
|
||||
* This layer also contains the layout switches.
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | ! | @ | { | } | & | | | | / | 7 | 8 | 9 | * | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | # | $ | ( | ) | ~ |------| |------| | | 4 | 5 | 6 | - | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | % | ^ | [ | ] | ` | | | | \ | 1 | 2 | 3 | + | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | |QWERTY|Colemk| | | | 0 | . | = | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* |NumLck| RESET| | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* | | |------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
[_NU] = KEYMAP(
|
||||
// left hand
|
||||
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______,
|
||||
_______, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_AMPR, _______,
|
||||
_______, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_TILD,
|
||||
_______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_GRV, _______,
|
||||
_______, DF(_QW), DF(_CO), _______, _______,
|
||||
|
||||
KC_NLCK,RESET,
|
||||
_______,
|
||||
_______,_______,_______,
|
||||
// right hand
|
||||
_______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______,
|
||||
_______, KC_SLSH, KC_P7, KC_P8, KC_P9, KC_PAST, _______,
|
||||
KC_PIPE, KC_P4, KC_P5, KC_P6, KC_PMNS, _______,
|
||||
_______, KC_BSLS, KC_P1, KC_P2, KC_P3, KC_PPLS, _______,
|
||||
KC_P0, KC_PDOT, KC_EQL, _______, _______,
|
||||
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, _______, _______
|
||||
),
|
||||
|
||||
/*
|
||||
* Keymap: Extend
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | F11 | F12 | F13 | F14 | F15 | Mute | | | F16 | F17 | F18 | F19 | F20 | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | | | | | Ctrl`| Vol | | | PgUp | Home | Up | End | Del | |
|
||||
* |--------+------+------+------+------+------| Up | | |------+------+------+------+------+--------|
|
||||
* | | | Gui | Alt | Ctrl | |------| |------| PgDn | Left | Down | Right| BkSp | Menu |
|
||||
* |--------+------+------+------+------+------| Vol | | |------+------+------+------+------+--------|
|
||||
* | | Undo | Cut | Copy | | Paste| Down | | | | ^Tab | Tab | |Insert| PrntScr|
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | | | | | | | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* | | |------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*
|
||||
* Ctrl+` is a keyboard shortcut for the program ConEmu, which provides a Quake-style drop-down command prompt.
|
||||
*
|
||||
*/
|
||||
[_EX] = KEYMAP(
|
||||
// left hand
|
||||
_______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_MUTE,
|
||||
_______, _______, _______, _______, _______, KCX_CGR, KC_VOLU,
|
||||
_______, _______, KC_LGUI, KC_LALT, KC_LCTL, _______,
|
||||
_______, KX_UNDO, KX_CUT, KX_COPY, _______, KX_PAST, KC_VOLD,
|
||||
_______, _______, _______, _______, _______,
|
||||
|
||||
_______,_______,
|
||||
_______,
|
||||
_______,_______,_______,
|
||||
// right hand
|
||||
_______, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______,
|
||||
_______, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_DEL, _______,
|
||||
KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_BSPC, KC_MENU,
|
||||
_______, _______, KX_STAB, KC_TAB, _______, KC_INS, KC_PSCR,
|
||||
_______, _______, _______, _______, _______,
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, _______, _______
|
||||
),
|
||||
|
||||
/*
|
||||
* Keymap: Gaming
|
||||
*
|
||||
* Provides a mouse overlay for the right hand, and also moves some "gamer friendly" keys to the left, such as space.
|
||||
* This layer also removes a lot of dual-role keys, as when gaming, it's nicer not to need to keep track of those.
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | |WhlUp | MsUp |WhlDn | | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | | | | | |------| |------| |MsLeft|MsDown|MsRght| | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | LCtrl| | | | | | | | | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | ~_GA | | |MClick|
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* | Space| |------| |------|RClick|LClick|
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
[_GA] = KEYMAP(
|
||||
// left hand
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
KC_LCTL, _______, _______, _______, _______,
|
||||
|
||||
_______,_______,
|
||||
_______,
|
||||
KC_SPC, _______,_______,
|
||||
|
||||
// right hand
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, KC_WH_U, KC_MS_U, KC_WH_D, _______, _______,
|
||||
_______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
_______, KC_BTN3,
|
||||
_______,
|
||||
_______, KC_BTN2, KC_BTN1
|
||||
),
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[1] = ACTION_LAYER_TAP_TOGGLE(_NU) // FN1 - Momentary Layer 1 (Numbers and symbols)
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
// MACRODOWN only works in this function
|
||||
switch(id) {
|
||||
case 0:
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_RSFT);
|
||||
} else {
|
||||
unregister_code(KC_RSFT);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
// Runs just one time when the keyboard initializes.
|
||||
void matrix_init_user(void) {
|
||||
|
||||
};
|
||||
|
||||
// Runs constantly in the background, in a loop.
|
||||
void matrix_scan_user(void) {
|
||||
|
||||
uint8_t layer = biton32(layer_state);
|
||||
// uint8_t default_layer = biton32(layer_state);
|
||||
|
||||
ergodox_board_led_off();
|
||||
ergodox_right_led_1_off();
|
||||
ergodox_right_led_2_off();
|
||||
ergodox_right_led_3_off();
|
||||
|
||||
switch (layer) {
|
||||
case _CO:
|
||||
ergodox_right_led_1_on();
|
||||
break;
|
||||
case _QW:
|
||||
ergodox_right_led_2_on();
|
||||
break;
|
||||
case _NU:
|
||||
ergodox_right_led_3_on();
|
||||
break;
|
||||
case _GA:
|
||||
ergodox_right_led_1_on();
|
||||
ergodox_right_led_2_on();
|
||||
default:
|
||||
// none
|
||||
break;
|
||||
}
|
||||
|
||||
};
|
@ -0,0 +1,5 @@
|
||||
# replicaJunction - Ergodox (EZ) Layout
|
||||
|
||||
I designed this layout, along with my complimentary Atreus layout, to address the challenge of having an Ergodox as my primary home keyboard and an Atreus as my primary work board. I wanted a layout that provided symbols in comfortable locations on both keyboards - but didn't require me to learn two separate sets of symbols for the two keyboards.
|
||||
|
||||
I had originally used several keys as dual-role keys, where a tap would send a keypress and a long press and hold would trigger a different layer. However, after several months of experimenting with those ideas, I've begun moving away from that design due to performance. It's very hard to strike a balance between the time it takes to press a key normally while typing and the "delay" in the typing motion needed to trigger the alternate layer. I was frequently getting strange characters and artifacts because I pressed the function key + the symbol key too quickly, and the layer never shifted.
|
@ -0,0 +1,419 @@
|
||||
[
|
||||
{
|
||||
"backcolor": "#ffffff",
|
||||
"name": "Ergodox Swiss German Layout - Base Layer",
|
||||
"author": "Andreas Schmidt (https://github.com/remigius42)"
|
||||
},
|
||||
[
|
||||
{
|
||||
"x": 3.5
|
||||
},
|
||||
"#\n3",
|
||||
{
|
||||
"x": 10.5
|
||||
},
|
||||
"*\n8"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.875,
|
||||
"x": 2.5
|
||||
},
|
||||
"@\n2",
|
||||
{
|
||||
"x": 1
|
||||
},
|
||||
"$\n4",
|
||||
{
|
||||
"x": 8.5
|
||||
},
|
||||
"&\n7",
|
||||
{
|
||||
"x": 1
|
||||
},
|
||||
"(\n9"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.875,
|
||||
"x": 5.5
|
||||
},
|
||||
"%\n5",
|
||||
{
|
||||
"a": 7
|
||||
},
|
||||
"<i class='fa fa-arrow-left'></i>",
|
||||
{
|
||||
"x": 4.5
|
||||
},
|
||||
"<i class='fa fa-arrow-right'></i>",
|
||||
{
|
||||
"a": 4
|
||||
},
|
||||
"^\n6"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.875,
|
||||
"w": 1.5
|
||||
},
|
||||
"°\n§",
|
||||
"!\n1",
|
||||
{
|
||||
"x": 14.5
|
||||
},
|
||||
")\n0",
|
||||
{
|
||||
"w": 1.5
|
||||
},
|
||||
"?\n'\n\n'"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.375,
|
||||
"x": 3.5
|
||||
},
|
||||
"E",
|
||||
{
|
||||
"x": 10.5
|
||||
},
|
||||
"I"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.875,
|
||||
"x": 2.5
|
||||
},
|
||||
"W",
|
||||
{
|
||||
"x": 1
|
||||
},
|
||||
"R",
|
||||
{
|
||||
"x": 8.5
|
||||
},
|
||||
"U",
|
||||
{
|
||||
"x": 1
|
||||
},
|
||||
"O"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.875,
|
||||
"x": 5.5
|
||||
},
|
||||
"T",
|
||||
{
|
||||
"c": "#b56b6b",
|
||||
"a": 6,
|
||||
"h": 1.5
|
||||
},
|
||||
"Toggle Code Layer",
|
||||
{
|
||||
"x": 4.5,
|
||||
"h": 1.5
|
||||
},
|
||||
"Toggle Code Layer",
|
||||
{
|
||||
"c": "#cccccc",
|
||||
"a": 4
|
||||
},
|
||||
"Y"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.875,
|
||||
"a": 6,
|
||||
"w": 1.5
|
||||
},
|
||||
"Delete",
|
||||
{
|
||||
"a": 4
|
||||
},
|
||||
"Q",
|
||||
{
|
||||
"x": 14.5
|
||||
},
|
||||
"P",
|
||||
{
|
||||
"w": 1.5
|
||||
},
|
||||
"è\nü\n\n["
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.375,
|
||||
"x": 3.5
|
||||
},
|
||||
"D",
|
||||
{
|
||||
"x": 10.5
|
||||
},
|
||||
"K"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.875,
|
||||
"x": 2.5
|
||||
},
|
||||
"S",
|
||||
{
|
||||
"x": 1
|
||||
},
|
||||
"F",
|
||||
{
|
||||
"x": 8.5
|
||||
},
|
||||
"J",
|
||||
{
|
||||
"x": 1
|
||||
},
|
||||
"L"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.875,
|
||||
"x": 5.5
|
||||
},
|
||||
"G",
|
||||
{
|
||||
"x": 6.5
|
||||
},
|
||||
"H"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.875,
|
||||
"a": 6,
|
||||
"w": 1.5
|
||||
},
|
||||
"Backspace",
|
||||
{
|
||||
"c": "#79c777",
|
||||
"a": 4
|
||||
},
|
||||
"A\n\nLyr3",
|
||||
{
|
||||
"x": 14.5
|
||||
},
|
||||
"é\nö\nLyr3",
|
||||
{
|
||||
"c": "#748adb",
|
||||
"w": 1.5
|
||||
},
|
||||
"à\nä\nCmd\n{"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.625,
|
||||
"x": 6.5,
|
||||
"c": "#cccccc",
|
||||
"a": 6,
|
||||
"h": 1.5
|
||||
},
|
||||
"Hyper",
|
||||
{
|
||||
"x": 4.5,
|
||||
"h": 1.5
|
||||
},
|
||||
"Meh"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.75,
|
||||
"x": 3.5,
|
||||
"a": 4
|
||||
},
|
||||
"C",
|
||||
{
|
||||
"x": 10.5
|
||||
},
|
||||
";\n,"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.875,
|
||||
"x": 2.5,
|
||||
"c": "#748adb"
|
||||
},
|
||||
"X\n\nAlt",
|
||||
{
|
||||
"x": 1,
|
||||
"c": "#cccccc"
|
||||
},
|
||||
"V",
|
||||
{
|
||||
"x": 8.5
|
||||
},
|
||||
"M",
|
||||
{
|
||||
"x": 1,
|
||||
"c": "#748adb"
|
||||
},
|
||||
":\n.\nAlt"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.875,
|
||||
"x": 5.5,
|
||||
"c": "#cccccc"
|
||||
},
|
||||
"B",
|
||||
{
|
||||
"x": 6.5
|
||||
},
|
||||
"N"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.875,
|
||||
"a": 6,
|
||||
"w": 1.5
|
||||
},
|
||||
"Shift",
|
||||
{
|
||||
"c": "#748adb",
|
||||
"a": 4
|
||||
},
|
||||
"Z\n\nCtrl",
|
||||
{
|
||||
"x": 14.5
|
||||
},
|
||||
"_\n-\nCtrl",
|
||||
{
|
||||
"c": "#cccccc",
|
||||
"a": 6,
|
||||
"w": 1.5
|
||||
},
|
||||
"Shift"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.375,
|
||||
"x": 3.5,
|
||||
"a": 7
|
||||
},
|
||||
"<i class='fa fa-arrow-left'></i>",
|
||||
{
|
||||
"x": 10.5
|
||||
},
|
||||
"<i class='fa fa-arrow-down'></i>"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.875,
|
||||
"x": 2.5,
|
||||
"a": 4
|
||||
},
|
||||
"£\n$\n\n}",
|
||||
{
|
||||
"x": 1,
|
||||
"a": 7
|
||||
},
|
||||
"<i class='fa fa-arrow-right'></i>",
|
||||
{
|
||||
"x": 10.5,
|
||||
"a": 6
|
||||
},
|
||||
"AltGr"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.9950000000000001,
|
||||
"x": 14,
|
||||
"a": 7
|
||||
},
|
||||
"<i class='fa fa-arrow-up'></i>"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.7549999999999999,
|
||||
"x": 0.5,
|
||||
"c": "#b56b6b",
|
||||
"a": 4
|
||||
},
|
||||
">\n<\nCode Layer\n\\",
|
||||
{
|
||||
"c": "#cccccc"
|
||||
},
|
||||
"`\n^\n\n~",
|
||||
{
|
||||
"x": 14.5
|
||||
},
|
||||
"!\n¨\n\n]",
|
||||
{
|
||||
"c": "#b56b6b"
|
||||
},
|
||||
"\n\nCode Layer"
|
||||
],
|
||||
[
|
||||
{
|
||||
"r": 30,
|
||||
"rx": 6.5,
|
||||
"ry": 4.25,
|
||||
"y": -1,
|
||||
"x": 1,
|
||||
"c": "#748adb"
|
||||
},
|
||||
"Apps\nAlt",
|
||||
{
|
||||
"c": "#cccccc",
|
||||
"a": 6
|
||||
},
|
||||
"Win / Cmd"
|
||||
],
|
||||
[
|
||||
{
|
||||
"h": 2
|
||||
},
|
||||
"Space",
|
||||
{
|
||||
"h": 2
|
||||
},
|
||||
"Back Space",
|
||||
"Home"
|
||||
],
|
||||
[
|
||||
{
|
||||
"x": 2
|
||||
},
|
||||
"End"
|
||||
],
|
||||
[
|
||||
{
|
||||
"r": -30,
|
||||
"rx": 13,
|
||||
"y": -1,
|
||||
"x": -3
|
||||
},
|
||||
"Alt",
|
||||
{
|
||||
"c": "#748adb",
|
||||
"a": 4
|
||||
},
|
||||
"Esc\nCtrl"
|
||||
],
|
||||
[
|
||||
{
|
||||
"x": -3,
|
||||
"c": "#cccccc",
|
||||
"a": 6
|
||||
},
|
||||
"Pg Up",
|
||||
{
|
||||
"h": 2
|
||||
},
|
||||
"Tab",
|
||||
{
|
||||
"h": 2
|
||||
},
|
||||
"Enter"
|
||||
],
|
||||
[
|
||||
{
|
||||
"x": -3
|
||||
},
|
||||
"Pg Dn"
|
||||
]
|
||||
]
|
After Width: | Height: | Size: 74 KiB |
@ -0,0 +1,436 @@
|
||||
[
|
||||
{
|
||||
"backcolor": "#ffffff",
|
||||
"name": "Ergodox Swiss German Layout - Symbol & Media Layer",
|
||||
"author": "Andreas Schmidt (https://github.com/remigius42)"
|
||||
},
|
||||
[
|
||||
{
|
||||
"x": 3.5,
|
||||
"t": "#b81c1c"
|
||||
},
|
||||
"F3",
|
||||
{
|
||||
"x": 10.5
|
||||
},
|
||||
"F8"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.875,
|
||||
"x": 2.5
|
||||
},
|
||||
"F2",
|
||||
{
|
||||
"x": 1
|
||||
},
|
||||
"F4",
|
||||
{
|
||||
"x": 8.5
|
||||
},
|
||||
"F7",
|
||||
{
|
||||
"x": 1
|
||||
},
|
||||
"F9"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.875,
|
||||
"x": 5.5
|
||||
},
|
||||
"F5",
|
||||
{
|
||||
"t": "#000000",
|
||||
"a": 7
|
||||
},
|
||||
"",
|
||||
{
|
||||
"x": 4.5
|
||||
},
|
||||
"",
|
||||
{
|
||||
"t": "#b81c1c",
|
||||
"a": 4
|
||||
},
|
||||
"F6"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.875,
|
||||
"t": "#000000\n\n\n#529151",
|
||||
"w": 1.5
|
||||
},
|
||||
"\n\n\nFlash",
|
||||
{
|
||||
"t": "#b81c1c"
|
||||
},
|
||||
"F1",
|
||||
{
|
||||
"x": 14.5
|
||||
},
|
||||
"F10",
|
||||
{
|
||||
"t": "#b81c1c\n\n\n#529151",
|
||||
"w": 1.5
|
||||
},
|
||||
"F11\n\n\nFlash"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.375,
|
||||
"x": 3.5
|
||||
},
|
||||
"{\n\n\n<i class='fa fa-arrow-circle-up'></i>",
|
||||
{
|
||||
"x": 10.5,
|
||||
"t": "#b81c1c"
|
||||
},
|
||||
"8"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.875,
|
||||
"x": 2.5
|
||||
},
|
||||
"@",
|
||||
{
|
||||
"x": 1
|
||||
},
|
||||
"}",
|
||||
{
|
||||
"x": 8.5,
|
||||
"t": "#b81c1c\n\n\n#529151"
|
||||
},
|
||||
"7\n\n\nHTML ul",
|
||||
{
|
||||
"x": 1
|
||||
},
|
||||
"9\n\n\nHTML ol"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.875,
|
||||
"x": 5.5,
|
||||
"t": "#b81c1c"
|
||||
},
|
||||
"|",
|
||||
{
|
||||
"t": "#000000",
|
||||
"a": 7,
|
||||
"h": 1.5
|
||||
},
|
||||
"",
|
||||
{
|
||||
"x": 4.5,
|
||||
"h": 1.5
|
||||
},
|
||||
"",
|
||||
{
|
||||
"t": "#b81c1c",
|
||||
"a": 4
|
||||
},
|
||||
"<i class='fa fa-arrow-up'></i>"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.875,
|
||||
"t": "#000000",
|
||||
"a": 7,
|
||||
"w": 1.5
|
||||
},
|
||||
"",
|
||||
{
|
||||
"t": "#b81c1c",
|
||||
"a": 4
|
||||
},
|
||||
"!",
|
||||
{
|
||||
"x": 14.5
|
||||
},
|
||||
"*",
|
||||
{
|
||||
"w": 1.5
|
||||
},
|
||||
"F12"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.375,
|
||||
"x": 3.5,
|
||||
"t": "#b81c1c\n\n\n#529151"
|
||||
},
|
||||
"(\n\n\n<i class='fa fa-arrow-circle-down'></i>",
|
||||
{
|
||||
"x": 10.5
|
||||
},
|
||||
"5\n\n\nHTML li"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.875,
|
||||
"x": 2.5
|
||||
},
|
||||
"$\n\n\n<i class='fa fa-arrow-circle-left'></i>",
|
||||
{
|
||||
"x": 1
|
||||
},
|
||||
")\n\n\n<i class='fa fa-arrow-circle-right'></i>",
|
||||
{
|
||||
"x": 8.5,
|
||||
"t": "#b81c1c"
|
||||
},
|
||||
"4",
|
||||
{
|
||||
"x": 1
|
||||
},
|
||||
"6"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.875,
|
||||
"x": 5.5
|
||||
},
|
||||
"`",
|
||||
{
|
||||
"x": 6.5
|
||||
},
|
||||
"<i class='fa fa-arrow-down'></i>"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.875,
|
||||
"t": "#000000",
|
||||
"a": 7,
|
||||
"w": 1.5
|
||||
},
|
||||
"",
|
||||
{
|
||||
"t": "#b81c1c",
|
||||
"a": 4
|
||||
},
|
||||
"#",
|
||||
{
|
||||
"x": 14.5
|
||||
},
|
||||
"+",
|
||||
{
|
||||
"t": "#000000\n\n\n#529151",
|
||||
"w": 1.5
|
||||
},
|
||||
"\n\n\n<i class='fa fa-play'></i><i class='fa fa-pause'></i>"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.625,
|
||||
"x": 6.5,
|
||||
"t": "#000000",
|
||||
"a": 7,
|
||||
"h": 1.5
|
||||
},
|
||||
"",
|
||||
{
|
||||
"x": 4.5,
|
||||
"h": 1.5
|
||||
},
|
||||
""
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.75,
|
||||
"x": 3.5,
|
||||
"t": "#b81c1c\n\n\n#529151",
|
||||
"a": 4
|
||||
},
|
||||
"[\n\n\nHTML code",
|
||||
{
|
||||
"x": 10.5
|
||||
},
|
||||
"2\n\n\n<i class='fa fa-fast-backward'></i>"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.875,
|
||||
"x": 2.5,
|
||||
"t": "#b81c1c"
|
||||
},
|
||||
"^",
|
||||
{
|
||||
"x": 1,
|
||||
"t": "#b81c1c\n\n\n#529151"
|
||||
},
|
||||
"]\n\n\nHTML br",
|
||||
{
|
||||
"x": 8.5,
|
||||
"t": "#b81c1c"
|
||||
},
|
||||
"1",
|
||||
{
|
||||
"x": 1,
|
||||
"t": "#b81c1c\n\n\n#529151"
|
||||
},
|
||||
"3\n\n\n<i class='fa fa-fast-forward'></i>"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.875,
|
||||
"x": 5.5,
|
||||
"t": "#b81c1c"
|
||||
},
|
||||
"~",
|
||||
{
|
||||
"x": 6.5
|
||||
},
|
||||
"&"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.875,
|
||||
"t": "#000000",
|
||||
"a": 7,
|
||||
"w": 1.5
|
||||
},
|
||||
"",
|
||||
{
|
||||
"t": "#b81c1c",
|
||||
"a": 4
|
||||
},
|
||||
"%",
|
||||
{
|
||||
"x": 14.5
|
||||
},
|
||||
"\\",
|
||||
{
|
||||
"t": "#000000",
|
||||
"a": 7,
|
||||
"w": 1.5
|
||||
},
|
||||
""
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.375,
|
||||
"x": 3.5,
|
||||
"t": "#000000\n\n\n#529151",
|
||||
"a": 4
|
||||
},
|
||||
"\n\n\nleft click",
|
||||
{
|
||||
"x": 10.5,
|
||||
"t": "#b81c1c\n\n\n#529151"
|
||||
},
|
||||
".\n\n\n<i class='fa fa-volume-down'></i>"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.875,
|
||||
"x": 2.5,
|
||||
"t": "#000000",
|
||||
"a": 7
|
||||
},
|
||||
"",
|
||||
{
|
||||
"x": 1,
|
||||
"t": "#000000\n\n\n#529151",
|
||||
"a": 4
|
||||
},
|
||||
"\n\n\nright click",
|
||||
{
|
||||
"x": 8.5,
|
||||
"t": "#b81c1c\n\n\n#529151"
|
||||
},
|
||||
"?\n\n\n<i class='fa fa-volume-up'></i>",
|
||||
{
|
||||
"x": 1,
|
||||
"t": "#b81c1c"
|
||||
},
|
||||
"0"
|
||||
],
|
||||
[
|
||||
{
|
||||
"y": -0.75,
|
||||
"x": 0.5,
|
||||
"t": "#000000",
|
||||
"a": 7
|
||||
},
|
||||
"",
|
||||
{
|
||||
"t": "#b81c1c",
|
||||
"a": 4
|
||||
},
|
||||
"EPRM RST",
|
||||
{
|
||||
"x": 14.5,
|
||||
"t": "#000000",
|
||||
"a": 7
|
||||
},
|
||||
"",
|
||||
""
|
||||
],
|
||||
[
|
||||
{
|
||||
"r": 30,
|
||||
"rx": 6.5,
|
||||
"ry": 4.25,
|
||||
"y": -1,
|
||||
"x": 1
|
||||
},
|
||||
"",
|
||||
""
|
||||
],
|
||||
[
|
||||
{
|
||||
"t": "#000000\n\n\n#529151",
|
||||
"a": 4,
|
||||
"h": 2
|
||||
},
|
||||
"\n\n\nEnter",
|
||||
{
|
||||
"t": "#000000",
|
||||
"a": 7,
|
||||
"h": 2
|
||||
},
|
||||
"",
|
||||
""
|
||||
],
|
||||
[
|
||||
{
|
||||
"x": 2
|
||||
},
|
||||
""
|
||||
],
|
||||
[
|
||||
{
|
||||
"r": -30,
|
||||
"rx": 13,
|
||||
"y": -1,
|
||||
"x": -3
|
||||
},
|
||||
"",
|
||||
""
|
||||
],
|
||||
[
|
||||
{
|
||||
"x": -3
|
||||
},
|
||||
"",
|
||||
{
|
||||
"h": 2
|
||||
},
|
||||
"",
|
||||
{
|
||||
"t": "#000000\n\n\n#529151",
|
||||
"a": 4,
|
||||
"h": 2
|
||||
},
|
||||
"\n\n\nWeb back"
|
||||
],
|
||||
[
|
||||
{
|
||||
"x": -3,
|
||||
"t": "#000000",
|
||||
"a": 7
|
||||
},
|
||||
""
|
||||
]
|
||||
]
|
After Width: | Height: | Size: 57 KiB |
@ -0,0 +1,287 @@
|
||||
#include "ergodox.h"
|
||||
#include "debug.h"
|
||||
#include "action_layer.h"
|
||||
#include "version.h"
|
||||
#include "string.h"
|
||||
|
||||
#ifdef SUBPROJECT_infinity
|
||||
#include "visualizer/lcd_backlight.h"
|
||||
#endif
|
||||
|
||||
|
||||
#define BASE 0 // default layer
|
||||
#define SYMB 1 // symbols
|
||||
#define MDIA 2 // media keys
|
||||
|
||||
#define EPRM M(1) // Macro 1: Reset EEPROM
|
||||
#define HTML_LI M(10)
|
||||
#define HTML_UL M(11)
|
||||
#define HTML_OL M(12)
|
||||
#define HTML_CODE M(13)
|
||||
#define HTML_BR M(14)
|
||||
|
||||
#define SEND_TAG(TAG) do {\
|
||||
send_key(KC_NONUS_BSLASH); \
|
||||
SEND_STRING(TAG); \
|
||||
send_larger_than(); \
|
||||
send_key(KC_NONUS_BSLASH); \
|
||||
SEND_STRING("&"); \
|
||||
SEND_STRING(TAG); \
|
||||
send_larger_than(); \
|
||||
go_back_based_on_tag(TAG); \
|
||||
} while (0)
|
||||
|
||||
#define SEND_SHORT_TAG(TAG) do {\
|
||||
send_key(KC_NONUS_BSLASH); \
|
||||
SEND_STRING(TAG); \
|
||||
SEND_STRING("&"); \
|
||||
send_larger_than(); \
|
||||
} while (0)
|
||||
|
||||
void send_key(uint16_t keycode);
|
||||
void go_back_based_on_tag(char* tag);
|
||||
void send_larger_than(void);
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap 0: Basic layer
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | § | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | ' |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | Del | Q | W | E | R | T | L1 | | L1 | Z | U | I | O | P | ü |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | BkSp | A /L2| S | D | F | G |------| |------| H | J | K | L |ö / L2|ä / Cmd |
|
||||
* |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------|
|
||||
* | LShift |Y/Ctrl|X/Alt | C | V | B | | | | N | M | , |./Alt |-/Ctrl| RShift |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* |< / L1| ^ | $ | Left | Right| | Up | Down |AltGr | ¨ | ~L1 |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | App | LGui | | Alt |Ctrl/Esc|
|
||||
* ,------|------|------| |------+--------+------.
|
||||
* | | | Home | | PgUp | | |
|
||||
* | Space|Backsp|------| |------| Tab |Enter |
|
||||
* | |ace | End | | PgDn | | |
|
||||
* `--------------------' `----------------------'
|
||||
*/
|
||||
// If it accepts an argument (i.e, is a function), it doesn't need KC_.
|
||||
// Otherwise, it needs KC_*
|
||||
[BASE] = KEYMAP( // layer 0 : default
|
||||
// left hand
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT,
|
||||
KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB),
|
||||
KC_BSPC, LT(MDIA, KC_A),KC_S, KC_D, KC_F, KC_G,
|
||||
KC_LSFT, CTL_T(KC_Z), ALT_T(KC_X), KC_C, KC_V, KC_B, ALL_T(KC_NO),
|
||||
LT(SYMB,KC_NONUS_BSLASH), KC_EQL, KC_BSLS, KC_LEFT,KC_RGHT,
|
||||
ALT_T(KC_APP), KC_LGUI,
|
||||
KC_HOME,
|
||||
KC_SPC,KC_BSPC,KC_END,
|
||||
// right hand
|
||||
KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
|
||||
TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
|
||||
KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT),
|
||||
MEH_T(KC_NO),KC_N, KC_M, KC_COMM,ALT_T(KC_DOT), CTL_T(KC_SLSH), KC_RSFT,
|
||||
KC_UP, KC_DOWN,KC_RALT,KC_RBRC, KC_FN1,
|
||||
KC_LALT,CTL_T(KC_ESC),
|
||||
KC_PGUP,
|
||||
KC_PGDN,KC_TAB, KC_ENT
|
||||
),
|
||||
/* Keymap 1: Symbol Layer
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | EPRM | | | | | ? | . | 0 | = | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* | | |------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// SYMBOLS
|
||||
[SYMB] = KEYMAP(
|
||||
// left hand
|
||||
M(0), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
|
||||
KC_TRNS,ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), ACTION_MODS_KEY(MOD_RALT, KC_2), ACTION_MODS_KEY(MOD_RALT, KC_QUOT), ACTION_MODS_KEY(MOD_RALT, KC_BSLS),ACTION_MODS_KEY(MOD_RALT,KC_7),KC_TRNS,
|
||||
KC_TRNS,ACTION_MODS_KEY(MOD_RALT,KC_3),KC_BSLS, ACTION_MODS_KEY(MOD_LSFT, KC_8), ACTION_MODS_KEY(MOD_RSFT, KC_9),ACTION_MODS_KEY(MOD_LSFT,KC_EQL),
|
||||
KC_TRNS,ACTION_MODS_KEY(MOD_LSFT,KC_5),KC_EQL, ACTION_MODS_KEY(MOD_RALT, KC_LBRC), ACTION_MODS_KEY(MOD_RALT, KC_RBRC),ACTION_MODS_KEY(MOD_RALT,KC_EQL),KC_TRNS,
|
||||
KC_TRNS,EPRM,KC_TRNS,KC_NONUS_BSLASH, ACTION_MODS_KEY(MOD_LSFT, KC_NONUS_BSLASH)/*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_UP, KC_7, KC_8, KC_9, ACTION_MODS_KEY(MOD_RSFT,KC_3), KC_F12,
|
||||
KC_DOWN, KC_4, KC_5, KC_6, ACTION_MODS_KEY(MOD_RSFT,KC_1), KC_TRNS,
|
||||
KC_TRNS, ACTION_MODS_KEY(MOD_RSFT,KC_6), KC_1, KC_2, KC_3, ACTION_MODS_KEY(MOD_RALT,KC_NONUS_BSLASH), KC_TRNS,
|
||||
ACTION_MODS_KEY(MOD_RSFT,KC_MINS),KC_DOT, KC_0, KC_EQL, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS
|
||||
),
|
||||
/* Keymap 2: Media and mouse keys
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | RESET | | | | | | | | | | | | | | RESET |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | | | MsUp | | | | | | |H_UL | |H_OL | | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | |MsLeft|MsDown|MsRght| |------| |------| | | |H_LI | | Play |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | |H_CODE| |H_BR | | | | | | | Prev | Next | | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* |Enter | | | | | |Brwser|
|
||||
* | | |------| |------| |Back |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// MEDIA AND MOUSE
|
||||
[MDIA] = KEYMAP(
|
||||
RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, HTML_CODE, KC_TRNS, HTML_BR, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_ENT, KC_TRNS, KC_TRNS,
|
||||
// right hand
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET,
|
||||
KC_TRNS, KC_TRNS, HTML_UL, KC_TRNS, HTML_OL, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, HTML_LI, KC_TRNS, KC_MPLY,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS,
|
||||
KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_WBAK
|
||||
),
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols)
|
||||
};
|
||||
|
||||
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) {
|
||||
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (record->event.pressed) { // For resetting EEPROM
|
||||
eeconfig_init();
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
if (record->event.pressed) {
|
||||
SEND_TAG("li");
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
if (record->event.pressed) {
|
||||
SEND_TAG("ul");
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
if (record->event.pressed) {
|
||||
SEND_TAG("ol");
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
if (record->event.pressed) {
|
||||
SEND_TAG("code");
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
if (record->event.pressed) {
|
||||
SEND_SHORT_TAG("br");
|
||||
}
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
// Runs just one time when the keyboard initializes.
|
||||
void matrix_init_user(void) {
|
||||
|
||||
};
|
||||
|
||||
// Runs constantly in the background, in a loop.
|
||||
void matrix_scan_user(void) {
|
||||
|
||||
uint8_t layer = biton32(layer_state);
|
||||
|
||||
switch (layer) {
|
||||
// TODO: Make this relevant to the ErgoDox EZ.
|
||||
case 0:
|
||||
ergodox_board_led_off();
|
||||
ergodox_right_led_1_off();
|
||||
ergodox_right_led_2_off();
|
||||
ergodox_right_led_3_off();
|
||||
|
||||
#ifdef SUBPROJECT_infinity
|
||||
lcd_backlight_hal_color(0, 0, 0);
|
||||
#endif
|
||||
break;
|
||||
case 1:
|
||||
ergodox_right_led_1_on();
|
||||
|
||||
ergodox_board_led_off();
|
||||
ergodox_right_led_2_off();
|
||||
ergodox_right_led_3_off();
|
||||
#ifdef SUBPROJECT_infinity
|
||||
lcd_backlight_hal_color(5000, 0, 0);
|
||||
#endif
|
||||
break;
|
||||
case 2:
|
||||
ergodox_right_led_2_on();
|
||||
|
||||
ergodox_board_led_off();
|
||||
ergodox_right_led_1_off();
|
||||
ergodox_right_led_3_off();
|
||||
#ifdef SUBPROJECT_infinity
|
||||
lcd_backlight_hal_color(0, 5000, 0);
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
// none
|
||||
break;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
void send_key(uint16_t keycode) {
|
||||
register_code(keycode);
|
||||
unregister_code(keycode);
|
||||
}
|
||||
|
||||
void go_back_based_on_tag(char* tag) {
|
||||
const int BRACKETS_AND_SLASH_LENGTH = 3;
|
||||
|
||||
for (int i=0; i < strlen(tag) + BRACKETS_AND_SLASH_LENGTH; i++) {
|
||||
send_key(KC_LEFT);
|
||||
}
|
||||
}
|
||||
|
||||
void send_larger_than() {
|
||||
register_code(KC_LSFT);
|
||||
send_key(KC_NONUS_BSLASH);
|
||||
unregister_code(KC_LSFT);
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
# ErgoDox Swiss German Configuration
|
||||
|
||||
Swiss German keyboard layout based on the Ergodox EZ default layout.
|
||||
|
||||
Keyboard diagrams created with the [keyboard layout editor](http://www.keyboard-layout-editor.com).
|
||||
|
||||
Diagram sources: [default layer](keyboard-layout.json), [layer 1 & 2](keyboard-layout_1_2.json)
|
||||
|
||||
![Layout Layer 0](keyboard-layout.png)
|
||||
![Layout Layer 1&2](keyboard-layout_1_2.png)
|
||||
|
||||
## Changelog
|
||||
* Jan 21, 2017:
|
||||
* Initial version based on default layout.
|
||||
|
@ -0,0 +1,112 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# 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".
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
# MCU name
|
||||
#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
|
||||
|
||||
|
||||
#
|
||||
# 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
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
# CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
# COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE ?= yes # USB 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 ?= YES # MIDI controls
|
||||
# UNICODE_ENABLE ?= YES # Unicode
|
||||
# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE ?= yes # Enable RGB Underglow
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
||||
|
@ -0,0 +1,187 @@
|
||||
/*
|
||||
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 geekhack
|
||||
#define PRODUCT GH60
|
||||
#define DESCRIPTION t.m.k. keyboard firmware for GH60
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 5
|
||||
#define MATRIX_COLS 14
|
||||
|
||||
/*
|
||||
* 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 { D0, D1, D2, D3, D5 }
|
||||
#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B7, B5, B4, D7, D6, B3 }
|
||||
#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
|
||||
|
||||
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* number of backlight levels */
|
||||
#define BACKLIGHT_LEVELS 3
|
||||
|
||||
/* 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
|
||||
|
||||
/*
|
||||
* RGB Underglow
|
||||
* These settings are for the F4 by default:
|
||||
*
|
||||
*
|
||||
* #define ws2812_PORTREG PORTF
|
||||
* #define ws2812_DDRREG DDRF
|
||||
* #define ws2812_pin PF4
|
||||
* #define RGBLED_NUM 14 // Number of LEDs
|
||||
* #define RGBLIGHT_HUE_STEP 10
|
||||
* #define RGBLIGHT_SAT_STEP 17
|
||||
* #define RGBLIGHT_VAL_STEP 17
|
||||
*
|
||||
* The firmware supports 5 different light effects, and the color (hue, saturation, brightness) can be customized in most effects.
|
||||
* To control the underglow, you need to modify your keymap file to assign those functions to some keys/key combinations.
|
||||
* For details, please check this keymap. keyboard/planck/keymaps/yang/keymap.c
|
||||
*/
|
||||
|
||||
/* Deprecated code below
|
||||
#define ws2812_PORTREG PORTF
|
||||
#define ws2812_DDRREG DDRF
|
||||
#define ws2812_pin PF4
|
||||
*/
|
||||
#define RGB_DI_PIN F4
|
||||
#define RGBLIGHT_ANIMATIONS
|
||||
#define RGBLED_NUM 11 // Number of LEDs
|
||||
#define RGBLIGHT_HUE_STEP 8
|
||||
#define RGBLIGHT_SAT_STEP 8
|
||||
#define RGBLIGHT_VAL_STEP 8
|
||||
#endif
|
@ -0,0 +1,198 @@
|
||||
#include "gh60.h"
|
||||
#include "action_layer.h"
|
||||
#include "rgblight.h"
|
||||
|
||||
#define _DEFAULT 0
|
||||
#define _FN 1
|
||||
#define _WASD 2
|
||||
#define _SFX 3
|
||||
|
||||
//bool esc_led_on;
|
||||
|
||||
enum planck_keycodes {
|
||||
DEFAULT = SAFE_RANGE
|
||||
};
|
||||
|
||||
// Fillers to make layering more clear
|
||||
#define ______ KC_TRNS
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Qwerty gui/alt/space/alt/gui
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Bksp |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | Enter |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Shift | Z | X | C | V | B | N | M | , | . | / | RShift | FN |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* |LGUI | LAlt | Space | RAlt |RGUI |
|
||||
* `-----------------------------------------------------------------'
|
||||
*/
|
||||
[_DEFAULT] = KEYMAP_HHKB( /* Basic QWERTY */
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \
|
||||
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FN), \
|
||||
______, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, ______, ______ \
|
||||
),
|
||||
|
||||
/* FN Layer
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | CAPS | | | | | | | | Psc | Slck| Paus| Up | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | Vol-| Vol+| Mute| | | * | / | Home| PgUp| Left|Right| |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | Prev| Play| Next| | | + | - | End |PgDn| Down| | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | Stop | |
|
||||
* `-----------------------------------------------------------------'
|
||||
*/
|
||||
[_FN] = KEYMAP_HHKB( /* Layer 1 */
|
||||
TG(_SFX),KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \
|
||||
KC_CAPS, ______, ______, ______, ______, ______, ______, ______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, ______, ______, \
|
||||
______, KC_VOLD, KC_VOLU, KC_MUTE, ______, ______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT,______, \
|
||||
______, KC_MPRV, KC_MPLY, KC_MNXT, ______, ______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, ______, ______, \
|
||||
______, ______, ______, TG(_WASD), KC_MSTP, ______, ______, ______ \
|
||||
),
|
||||
|
||||
/* WASD Layer
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | Up | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | Left| Down|Right| | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | |
|
||||
* `-----------------------------------------------------------------'
|
||||
*/
|
||||
[_WASD] = KEYMAP_HHKB( /* Layer 2 */
|
||||
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
|
||||
______, ______, KC_UP, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
|
||||
______, KC_LEFT, KC_DOWN,KC_RGHT,______, ______, ______, ______, ______, ______, ______, ______, ______, \
|
||||
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,______, \
|
||||
______, ______, ______, ______, ______, ______, ______, ______ \
|
||||
),
|
||||
|
||||
/* SFX Layer
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | BL- | BL+ | BL | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | RGBT| RGBM| | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | Hue+| Hue-| Sat+| Sat-| Val+| Val-| | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | |
|
||||
* `-----------------------------------------------------------------'
|
||||
*/
|
||||
[_SFX] = KEYMAP_HHKB(
|
||||
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
|
||||
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
|
||||
______, F(0), F(1), ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
|
||||
______, F(2), F(3), F(4), F(5), F(6), F(7), ______, ______, ______, ______, ______, ______, \
|
||||
______, ______, ______, ______, ______, ______, ______, ______ \
|
||||
)
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
// MACRODOWN only works in this function
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
enum function_id {
|
||||
RGBLED_TOGGLE,
|
||||
RGBLED_STEP_MODE,
|
||||
RGBLED_INCREASE_HUE,
|
||||
RGBLED_DECREASE_HUE,
|
||||
RGBLED_INCREASE_SAT,
|
||||
RGBLED_DECREASE_SAT,
|
||||
RGBLED_INCREASE_VAL,
|
||||
RGBLED_DECREASE_VAL
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[0] = ACTION_FUNCTION(RGBLED_TOGGLE),
|
||||
[1] = ACTION_FUNCTION(RGBLED_STEP_MODE),
|
||||
[2] = ACTION_FUNCTION(RGBLED_INCREASE_HUE),
|
||||
[3] = ACTION_FUNCTION(RGBLED_DECREASE_HUE),
|
||||
[4] = ACTION_FUNCTION(RGBLED_INCREASE_SAT),
|
||||
[5] = ACTION_FUNCTION(RGBLED_DECREASE_SAT),
|
||||
[6] = ACTION_FUNCTION(RGBLED_INCREASE_VAL),
|
||||
[7] = ACTION_FUNCTION(RGBLED_DECREASE_VAL)
|
||||
};
|
||||
|
||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
switch (id) {
|
||||
case RGBLED_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
rgblight_toggle();
|
||||
}
|
||||
break;
|
||||
case RGBLED_INCREASE_HUE:
|
||||
if (record->event.pressed) {
|
||||
rgblight_increase_hue();
|
||||
}
|
||||
break;
|
||||
case RGBLED_DECREASE_HUE:
|
||||
if (record->event.pressed) {
|
||||
rgblight_decrease_hue();
|
||||
}
|
||||
break;
|
||||
case RGBLED_INCREASE_SAT:
|
||||
if (record->event.pressed) {
|
||||
rgblight_increase_sat();
|
||||
}
|
||||
break;
|
||||
case RGBLED_DECREASE_SAT:
|
||||
if (record->event.pressed) {
|
||||
rgblight_decrease_sat();
|
||||
}
|
||||
break;
|
||||
case RGBLED_INCREASE_VAL:
|
||||
if (record->event.pressed) {
|
||||
rgblight_increase_val();
|
||||
}
|
||||
break;
|
||||
case RGBLED_DECREASE_VAL:
|
||||
if (record->event.pressed) {
|
||||
rgblight_decrease_val();
|
||||
}
|
||||
break;
|
||||
case RGBLED_STEP_MODE:
|
||||
if (record->event.pressed) {
|
||||
rgblight_step();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
uint32_t layer = layer_state;
|
||||
|
||||
if (layer & (1<<1)) {
|
||||
gh60_fn_led_on();
|
||||
} else {
|
||||
gh60_fn_led_off();
|
||||
}
|
||||
|
||||
if (layer & (1<<2)) {
|
||||
gh60_wasd_leds_on();
|
||||
} else {
|
||||
gh60_wasd_leds_off();
|
||||
}
|
||||
|
||||
if (layer & (1<<3)) {
|
||||
gh60_esc_led_on();
|
||||
} else {
|
||||
gh60_esc_led_off();
|
||||
}
|
||||
};
|
@ -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,26 @@
|
||||
#include "gonnerd.h"
|
||||
|
||||
#define __x__ KC_NO
|
||||
|
||||
// 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, __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_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL \
|
||||
),
|
||||
|
||||
[1] = KEYMAP_60( /* System layer to have access to RESET button */
|
||||
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,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,108 @@
|
||||
#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(
|
||||
F(0), 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(2), 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__ \
|
||||
),
|
||||
};
|
||||
|
||||
enum function_id {
|
||||
ESC_GRV, // Makes Esc behave like `~ when pressed with the left GUI modifier. This is the "switch between windows of the same application" key combination in macOS
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[0] = ACTION_FUNCTION(ESC_GRV),
|
||||
};
|
||||
|
||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
static uint8_t esc_grv_mask;
|
||||
switch (id) {
|
||||
case ESC_GRV:
|
||||
esc_grv_mask = get_mods() & MOD_BIT(KC_LGUI);
|
||||
if (record->event.pressed) {
|
||||
if (esc_grv_mask) {
|
||||
add_key(KC_GRV);
|
||||
send_keyboard_report();
|
||||
} else {
|
||||
add_key(KC_ESC);
|
||||
send_keyboard_report();
|
||||
}
|
||||
} else {
|
||||
if (esc_grv_mask) {
|
||||
del_key(KC_GRV);
|
||||
send_keyboard_report();
|
||||
} else {
|
||||
del_key(KC_ESC);
|
||||
send_keyboard_report();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
@ -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,38 @@
|
||||
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!_
|
||||
|
||||
## Reset button
|
||||
|
||||
To run the `make dfu` command to flash keymaps onto the board, you need to put the board into DFU mode. As the GON NerD PCBs do not have a reset button on the board to put it into DFU mode, be sure to include a `RESET` button on your keymap. Otherwise you'll have to unscrew your keyboard from the case and short the GND and RST pins.
|
||||
|
||||
## 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"
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
{ KC_A }
|
||||
{{ KC_A }}
|
||||
};
|
||||
|
@ -1,6 +1,38 @@
|
||||
#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();
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
void rgbsps_set(uint8_t index, uint8_t r, uint8_t g, uint8_t b);
|
||||
void rgbsps_setall(uint8_t r, uint8_t g, uint8_t b);
|
||||
void rgbsps_turnoff(void);
|
||||
void rgbsps_send(void);
|
||||
void rgbsps_send(void);
|
||||
void rgbsps_sethsv(uint8_t index, uint16_t hue, uint8_t sat, uint8_t val);
|
@ -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"
|
||||
|
||||
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 = alvicstep
|
||||
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
||||
endif
|
||||
|
@ -0,0 +1,3 @@
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../../Makefile
|
||||
endif
|
@ -0,0 +1,105 @@
|
||||
#include "kinesis.h"
|
||||
|
||||
// begin section origin https://github.com/alvicstep/tmk_keyboard
|
||||
|
||||
void all_led_off(void)
|
||||
{
|
||||
PORTD = 0b11111111;
|
||||
}
|
||||
|
||||
void all_led_on(void)
|
||||
{
|
||||
PORTD = 0b00000000;
|
||||
}
|
||||
void num_lock_led_on(void)
|
||||
{
|
||||
PORTD = 0b11101111;
|
||||
}
|
||||
|
||||
void caps_lock_led_on(void)
|
||||
{
|
||||
PORTD = 0b01111111;
|
||||
}
|
||||
|
||||
void scroll_lock_led_on(void)
|
||||
{
|
||||
PORTD = 0b11011111;
|
||||
}
|
||||
void keypad_led_on(void)
|
||||
{
|
||||
PORTD = 0b10111111;
|
||||
}
|
||||
void blink_all_leds(void)
|
||||
{
|
||||
all_led_on();
|
||||
_delay_ms(500);
|
||||
|
||||
all_led_off();
|
||||
_delay_ms(100);
|
||||
|
||||
caps_lock_led_on();
|
||||
_delay_ms(100);
|
||||
|
||||
num_lock_led_on();
|
||||
_delay_ms(100);
|
||||
|
||||
scroll_lock_led_on();
|
||||
_delay_ms(100);
|
||||
|
||||
keypad_led_on();
|
||||
_delay_ms(100);
|
||||
|
||||
//back
|
||||
|
||||
scroll_lock_led_on();
|
||||
_delay_ms(100);
|
||||
|
||||
num_lock_led_on();
|
||||
_delay_ms(100);
|
||||
|
||||
caps_lock_led_on();
|
||||
_delay_ms(100);
|
||||
|
||||
all_led_off();
|
||||
}
|
||||
|
||||
// End section origin https://github.com/alvicstep/tmk_keyboard
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
blink_all_leds();
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
|
||||
void matrix_scan_kb(void) {
|
||||
// put your looping keyboard code here
|
||||
// runs every cycle (a lot)
|
||||
|
||||
matrix_scan_user();
|
||||
}
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
// put your per-action keyboard code here
|
||||
// runs for every action, just before processing by the firmware
|
||||
|
||||
return process_record_user(keycode, record);
|
||||
}
|
||||
|
||||
void led_set_kb(uint8_t usb_led) {
|
||||
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||
|
||||
//Copyright 2014 Warren Janssens <warren.janssens@gmail.com>
|
||||
uint8_t leds = 0xF0;
|
||||
if (usb_led & 1 << USB_LED_NUM_LOCK)
|
||||
leds &= ~0x10;
|
||||
if (usb_led & 1 << USB_LED_CAPS_LOCK)
|
||||
leds &= ~0x80;
|
||||
if (usb_led & 1 << USB_LED_SCROLL_LOCK)
|
||||
leds &= ~0x20;
|
||||
PORTD = (PORTD & 0x0F) | leds;
|
||||
|
||||
led_set_user(usb_led);
|
||||
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,67 @@
|
||||
#ifndef KINESIS_ALVICSTEP_H
|
||||
#define KINESIS_ALVICSTEP_H
|
||||
|
||||
#include "../kinesis.h"
|
||||
|
||||
|
||||
#define KEYMAP( \
|
||||
k02,k22,k12,k01,k21,k11,k00,k20,k10, \
|
||||
k80,k70,k60,k50,k40,k30, \
|
||||
k81,k71,k61,k51,k41,k31, \
|
||||
k82,k72,k62,k52,k42,k32, \
|
||||
k83,k73,k63,k53,k43,k33, \
|
||||
k74,k64,k54,k34, \
|
||||
k36,k35, \
|
||||
k55, \
|
||||
k56,k46,k75, \
|
||||
k03,k23,k13,k04,k24,k14,k05,k85,k84, \
|
||||
k94,kA4,kB4,kD4,kE4,kF4, \
|
||||
k95,kA5,kB5,kD5,kE5,kF5, \
|
||||
k96,kA6,kB6,kD6,kE6,kF6, \
|
||||
k97,kA7,kB7,kD7,kE7,kF7, \
|
||||
k93,kB3,kD3,kE3, \
|
||||
k47,k66, \
|
||||
k67, \
|
||||
k87,k76,k86 \
|
||||
) { \
|
||||
{ k00, k01, k02, k03, k04, k05, KC_NO, KC_NO }, \
|
||||
{ k10, k11, k12, k13, k14, KC_NO, KC_NO, KC_NO }, \
|
||||
{ k20, k21, k22, k23, k24, KC_NO, KC_NO, KC_NO }, \
|
||||
{ k30, k31, k32, k33, k34, k35, k36, KC_NO }, \
|
||||
{ k40, k41, k42, k43, KC_NO, KC_NO, k46, k47 }, \
|
||||
{ k50, k51, k52, k53, k54, k55, k56, KC_NO }, \
|
||||
{ k60, k61, k62, k63, k64, KC_NO, k66, k67 }, \
|
||||
{ k70, k71, k72, k73, k74, k75, k76, KC_NO }, \
|
||||
{ k80, k81, k82, k83, k84, k85, k86, k87}, \
|
||||
{ KC_NO, KC_NO ,KC_NO ,k93, k94, k95, k96, k97}, \
|
||||
{ KC_NO, KC_NO ,KC_NO ,KC_NO, kA4, kA5, kA6, kA7}, \
|
||||
{ KC_NO, KC_NO ,KC_NO ,kB3, kB4, kB5, kB6, kB7}, \
|
||||
{ KC_NO, KC_NO ,KC_NO ,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO}, \
|
||||
{ KC_NO, KC_NO ,KC_NO ,kD3, kD4, kD5, kD6, kD7}, \
|
||||
{ KC_NO, KC_NO ,KC_NO ,kE3, kE4, kE5, kE6, kE7}, \
|
||||
{ KC_NO, KC_NO ,KC_NO ,KC_NO, kF4, kF5, kF6, kF7} \
|
||||
}
|
||||
|
||||
|
||||
/* Row pin configuration
|
||||
PF0 A
|
||||
PF1 B
|
||||
PF2 C
|
||||
PF3 G 0 = U4, 1 = U5
|
||||
|
||||
|
||||
r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 rA rB rC rD rE rF
|
||||
PB0 c0| f6 f8 f7 5 4 3 2 1 =+
|
||||
PB1 c1| f3 f5 f4 t r e w q TAB
|
||||
PB2 c2| ESC f2 f1 g f d s a CL
|
||||
PB3 c3| f9 f11 f10 b v c x z LS UP DN [{ ]}
|
||||
PB4 c4| f12 SL PS RT LT §± `~ 6 7 8 9 0 -_
|
||||
PB5 c5| PB PGM KPD y u i o p \
|
||||
PB6 c6| LC DL BS RC EN SP h j k l ;: '"
|
||||
PB7 c7| RA PU PD n m ,< .> /? RS
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
@ -0,0 +1,35 @@
|
||||
#ifndef ALVICSTEP_CONFIG_H
|
||||
#define ALVICSTEP_CONFIG_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define PRODUCT_ID 0x6060
|
||||
#define DEVICE_VER 0x0001
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 16
|
||||
#define MATRIX_COLS 8
|
||||
|
||||
/*
|
||||
* 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)
|
||||
*
|
||||
*/
|
||||
//Passed through the port multipler, so 4 pins =16
|
||||
#define MATRIX_ROW_PINS { F0,F1, F2, F3 }
|
||||
|
||||
// May be upside down.
|
||||
#define MATRIX_COL_PINS { B0,B1, B2, B3, B4, B5, B6, B7 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
|
||||
#endif
|
Before Width: | Height: | Size: 174 KiB After Width: | Height: | Size: 174 KiB |
Before Width: | Height: | Size: 336 KiB After Width: | Height: | Size: 336 KiB |
Before Width: | Height: | Size: 260 KiB After Width: | Height: | Size: 260 KiB |
Before Width: | Height: | Size: 171 KiB After Width: | Height: | Size: 171 KiB |
@ -0,0 +1,46 @@
|
||||
kinesis-advantage keyboard firmware
|
||||
======================
|
||||
|
||||
This directory is called alvicstep because https://github.com/alvicstep did the heavy work and took the photos in the doc directory.
|
||||
alvicstep did NOT do anything related to the QMK implementation, so don't bug him/her.
|
||||
|
||||
There are other ways of replacing the CPU in the kinesis, this one uses jumper wires from the Teensy to the original DIP socket
|
||||
|
||||
|
||||
## Kinesis specific information
|
||||
This is a port of https://github.com/alvicstep/tmk_keyboard,
|
||||
which is a fork of https://github.com/wjanssens/tmk_keyboard,
|
||||
which is based on work from https://github.com/chrisandreae/keyboard-firmware
|
||||
|
||||
If you replace the kinesis CPU as described in the doc folder, then this code should allow you to use QMK.
|
||||
I've tested with a Teensy 2++, remember to change the CPU if you use a 32u4 instead.
|
||||
|
||||
Not yet implemented:
|
||||
- Kinesis EEProm reading or writing
|
||||
- Audio - this should be simple if we remove hardcoded pins from audio.h and switch to E7
|
||||
|
||||
|
||||
|
||||
## Quantum MK Firmware
|
||||
|
||||
For the full Quantum feature list, see [the parent readme.md](/doc/readme.md).
|
||||
|
||||
## Building
|
||||
|
||||
Download or clone the whole firmware and navigate to the keyboards/kinesis-advantage 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 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 `keymap` option like:
|
||||
|
||||
$ make keymap=[default|jack|<name>]
|
||||
|
||||
Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/`
|
@ -0,0 +1,10 @@
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../Makefile
|
||||
endif
|
||||
|
||||
# just silently stop, since we need to upload with teensy uploader
|
||||
upload: build
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,93 @@
|
||||
#include "kinesis.h"
|
||||
|
||||
#define _DVORAK 0 // Base Dvorak layer
|
||||
#define _MEDIA 1 // Media layer
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[_DVORAK] = KEYMAP(
|
||||
// left hand
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8,
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5,
|
||||
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y,
|
||||
KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I,
|
||||
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X,
|
||||
KC_ESC, KC_LBRC, KC_DOWN, KC_UP,
|
||||
// left thumb
|
||||
KC_LGUI, KC_LCTL,
|
||||
KC_LALT,
|
||||
KC_BSPC, KC_DEL, TG(_MEDIA),
|
||||
// right hand
|
||||
KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, KC_FN0, KC_1,
|
||||
KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL,
|
||||
KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH,
|
||||
KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS,
|
||||
KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT,
|
||||
KC_LEFT, KC_RIGHT, KC_RBRC, KC_BSLS,
|
||||
// right thumb
|
||||
KC_RCTL, KC_RGUI,
|
||||
KC_RALT,
|
||||
TG(_MEDIA), KC_ENT, KC_SPC
|
||||
),
|
||||
|
||||
[_MEDIA] = KEYMAP(
|
||||
// left hand
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, KC_BTN4, KC_BTN3, KC_BTN2, KC_BTN1, KC_NO,
|
||||
KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO,
|
||||
KC_NO, KC_NO, KC_MS_D, KC_MS_U,
|
||||
// left thumb
|
||||
KC_NO, KC_NO,
|
||||
KC_NO,
|
||||
KC_NO, KC_NO, KC_TRNS,
|
||||
// right hand
|
||||
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_POWER,
|
||||
KC_NO, KC_VOLU, KC_MS_U, KC_VOLD, KC_NO, KC_NO,
|
||||
KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, KC_NO,
|
||||
KC_NO, KC_MPRV, KC_MPLY, KC_MNXT, KC_NO, KC_NO,
|
||||
KC_MS_L, KC_MS_R, KC_NO, KC_NO,
|
||||
// right thumb
|
||||
KC_NO, KC_NO,
|
||||
KC_NO,
|
||||
KC_TRNS, KC_ENT, KC_NO
|
||||
)
|
||||
};
|
||||
|
||||
|
||||
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);
|
||||
} else {
|
||||
unregister_code(KC_RSFT);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
|
||||
void matrix_init_user(void) {
|
||||
|
||||
}
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
|
||||
}
|
@ -0,0 +1,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,8 @@
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "../../config.h"
|
||||
|
||||
// place overrides here
|
||||
|
||||
#endif
|
@ -0,0 +1,384 @@
|
||||
#include "kinesis.h"
|
||||
#include "action_layer.h"
|
||||
#include "mousekey.h"
|
||||
|
||||
#define _QWERTY 0 // Base qerty
|
||||
#define _SYMB 1// Symbol layer
|
||||
#define _MOUSE 2//
|
||||
#define _TRANS 3//
|
||||
#define _SYMB2 4// old symbol level, more ergodox like
|
||||
|
||||
// Fillers to make layering more clear
|
||||
#define _______ KC_TRNS
|
||||
#define XXXXXXX KC_NO
|
||||
|
||||
/* Macros */
|
||||
enum {
|
||||
NONE = 0,
|
||||
// Diagonal mouse movement
|
||||
A_MUL,
|
||||
A_MUR,
|
||||
A_MDL,
|
||||
A_MDR,
|
||||
};
|
||||
|
||||
|
||||
// Train out of using uncomfortable esc and GUI keys.
|
||||
/****************************************************************************************************
|
||||
*
|
||||
* Keymap: Default Layer in Qwerty
|
||||
*
|
||||
* ,-------------------------------------------------------------------------------------------------------------------.
|
||||
* | no | F1 | F2 | F3 | F4 | F5 | F6 | F8 | F9 | F10 | F12 | FN0 | FN1 | FN2 | | bOOT |
|
||||
* |--------+------+------+------+------+------+---------------------------+------+------+------+------+------+--------|
|
||||
* | `~ | 1! | 2@ | 3# | 4$ | 5% | | 6^ | 7& | 8* | 9( | 0) | -_ |
|
||||
* |--------+------+------+------+------+------| +------+------+------+------+------+--------|
|
||||
* | Tab | Q | W | E | R | T | | Y | U | I | O | P | \| |
|
||||
* |--------+------+------+------+------+------| |------+------+------+------+------+--------|
|
||||
* |MouseFN0| A | S | D | F | G | | H | J | K | L | ;: | '" |
|
||||
* |--------+------+------+------+------+------| |------+------+------+------+------+--------|
|
||||
* | Shift | Z | X | C | V | B | | N | M | ,< | .> | /? | Shift |
|
||||
* `--------+------+------+------+------+------- `------+------+------+------+------+--------'
|
||||
* | ~` | ESC |GUI/L |L1/RT | | L1/UP|GUI/DN| [{ | ]} |
|
||||
* `---------------------------' `---------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | CTRL | ALT | | ALT | GUI |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | Del | | PgUp | | |
|
||||
* | BkSp | BkSp |------| |------|Return| Space|
|
||||
* | | | FN0 | | PgDn | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[_QWERTY] = KEYMAP(
|
||||
XXXXXXX, KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8,
|
||||
KC_GRAVE, KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,
|
||||
KC_TAB, KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,
|
||||
KC_FN0 ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,
|
||||
KC_LSFT,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,
|
||||
KC_GRAVE, KC_ESC, KC_FN4, KC_FN5,
|
||||
KC_LCTL,KC_LALT,
|
||||
KC_DEL,
|
||||
KC_BSPC, KC_DEL ,KC_FN0 ,
|
||||
KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,KC_FN0 ,KC_FN1 ,KC_FN2, KC_NO, RESET,
|
||||
KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_MINS,
|
||||
KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_BSLS,
|
||||
KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN,KC_QUOT,
|
||||
KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSFT,
|
||||
KC_FN6, KC_FN7, KC_LBRC ,KC_RBRC,
|
||||
KC_RALT,KC_RGUI,
|
||||
KC_PGUP,
|
||||
KC_PGDN,KC_ENTER ,KC_SPC
|
||||
),
|
||||
|
||||
|
||||
/* _SYMB level, more planck like. Much work to make sequences into multi-finger rolls. eg ([1,0]), !=0
|
||||
* Also sorted by frequency / strength of finger.
|
||||
*
|
||||
* ,-------------------------------------------------------------------------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+------+---------------------------+------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+------| +------+------+------+------+------+--------|
|
||||
* | | ^ | { | } | @ | % | | & | [ | ( | ) | _ | \ |
|
||||
* |--------+------+------+------+------+------| +------+------+------+------+------+--------|
|
||||
* | | ! | # | 0 | = | ~ | | * | + | 1 | - | ] | ` |
|
||||
* |--------+------+------+------+------+------| |------+------+------+------+------+--------|
|
||||
* | | 6 | 7 | 8 | 9 | pipe | | $ | 2 | 3 | 4 | 5 | |
|
||||
* `--------+------+------+------+------+------- `------+------+------+------+------+--------'
|
||||
* | | : |GUI/L |L1/RT | | L1/UP|GUI/DN| \ | |
|
||||
* `---------------------------' `---------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | CTRL | | | ALT | GUI |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* | Cut | Paste|------| |------| | |
|
||||
* | | |Reset | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
|
||||
|
||||
|
||||
[_SYMB] = KEYMAP(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
_______, KC_CIRC, KC_LCBR, KC_RCBR, KC_AT, KC_PERC,
|
||||
_______, KC_EXLM, KC_HASH, KC_0, KC_EQL, KC_TILD,
|
||||
_______, KC_6, KC_7, KC_8, KC_9, KC_PIPE,
|
||||
_______, KC_COLON, KC_FN4, KC_FN5,
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, _______, RESET,
|
||||
_______, _______, _______, _______, _______, _______, _______, KC_FN0, KC_2,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
KC_AMPR, KC_LBRC, KC_LPRN, KC_RPRN, KC_UNDS, _______,
|
||||
KC_ASTR, KC_PLUS, KC_1, KC_MINS, KC_RBRC, KC_GRV,
|
||||
KC_DLR, KC_2, KC_3, KC_4, KC_5, XXXXXXX,
|
||||
KC_FN6, KC_FN7, KC_BSLS, XXXXXXX,
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, _______, _______
|
||||
),
|
||||
|
||||
|
||||
/* _SYMB2ol level, more ergodox like
|
||||
*
|
||||
* ,-------------------------------------------------------------------------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+------+---------------------------+------+------+------+------+------+--------|
|
||||
* | | | * | # | | | | | | | | | |
|
||||
* |--------+------+------+------+------+------| +------+------+------+------+------+--------|
|
||||
* | | / | < | > | | | | | | + | * | | |
|
||||
* |--------+------+------+------+------+------| |------+------+------+------+------+--------|
|
||||
* | | | { | } | | | | | | = | - | | |
|
||||
* |--------+------+------+------+------+------| |------+------+------+------+------+--------|
|
||||
* | | = | ( | ) | | | | | | | | | | |
|
||||
* `--------+------+------+------+------+------- `------+------+------+------+------+--------'
|
||||
* | | |GUI/L |L1/RT | | L1/UP|GUI/DN| { | } |
|
||||
* `---------------------------' `---------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | CTRL | | | ALT | GUI |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* | BkSp | Del |------| |------|Mouse1|Mouse2|
|
||||
* | | |Reset | | |LClick|Rclick|
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
|
||||
|
||||
|
||||
[_SYMB2] = KEYMAP(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, KC_ASTR, KC_HASH, _______, _______,
|
||||
_______, KC_SLSH, RSFT(KC_COMM), RSFT(KC_DOT), _______, _______,
|
||||
_______, _______, RSFT(KC_LBRC), RSFT(KC_RBRC), _______, _______,
|
||||
_______, KC_EQL, RSFT(KC_9), RSFT(KC_0), _______, _______,
|
||||
_______, _______, KC_FN4, KC_FN5,
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, _______, RESET,
|
||||
_______, _______, _______, _______, _______, _______, _______, KC_FN0, KC_2,
|
||||
_______, _______, _______, KC_ASTR, _______, _______,
|
||||
_______, _______, KC_PLUS, KC_MINS, _______, _______,
|
||||
_______, _______, KC_EQL, KC_PIPE, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
KC_FN6, KC_FN7, _______, _______,
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, _______, _______
|
||||
),
|
||||
/* Keymap: Movement and function layer
|
||||
*
|
||||
* ,-------------------------------------------------------------------------------------------------------------------.
|
||||
* | Caps | F1 | F2 | F3 | F4 | F5 | F6 | F8 | F9 | F10 | F12 | FN0 | FN1 | FN2 | Tada | bOOT |
|
||||
* |--------+------+------+------+------+------+---------------------------+------+------+------+------+------+--------|
|
||||
* | =+ | ! | @ | # | $ | % | | ^ | & | * | ( | ) |MS Fast |
|
||||
* |--------+------+------+------+------+------| +------+------+------+------+------+--------|
|
||||
* | Tab | | | | |PgUp | | MwU |MS_UL | MS_U |MS_UR | | Ms Norm|
|
||||
* |--------+------+------+------+------+------| |------+------+------+------+------+--------|
|
||||
* |MouseFN1|GUI_V |GUI X |GUI C |GUI_V | | | | MS_L |Mouse1| MS_R | |MS Slow |
|
||||
* |--------+------+------+------+------+------| |------+------+------+------+------+--------|
|
||||
* | | | | | |PgDown| | MWD | MDown|MS Dwn|MS_DR | ? | |
|
||||
* `--------+------+------+------+------+------- `------+------+------+------+------+--------'
|
||||
* | `~ | ESC | | | | | | { | } |
|
||||
* `---------------------------' `---------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | CTRL | GUI | | ALT | GUI |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | Home | | PgUp | | |
|
||||
* | BkSp | Del |------| |------|Mouse1|Mouse2|
|
||||
* | | | End | | PgDn |LClick|Rclick|
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
|
||||
|
||||
[_MOUSE] = KEYMAP(
|
||||
KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, KC_EXLM ,KC_AT, KC_HASH, KC_DLR ,KC_PERC ,
|
||||
_______, KC_NO, KC_NO, KC_UP, KC_NO, KC_PGUP,
|
||||
KC_FN1, LGUI(KC_Z),LGUI(KC_X),LGUI(KC_C),LGUI(KC_V), KC_NO,
|
||||
_______, KC_NO, KC_NO, KC_UP, KC_NO, KC_PGDN,
|
||||
_______, _______, KC_NO, KC_NO,
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, KC_FN0,RESET,
|
||||
KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_ACL2,
|
||||
KC_WH_U, M(A_MUL), KC_MS_U, M(A_MUR), KC_NO, KC_ACL1,
|
||||
KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, KC_ACL0,
|
||||
KC_WH_D, M(A_MDL), KC_MS_D, M(A_MDR), RSFT(KC_LBRC), RSFT(KC_RBRC),
|
||||
KC_LCBR, KC_RCBR, KC_NO, KC_NO,
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, KC_BTN1, KC_BTN2
|
||||
),
|
||||
|
||||
|
||||
|
||||
/* EMPTY
|
||||
*
|
||||
* ,-------------------------------------------------------------------------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | | | bOOT |
|
||||
* |--------+------+------+------+------+------+---------------------------+------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+------| +------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+------| |------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+------| |------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | | | |
|
||||
* `--------+------+------+------+------+------- `------+------+------+------+------+--------'
|
||||
* | | | | | | | | | |
|
||||
* `---------------------------' `---------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | Ctrl | Alt | | Gui | Ctrl |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | Home | | PgUp | | |
|
||||
* | BkSp | Del |------| |------|Mouse1|Mouse2|
|
||||
* | | | End | | PgDn |LClick|Rclick|
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
|
||||
|
||||
|
||||
[_TRANS] = KEYMAP(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______,
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, KC_FN0, KC_2,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______,
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, _______, _______
|
||||
),
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[0] = ACTION_LAYER_TAP_TOGGLE(_MOUSE) ,
|
||||
[1] = ACTION_LAYER_TOGGLE(_MOUSE) ,
|
||||
[2] = ACTION_LAYER_TAP_TOGGLE(_SYMB) ,
|
||||
[5]= ACTION_LAYER_TAP_KEY(_SYMB,KC_RIGHT),
|
||||
[4]= ACTION_MODS_TAP_KEY(MOD_LGUI,KC_LEFT),
|
||||
[6]= ACTION_LAYER_TAP_KEY(_SYMB,KC_UP),
|
||||
[7]= ACTION_MODS_TAP_KEY(MOD_LGUI,KC_DOWN),
|
||||
|
||||
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
// MACRODOWN only works in this function
|
||||
switch(id) {
|
||||
case 0:
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_RSFT);
|
||||
} else {
|
||||
unregister_code(KC_RSFT);
|
||||
}
|
||||
break;
|
||||
|
||||
// from algernon's ErgoDox EZ layout,
|
||||
case A_MUL:
|
||||
if (record->event.pressed) {
|
||||
mousekey_on(KC_MS_UP);
|
||||
mousekey_on(KC_MS_LEFT);
|
||||
} else {
|
||||
mousekey_off(KC_MS_UP);
|
||||
mousekey_off(KC_MS_LEFT);
|
||||
}
|
||||
mousekey_send();
|
||||
break;
|
||||
|
||||
case A_MUR:
|
||||
if (record->event.pressed) {
|
||||
mousekey_on(KC_MS_UP);
|
||||
mousekey_on(KC_MS_RIGHT);
|
||||
} else {
|
||||
mousekey_off(KC_MS_UP);
|
||||
mousekey_off(KC_MS_RIGHT);
|
||||
}
|
||||
mousekey_send();
|
||||
break;
|
||||
|
||||
case A_MDL:
|
||||
if (record->event.pressed) {
|
||||
mousekey_on(KC_MS_DOWN);
|
||||
mousekey_on(KC_MS_LEFT);
|
||||
} else {
|
||||
mousekey_off(KC_MS_DOWN);
|
||||
mousekey_off(KC_MS_LEFT);
|
||||
}
|
||||
mousekey_send();
|
||||
break;
|
||||
|
||||
case A_MDR:
|
||||
if (record->event.pressed) {
|
||||
mousekey_on(KC_MS_DOWN);
|
||||
mousekey_on(KC_MS_RIGHT);
|
||||
} else {
|
||||
mousekey_off(KC_MS_DOWN);
|
||||
mousekey_off(KC_MS_RIGHT);
|
||||
}
|
||||
mousekey_send();
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
|
||||
void matrix_init_user(void) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
|
||||
#ifdef ALVICSTEP_CONFIG_H
|
||||
int8_t layer = biton32(layer_state);
|
||||
|
||||
switch (layer) {
|
||||
case 1:
|
||||
if (!(host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK))) {
|
||||
all_led_off();
|
||||
caps_lock_led_on();
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if (!(host_keyboard_leds() & (1 << USB_LED_SCROLL_LOCK))) {
|
||||
all_led_off();
|
||||
scroll_lock_led_on();
|
||||
}
|
||||
case 0:
|
||||
all_led_off();
|
||||
num_lock_led_on();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
|
||||
}
|
@ -1,245 +0,0 @@
|
||||
#include "kinesis.h"
|
||||
#include "action_layer.h"
|
||||
#include "mousekey.h"
|
||||
|
||||
#define QWERTY 0 // Base qerty
|
||||
#define SYMB 1// Symbol layer
|
||||
#define MOUSE 2//
|
||||
|
||||
|
||||
|
||||
|
||||
/* Macros */
|
||||
enum {
|
||||
NONE = 0,
|
||||
// Diagonal mouse movement
|
||||
A_MUL,
|
||||
A_MUR,
|
||||
A_MDL,
|
||||
A_MDR,
|
||||
};
|
||||
|
||||
|
||||
// Borrowing very heavily from
|
||||
// https://github.com/alvicstep/tmk_keyboard
|
||||
/****************************************************************************************************
|
||||
*
|
||||
* Keymap: Default Layer in Qwerty
|
||||
*
|
||||
* ,-------------------------------------------------------------------------------------------------------------------.
|
||||
* | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F8 | F9 | F10 | F12 | FN0 | FN1 | FN2 | | bOOT |
|
||||
* |--------+------+------+------+------+------+---------------------------+------+------+------+------+------+--------|
|
||||
* | =+ | 1! | 2@ | 3# | 4$ | 5% | | 6^ | 7& | 8* | 9( | 0) | -_ |
|
||||
* |--------+------+------+------+------+------| +------+------+------+------+------+--------|
|
||||
* | Tab | Q | W | E | R | T | | Y | U | I | O | P | \| |
|
||||
* |--------+------+------+------+------+------| |------+------+------+------+------+--------|
|
||||
* |MouseFN1| A | S | D | F | G | | H | J | K | L | ;: | '" |
|
||||
* |--------+------+------+------+------+------| |------+------+------+------+------+--------|
|
||||
* | Shift | Z | X | C | V | B | | N | M | ,. | .> | /? | Shift |
|
||||
* `--------+------+------+------+------+------- `------+------+------+------+------+--------'
|
||||
* | `~ | ESC |MOUSE1|MOUSE2| | [{ | ]} | ESC | GUI |
|
||||
* `---------------------------' `---------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | Ctrl | Alt | | Gui | Ctrl |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | Home | | PgUp | | |
|
||||
* | BkSp | Del |------| |------|Return| Space|
|
||||
* | | | End | | PgDn | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[QWERTY] = KEYMAP(
|
||||
KC_ESC, KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8,
|
||||
KC_EQL, KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,
|
||||
KC_TAB, KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,
|
||||
KC_FN1 ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,
|
||||
KC_LSFT,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,
|
||||
KC_GRV ,KC_ESC, KC_BTN1,KC_BTN2,
|
||||
KC_LCTL,KC_LALT,
|
||||
KC_HOME,
|
||||
KC_BSPC,KC_DEL ,KC_FN0 ,
|
||||
KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,KC_FN0 ,KC_FN1 ,KC_FN2, KC_NO, RESET,
|
||||
KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_MINS,
|
||||
KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_BSLS,
|
||||
KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN,KC_QUOT,
|
||||
KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSFT,
|
||||
KC_LBRC,KC_RBRC, KC_ESC, KC_RGUI,
|
||||
KC_RGUI,KC_RCTL,
|
||||
KC_PGUP,
|
||||
KC_PGDN,KC_ENTER ,KC_SPC
|
||||
),
|
||||
[SYMB] = KEYMAP(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_FN0, KC_2,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS
|
||||
),
|
||||
/* Keymap: Movement and function layer
|
||||
*
|
||||
* ,-------------------------------------------------------------------------------------------------------------------.
|
||||
* | Caps | F1 | F2 | F3 | F4 | F5 | F6 | F8 | F9 | F10 | F12 | FN0 | FN1 | FN2 | Tada | bOOT |
|
||||
* |--------+------+------+------+------+------+---------------------------+------+------+------+------+------+--------|
|
||||
* | =+ | ! | @ | # | $ | % | | ^ | & | * | ( | ) |MS Fast |
|
||||
* |--------+------+------+------+------+------| +------+------+------+------+------+--------|
|
||||
* | Tab | | | Up | |PgUp | | MwU |MS_UL | MS_U |MS_UR | | Ms Norm|
|
||||
* |--------+------+------+------+------+------| |------+------+------+------+------+--------|
|
||||
* |MouseFN1| C^A | Left | Down |Right | C^E | | | MS_L |Mouse1| MS_R | |MS Slow |
|
||||
* |--------+------+------+------+------+------| |------+------+------+------+------+--------|
|
||||
* | | GuiZ | GUI X| GUI C| GUI_V|PgDown| | MWD | MDown|MS Dwn|MS_DR | ? | |
|
||||
* `--------+------+------+------+------+------- `------+------+------+------+------+--------'
|
||||
* | `~ | ESC | < | > | | { | } | ESC | |
|
||||
* `---------------------------' `---------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | Ctrl | Alt | | Gui | Ctrl |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | Home | | PgUp | | |
|
||||
* | BkSp | Del |------| |------|Mouse1|Mouse2|
|
||||
* | | | End | | PgDn |LClick|Rclick|
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
|
||||
|
||||
[MOUSE] = KEYMAP(
|
||||
KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_EXLM ,KC_AT, KC_HASH, KC_DLR ,KC_PERC ,
|
||||
KC_TRNS, KC_NO, KC_NO, KC_UP, KC_NO, KC_PGUP,
|
||||
KC_FN1, LCTL(KC_A),KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_E),
|
||||
KC_TRNS, LGUI(KC_Z),LGUI(KC_X),LGUI(KC_C),LGUI(KC_V),KC_PGDN,
|
||||
KC_TRNS, KC_TRNS, KC_LABK, KC_RABK,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_FN0,RESET,
|
||||
KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_ACL2,
|
||||
KC_WH_U, M(A_MUL), KC_MS_U, M(A_MUR), KC_NO, KC_ACL1,
|
||||
KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, KC_ACL0,
|
||||
KC_WH_D, M(A_MDL), KC_MS_D, M(A_MDR), KC_TRNS, KC_TRNS,
|
||||
KC_LCBR, KC_RCBR, KC_ESC, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_BTN1, KC_BTN2
|
||||
),
|
||||
|
||||
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[0] = ACTION_LAYER_TAP_TOGGLE(MOUSE) , // FN1 - Momentary Layer 1 (Symbols)
|
||||
[1] = ACTION_LAYER_TOGGLE(MOUSE) , // FN1 - Momentary Layer 1 (Symbols)
|
||||
[2] = ACTION_LAYER_TAP_TOGGLE(SYMB) , // FN1 - Momentary Layer 1 (Symbols)
|
||||
|
||||
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
// MACRODOWN only works in this function
|
||||
switch(id) {
|
||||
case 0:
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_RSFT);
|
||||
} else {
|
||||
unregister_code(KC_RSFT);
|
||||
}
|
||||
break;
|
||||
|
||||
// from algernon's ErgoDox EZ layout,
|
||||
case A_MUL:
|
||||
if (record->event.pressed) {
|
||||
mousekey_on(KC_MS_UP);
|
||||
mousekey_on(KC_MS_LEFT);
|
||||
} else {
|
||||
mousekey_off(KC_MS_UP);
|
||||
mousekey_off(KC_MS_LEFT);
|
||||
}
|
||||
mousekey_send();
|
||||
break;
|
||||
|
||||
case A_MUR:
|
||||
if (record->event.pressed) {
|
||||
mousekey_on(KC_MS_UP);
|
||||
mousekey_on(KC_MS_RIGHT);
|
||||
} else {
|
||||
mousekey_off(KC_MS_UP);
|
||||
mousekey_off(KC_MS_RIGHT);
|
||||
}
|
||||
mousekey_send();
|
||||
break;
|
||||
|
||||
case A_MDL:
|
||||
if (record->event.pressed) {
|
||||
mousekey_on(KC_MS_DOWN);
|
||||
mousekey_on(KC_MS_LEFT);
|
||||
} else {
|
||||
mousekey_off(KC_MS_DOWN);
|
||||
mousekey_off(KC_MS_LEFT);
|
||||
}
|
||||
mousekey_send();
|
||||
break;
|
||||
|
||||
case A_MDR:
|
||||
if (record->event.pressed) {
|
||||
mousekey_on(KC_MS_DOWN);
|
||||
mousekey_on(KC_MS_RIGHT);
|
||||
} else {
|
||||
mousekey_off(KC_MS_DOWN);
|
||||
mousekey_off(KC_MS_RIGHT);
|
||||
}
|
||||
mousekey_send();
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
|
||||
void matrix_init_user(void) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
int8_t layer = biton32(layer_state);
|
||||
|
||||
switch (layer) {
|
||||
case 1:
|
||||
all_led_off();
|
||||
break;
|
||||
case 2:
|
||||
if (!(host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK))) {
|
||||
all_led_off();
|
||||
caps_lock_led_on();
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
all_led_off();
|
||||
num_lock_led_on();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
|
||||
}
|
@ -1,67 +1,23 @@
|
||||
#ifndef KINESIS_H
|
||||
#define KINESIS_H
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
|
||||
// The first section contains all of the arguements
|
||||
// The second converts the arguments into a two-dimensional array
|
||||
#ifdef SUBPROJECT_alvicstep
|
||||
#include "alvicstep.h"
|
||||
#endif
|
||||
#ifdef SUBPROJECT_stapelberg
|
||||
#include "stapelberg.h"
|
||||
#endif
|
||||
|
||||
#define KEYMAP( \
|
||||
k02,k22,k12,k01,k21,k11,k00,k20,k10, \
|
||||
k80,k70,k60,k50,k40,k30, \
|
||||
k81,k71,k61,k51,k41,k31, \
|
||||
k82,k72,k62,k52,k42,k32, \
|
||||
k83,k73,k63,k53,k43,k33, \
|
||||
k74,k64,k54,k34, \
|
||||
k36,k35, \
|
||||
k55, \
|
||||
k56,k46,k75, \
|
||||
k03,k23,k13,k04,k24,k14,k05,k85,k84, \
|
||||
k94,kA4,kB4,kD4,kE4,kF4, \
|
||||
k95,kA5,kB5,kD5,kE5,kF5, \
|
||||
k96,kA6,kB6,kD6,kE6,kF6, \
|
||||
k97,kA7,kB7,kD7,kE7,kF7, \
|
||||
k93,kB3,kD3,kE3, \
|
||||
k47,k66, \
|
||||
k67, \
|
||||
k87,k76,k86 \
|
||||
) { \
|
||||
{ k00, k01, k02, k03, k04, k05, KC_NO, KC_NO }, \
|
||||
{ k10, k11, k12, k13, k14, KC_NO, KC_NO, KC_NO }, \
|
||||
{ k20, k21, k22, k23, k24, KC_NO, KC_NO, KC_NO }, \
|
||||
{ k30, k31, k32, k33, k34, k35, k36, KC_NO }, \
|
||||
{ k40, k41, k42, k43, KC_NO, KC_NO, k46, k47 }, \
|
||||
{ k50, k51, k52, k53, k54, k55, k56, KC_NO }, \
|
||||
{ k60, k61, k62, k63, k64, KC_NO, k66, k67 }, \
|
||||
{ k70, k71, k72, k73, k74, k75, k76, KC_NO }, \
|
||||
{ k80, k81, k82, k83, KC_NO ,KC_NO, k86, k87}, \
|
||||
{ KC_NO, KC_NO ,KC_NO ,k93, k94, k95, k96, k97}, \
|
||||
{ KC_NO, KC_NO ,KC_NO ,KC_NO, kA4, kA5, kA6, kA7}, \
|
||||
{ KC_NO, KC_NO ,KC_NO ,kB3, kB4, kB5, kB6, kB7}, \
|
||||
{ KC_NO, KC_NO ,KC_NO ,KC_NO, KC_NO, KC_NO, k84, k85}, \
|
||||
{ KC_NO, KC_NO ,KC_NO ,kD3, kD4, kD5, kD6, kD7}, \
|
||||
{ KC_NO, KC_NO ,KC_NO ,kE3, kE4, kE5, kE6, kE7}, \
|
||||
{ KC_NO, KC_NO ,KC_NO ,KC_NO, kF4, kF5, kF6, kF7} \
|
||||
}
|
||||
#include "quantum.h"
|
||||
|
||||
|
||||
/* 4y0 A 4y1 B 4y2 4y3 D 4y4 E 4y5 F 4y6 G 4y7 H 5y0 I 5y1 J 5y2 K 5y3 L 5y4 M 5y5 N 5y6 O 5y7 P */
|
||||
void all_led_off(void);
|
||||
void all_led_on(void);
|
||||
void num_lock_led_on(void);
|
||||
void caps_lock_led_on(void);
|
||||
void scroll_lock_led_on(void);
|
||||
void keypad_led_on(void);
|
||||
|
||||
/*
|
||||
0 1 2 3 4 5 6 7 8 9 A B C D E F
|
||||
A B C D E F G H I J K L M N O P
|
||||
4y0 4y1 4y2 4y3 4y4 4y5 4y6 4y7 5y0 5y1 5y2 5y3 5y4 5y5 5y6 5y7
|
||||
r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15
|
||||
0 PB0 21 c0 f6 f8 f7 5 4 3 2 1 =+
|
||||
1 PB1 22 c1 f3 f5 f4 t r e w q TAB
|
||||
2 PB2 23 c2 ESC f2 f1 g f d s a CL
|
||||
3 PB3 24 c3 f9 f11 f10 b v c x z LS UP DN [{ ]}
|
||||
4 PB4 25 c4 f12 SL PS RT LT §± `~ 6 7 8 9 0 -_
|
||||
5 PB5 26 c5 PB PGM KPD LA HM END y u i o p \
|
||||
6 PB6 27 c6 LC DEL BS RC ENT SP h j k l ;: '"
|
||||
7 PB7 28 c7 RA PU PD n m ,< .> /? RS
|
||||
*/
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -0,0 +1,3 @@
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../../Makefile
|
||||
endif
|
@ -0,0 +1,50 @@
|
||||
#ifndef STAPELBERG_CONFIG_H
|
||||
#define STAPELBERG_CONFIG_H
|
||||
|
||||
#include "../config.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define PRODUCT_ID 0x6060
|
||||
#define DEVICE_VER 0x0002
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 15
|
||||
#define MATRIX_COLS 7
|
||||
|
||||
/*
|
||||
* 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 { D0, D1, D2, D3, D4, D5, D6, D7, C0, C1, C2, C3, C4, C5, C6 }
|
||||
#define MATRIX_COL_PINS { B0, B1, B2, B3, B4, B5, B6 }
|
||||
#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
|
||||
|
||||
/* don't know if this should be defined at the board or top level. Assuming board
|
||||
#define MOUSEKEY_DELAY 100
|
||||
#define MOUSEKEY_INTERVAL 20
|
||||
#define MOUSEKEY_MAX_SPEED 3
|
||||
#define MOUSEKEY_TIME_TO_MAX 10
|
||||
*/
|
||||
|
||||
#define IGNORE_MOD_TAP_INTERRUPT
|
||||
|
||||
/* key combination for magic key command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
|
||||
#endif
|
After Width: | Height: | Size: 126 KiB |
After Width: | Height: | Size: 96 KiB |
After Width: | Height: | Size: 117 KiB |
@ -0,0 +1,55 @@
|
||||
# kinesis_stapelberg keyboard firmware
|
||||
|
||||
This folder contains the firmware customization required to run QMK on the custom controller for the Kinesis Advantage created by Michael Stapelberg.
|
||||
It differs from the `alvicstep keyboard in that the existing QMK Kinesis Advantage project uses the existing controller board provided by Kinesis.
|
||||
|
||||
The controller board hardware is described
|
||||
[here](http://michael.stapelberg.de/Artikel/kinesis_custom_controller)
|
||||
|
||||
Mapping the pin assignments was done using the corresponding matrix description provided at this
|
||||
[link](https://github.com/stapelberg/kinesis-firmware/blob/master/kb_kinesis/config.kspec)
|
||||
|
||||
This code makes no attempt to drive the four LEDs provided on the controller board.
|
||||
|
||||
|
||||
## Building the Hardware
|
||||
|
||||
If you want to perform this customization, these parts may be helpful.
|
||||
|
||||
| Function | Quantity | Vendor | Part Number |
|
||||
| ------------------------------------------------------ | -------- | ------- | ------------ |
|
||||
| 13 pin connector for function keys and finger keywells | 4 | Digi-Key | WM14526-ND |
|
||||
| 10 pin headers for thumb clusters | 4 | Digi-Key | 609-3250-ND |
|
||||
| 8 pin cable for thumb clusters | 2 | Digi-Key | SAM8928-ND |
|
||||
| Teensy++ 2.0 | 1 | Digi-Key | 1528-1056-ND |
|
||||
| 2 pin right angle header for reset | 1 | Digi-Key | 3M9467-ND |
|
||||
| Reset cables | 2 | Sparkfun | PRT-09140 |
|
||||
|
||||
The board and connections are shown here
|
||||
![](images/controller_board.jpg)
|
||||
|
||||
The Teensy mounting detail can be seen here.
|
||||
I used a socket for prototyping.
|
||||
![](images/teensy_detail.jpg)
|
||||
|
||||
|
||||
Since the proper mounting of the Teensy board places the reset button in a tight space, I added a 2-pin header to the reset and ground pins on the edge of the board.
|
||||
Shorting these two pins together will reset the board.
|
||||
I also put female to male header jumper cables on these so they could be accessed outside the enclosure.
|
||||
The exterior cables can be seen here.
|
||||
![](images/exterior_reset.jpg)
|
||||
|
||||
|
||||
## Keymaps
|
||||
|
||||
### Default
|
||||
|
||||
To build with the default keymap, run `make default` while in the
|
||||
`kinesis_stapelberg` working directory.
|
||||
|
||||
### Dvorak
|
||||
|
||||
This keymap contains a dvorak implementation as well as media and symbol layers.
|
||||
|
||||
Run `make dvorak` while in the `kinesis_stapelberg` working directory.
|
||||
|
@ -0,0 +1,10 @@
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../Makefile
|
||||
endif
|
||||
|
||||
# just silently stop, since we need to upload with teensy uploader
|
||||
upload: build
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,28 @@
|
||||
#include "stapelberg.h"
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
// put your keyboard start-up code here
|
||||
// runs once when the firmware starts up
|
||||
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
void matrix_scan_kb(void) {
|
||||
// put your looping keyboard code here
|
||||
// runs every cycle (a lot)
|
||||
|
||||
matrix_scan_user();
|
||||
}
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
// put your per-action keyboard code here
|
||||
// runs for every action, just before processing by the firmware
|
||||
|
||||
return process_record_user(keycode, record);
|
||||
}
|
||||
|
||||
void led_set_kb(uint8_t usb_led) {
|
||||
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||
|
||||
led_set_user(usb_led);
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
#ifndef KINESIS_STAPELBERG_H
|
||||
#define KINESIS_STAPELBERG_H
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
// This a shortcut to help you visually see your layout.
|
||||
// The first section contains all of the arguments as on the physical keyboard
|
||||
// The second converts the arguments into the 2-D scanned array
|
||||
|
||||
#define KEYMAP( \
|
||||
kC0,kD0,kE0,kC1,kD1,kE1,kC2,kD2,kE2, \
|
||||
k00,k10,k20,k30,k40,k50, \
|
||||
k01,k11,k21,k31,k41,k51, \
|
||||
k02,k12,k22,k32,k42,k52, \
|
||||
k03,k13,k23,k33,k43,k53, \
|
||||
k14,k24,k34,k54, \
|
||||
k56,k55, \
|
||||
k35, \
|
||||
k36,k46,k25, \
|
||||
kC3,kD3,kE3,kC4,kD4,kE4,kC5,kE5,kD5, \
|
||||
k60,k70,k80,k90,kA0,kB0, \
|
||||
k61,k71,k81,k91,kA1,kB1, \
|
||||
k62,k72,k82,k92,kA2,kB2, \
|
||||
k63,k73,k83,k93,kA3,kB3, \
|
||||
k64,k84,k94,kA4, \
|
||||
k96,k85, \
|
||||
k86, \
|
||||
k66,k75,k65 \
|
||||
) { \
|
||||
{ k00, k01, k02, k03, KC_NO, KC_NO, KC_NO }, \
|
||||
{ k10, k11, k12, k13, k14, KC_NO, KC_NO }, \
|
||||
{ k20, k21, k22, k23, k24, k25, KC_NO }, \
|
||||
{ k30, k31, k32, k33, k34, k35, k36 }, \
|
||||
{ k40, k41, k42, k43, KC_NO, KC_NO, k46 }, \
|
||||
{ k50, k51, k52, k53, k54, k55, k56 }, \
|
||||
{ k60, k61, k62, k63, k64, k65, k66 }, \
|
||||
{ k70, k71, k72, k73, KC_NO, k75, KC_NO }, \
|
||||
{ k80, k81, k82, k83, k84, k85, k86 }, \
|
||||
{ k90, k91, k92, k93, k94, KC_NO, k96 }, \
|
||||
{ kA0, kA1, kA2, kA3, kA4, KC_NO, KC_NO }, \
|
||||
{ kB0, kB1, kB2, kB3, KC_NO, KC_NO, KC_NO }, \
|
||||
{ kC0, kC1, kC2, kC3, kC4, kC5, KC_NO }, \
|
||||
{ kD0, kD1, kD2, kD3, kD4, kD5, KC_NO }, \
|
||||
{ kE0, kE1, kE2, kE3, kE4, kE5, KC_NO } \
|
||||
}
|
||||
|
||||
/*
|
||||
This is the Stapelberg matrix as published at
|
||||
https://github.com/stapelberg/kinesis-firmware/blob/master/kb_kinesis/config.kspec
|
||||
Along with the pins for each row and column
|
||||
PB0 PB1 PB2 PB3 PB4 PB5 PB6
|
||||
kx0 kx1 kx2 kx3 kx4 kx5 kx6
|
||||
PD0 k0x Row: EQL TAB CAP LSH X2 -- --
|
||||
PD1 k1x Row: 1 Q A Z BQ -- --
|
||||
PD2 k2x Row: 2 W S X INS END --
|
||||
PD3 k3x Row: 3 E D C LFT HOM BAK
|
||||
PD4 k4x Row: 4 R F V -- -- DEL
|
||||
PD5 k5x Row: 5 T G B RT LAL LCT
|
||||
PD6 k6x Row: 6 Y H N UP SPC PGD
|
||||
PD7 k7x Row: 7 U J M -- RET --
|
||||
PB0 k8x Row: 8 I K COM DWN RCT PGU
|
||||
PB1 k9x Row: 9 O L PER LBR -- RAL
|
||||
PB2 kAx Row: 0 P SEM SLA RBR -- --
|
||||
PB3 kBx Row: MIN BSL APO RSH X1 -- --
|
||||
PB4 kCx Row: ESC F3 F6 F9 F12 PAU --
|
||||
PB5 kDx Row: F1 F4 F7 F10 PRT PRG --
|
||||
PB6 kEx Row: F2 F5 F8 F11 SLK KEY --
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#endif
|
@ -1,3 +1,5 @@
|
||||
SUBPROJECT_DEFAULT = rev2
|
||||
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
||||
endif
|
||||
|
@ -1,2 +1,2 @@
|
||||
:080000000000000000000001F7
|
||||
:0B0000000000000000000000000001F4
|
||||
:00000001FF
|
||||
|
@ -1,2 +1,2 @@
|
||||
:080000000000000000000000F8
|
||||
:0B0000000000000000000000000000F5
|
||||
:00000001FF
|
||||
|
@ -1,188 +0,0 @@
|
||||
#include "lets_split.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
|
||||
|
||||
enum custom_keycodes {
|
||||
QWERTY = SAFE_RANGE,
|
||||
COLEMAK,
|
||||
DVORAK,
|
||||
LOWER,
|
||||
RAISE,
|
||||
ADJUST,
|
||||
};
|
||||
|
||||
// Fillers to make layering more clear
|
||||
#define _______ KC_TRNS
|
||||
#define XXXXXXX KC_NO
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* 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 |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_QWERTY] = KEYMAP( \
|
||||
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
|
||||
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_ENT , \
|
||||
KC_LCTL, ADJUST, KC_LALT, KC_LGUI, LOWER, KC_SPC, MT(MOD_LSFT, KC_SPC), RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
|
||||
),
|
||||
|
||||
/* Colemak
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Esc | A | R | S | T | D | H | N | E | I | O | " |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_COLEMAK] = KEYMAP( \
|
||||
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_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
|
||||
ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
|
||||
),
|
||||
|
||||
/* 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 |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_DVORAK] = KEYMAP( \
|
||||
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_SLSH, \
|
||||
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \
|
||||
ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
|
||||
),
|
||||
[3] = KEYMAP( \
|
||||
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_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
|
||||
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, KC_BSPC, MT(MOD_LSFT, KC_BSPC), _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
|
||||
),
|
||||
[4] = KEYMAP( \
|
||||
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_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
|
||||
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, KC_ENT, MT(MOD_LSFT, KC_ENT), _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
|
||||
),
|
||||
|
||||
/* Adjust (Lower + Raise)
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | | Reset| | | | | | | | | | Del |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_ADJUST] = KEYMAP( \
|
||||
_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \
|
||||
_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \
|
||||
_______, RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||
)
|
||||
};
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
|
||||
float tone_dvorak[][2] = SONG(DVORAK_SOUND);
|
||||
float tone_colemak[][2] = SONG(COLEMAK_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 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 COLEMAK:
|
||||
if (record->event.pressed) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_NOTE_ARRAY(tone_colemak, false, 0);
|
||||
#endif
|
||||
persistant_default_layer_set(1UL<<_COLEMAK);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
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 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 ADJUST:
|
||||
if (record->event.pressed) {
|
||||
layer_on(_ADJUST);
|
||||
} else {
|
||||
layer_off(_ADJUST);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
@ -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
|
||||
#define CONFIG_USER_H
|
||||
#endif
|
||||
|
||||
#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,180 @@
|
||||
// This is the personal keymap of Jeremy Cowgar (@jcowgar). It is written for the programmer.
|
||||
|
||||
// Configuration options
|
||||
#define PREVENT_STUCK_MODIFIERS
|
||||
|
||||
#include "planck.h"
|
||||
#include "action_layer.h"
|
||||
#include "eeconfig.h"
|
||||
|
||||
// Each layer gets a name for readability, which is then used in the keymap matrix below.
|
||||
enum my_layers {
|
||||
ALPH = 0,
|
||||
NUMS,
|
||||
CURS,
|
||||
SYMB,
|
||||
FKEY
|
||||
};
|
||||
|
||||
// Each macro gets a name for readability.
|
||||
enum my_keycodes {
|
||||
MY_ABVE = SAFE_RANGE,
|
||||
MY_BELW,
|
||||
MY_TERM,
|
||||
MY_DEQL, // /=
|
||||
MY_MEQL, // *=
|
||||
MY_SEQL, // -=
|
||||
MY_PEQL, // +=
|
||||
MY_NEQL, // !=
|
||||
MY_LTGT, // <>
|
||||
MY_DPIP, // ||
|
||||
MY_DAMP, // &&
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[ALPH] = {
|
||||
{KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P},
|
||||
{KC_A, KC_S, KC_D, KC_F, KC_G, KC_LPRN, KC_RPRN, KC_H, KC_J, KC_K, KC_L, KC_SCLN},
|
||||
{SFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_LCBR, KC_RCBR, KC_N, KC_M, KC_COMM, KC_DOT, SFT_T(KC_SLSH)},
|
||||
{CTL_T(KC_TAB), OSL(FKEY), OSL(NUMS), OSL(SYMB), KC_SPC, ALT_T(KC_BSPC), GUI_T(KC_DELT), KC_ENT, OSL(SYMB), OSL(CURS), TG(CURS), CTL_T(KC_ESC)}
|
||||
},
|
||||
[NUMS] = {
|
||||
{KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_COMM, KC_7, KC_8, KC_9, KC_SLSH},
|
||||
{KC_LSFT, KC_LGUI, KC_LALT, KC_LCTL, KC_NO, KC_TRNS, KC_TRNS, KC_LPRN, KC_4, KC_5, KC_6, KC_ASTR},
|
||||
{KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_RPRN, KC_1, KC_2, KC_3, KC_MINS},
|
||||
{KC_NO, KC_NO, KC_TRNS, TG(NUMS), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_0, KC_DOT, KC_EQL, KC_PLUS}
|
||||
},
|
||||
[CURS] = {
|
||||
{KC_MPLY, KC_BSPC, KC_UP, KC_DELT, KC_PGUP, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO},
|
||||
{KC_VOLU, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_TRNS, KC_TRNS, KC_NO, KC_LCTL, KC_LALT, KC_LGUI, KC_LSFT},
|
||||
{KC_VOLD, KC_NO, MY_ABVE, MY_TERM, KC_NO, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_LSFT},
|
||||
{KC_MUTE, KC_NO, MY_BELW, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_NO}
|
||||
},
|
||||
[SYMB] = {
|
||||
{MY_DEQL, MY_MEQL, MY_SEQL, MY_PEQL, MY_NEQL, KC_NO, KC_NO, MY_LTGT, KC_LABK, KC_RABK, KC_COLN, KC_DLR},
|
||||
{KC_SLSH, KC_ASTR, KC_MINS, KC_PLUS, KC_EQL, KC_NO, KC_PIPE, MY_DPIP, KC_GRV, KC_QUOT, KC_DQUO, KC_HASH},
|
||||
{KC_BSLS, KC_CIRC, KC_PERC, KC_UNDS, KC_NO, KC_NO, KC_AMPR, MY_DAMP, KC_TILD, KC_AT, KC_EXLM, KC_QUES},
|
||||
{KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO}
|
||||
},
|
||||
[FKEY] = {
|
||||
{KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F9, KC_F10, KC_F11, KC_F12},
|
||||
{KC_LSFT, KC_LGUI, KC_LALT, KC_LCTL, KC_NO, KC_NO, KC_NO, KC_NO, KC_F5, KC_F6, KC_F7, KC_F8},
|
||||
{KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F1, KC_F2, KC_F3, KC_F4},
|
||||
{KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO}
|
||||
}
|
||||
};
|
||||
|
||||
void press_key(uint16_t key) {
|
||||
register_code(key);
|
||||
unregister_code(key);
|
||||
}
|
||||
|
||||
void press_two_keys(uint16_t key1, uint16_t key2) {
|
||||
register_code(key1);
|
||||
register_code(key2);
|
||||
unregister_code(key2);
|
||||
unregister_code(key1);
|
||||
}
|
||||
|
||||
void press_three_keys(uint16_t key1, uint16_t key2, uint16_t key3) {
|
||||
register_code(key1);
|
||||
register_code(key2);
|
||||
register_code(key3);
|
||||
unregister_code(key3);
|
||||
unregister_code(key2);
|
||||
unregister_code(key1);
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case MY_BELW:
|
||||
if (record->event.pressed) {
|
||||
press_two_keys(KC_LGUI, KC_RGHT);
|
||||
press_key(KC_ENT);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
case MY_ABVE:
|
||||
if (record->event.pressed) {
|
||||
press_two_keys(KC_LGUI, KC_LEFT);
|
||||
press_key(KC_ENT);
|
||||
press_key(KC_UP);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
case MY_TERM:
|
||||
if (record->event.pressed) {
|
||||
press_three_keys(KC_LGUI, KC_LSFT, KC_ENT);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
case MY_DEQL: // /=
|
||||
if (record->event.pressed) {
|
||||
press_key(KC_SLSH);
|
||||
press_key(KC_EQL);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
case MY_MEQL: // *=
|
||||
if (record->event.pressed) {
|
||||
press_two_keys(KC_LSFT, KC_ASTR);
|
||||
press_key(KC_EQL);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
case MY_SEQL: // -=
|
||||
if (record->event.pressed) {
|
||||
press_key(KC_MINS);
|
||||
press_key(KC_EQL);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
case MY_PEQL: // +=
|
||||
if (record->event.pressed) {
|
||||
press_two_keys(KC_LSFT, KC_PLUS);
|
||||
press_key(KC_EQL);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
case MY_NEQL: // !=
|
||||
if (record->event.pressed) {
|
||||
press_two_keys(KC_LSFT, KC_EXLM);
|
||||
press_key(KC_EQL);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
case MY_LTGT: // <>
|
||||
if (record->event.pressed) {
|
||||
press_two_keys(KC_LSFT, KC_LABK);
|
||||
press_two_keys(KC_LSFT, KC_RABK);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
case MY_DPIP: // ||
|
||||
if (record->event.pressed) {
|
||||
press_two_keys(KC_LSFT, KC_PIPE);
|
||||
press_two_keys(KC_LSFT, KC_PIPE);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
case MY_DAMP: // &&
|
||||
if (record->event.pressed) {
|
||||
press_two_keys(KC_LSFT, KC_AMPR);
|
||||
press_two_keys(KC_LSFT, KC_AMPR);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
Jeremy Cowgar's Planck Keymap
|
||||
=============================
|
||||
|
||||
I am a programmer by trade and suffer from the beginning stages of RSI. As a programmer, I use letters, symbols and cursor navigation most often. To prevent strange finger gymnastics, I wrote a script to rank which non-letter characters occurred in my primary source projects most often and then placed these characters in the easiest to reach locations, within reason and for me. I made heavy use of momentary layer toggling.
|
||||
|
||||
Layers
|
||||
------
|
||||
|
||||
The key mapping is made up of 5 layers: Letters, Symbols, Navigation, Numbers, and Function Keys.
|
||||
|
||||
The layout can be viewed visually at:
|
||||
|
||||
http://www.keyboard-layout-editor.com/#/gists/319474e5e2d199e583371ed1d2aec316
|
||||
|
||||
* Purple buttons are dual function keys.
|
||||
* Green buttons are layer momentary toggle keys.
|
||||
* Red buttons are layer persistent toggle keys.
|
||||
|
||||
The keys have multiple symbols:
|
||||
|
||||
* Upper left: standard layer, the letter layer
|
||||
* Upper right: function layer
|
||||
* Lower left: navigation layer
|
||||
* Lower right: symbol layer
|
||||
|
||||
The symbols in the layout editor are not entirely clear.
|
||||
|
||||
The Z and ? keys double as shift keys. Hold for a shift, tap for a Z or ?
|
||||
|
||||
The bottom row from left to right:
|
||||
|
||||
* Tab when pressed, Control when held. It also is the volume mute key when in the "Navigation" layer
|
||||
* Function layer momentary toggle
|
||||
* Number layer momentary toggle
|
||||
* Symbol layer momentary toggle. When in the "Number" layer, this key also makes the "Number" layer sticky for using the 10 key for quite a bit of entry
|
||||
* Space
|
||||
* Backspace when tapped, Option when held
|
||||
* Delete when tapped, Command when held
|
||||
* Return
|
||||
* Symbol layer momentary toggle. When in the "Number" layer, key also is the zero key.
|
||||
* Navigation layer momentary toggle
|
||||
* Navigation layer toggle. This was included for when you are browsing a website, document or otherwise wish to stay in navigation mode. When in the "Number" layer, the key is the = symbol
|
||||
* Escape when pressed, Control when held. When in the "Number" layer, the key is the + symbol
|
||||
|
||||
General Notes
|
||||
-------------
|
||||
|
||||
The letter layer is separated by 2 center rows of keys. This spreads the hands out a little further which helps not twist the wrists as much. The 2 center rows are [], (), [], and Ctrl and Alt keys.
|
||||
|
||||
The symbol layer keys are accessed by the thumbs. They are the closest to the thumbs, instead of the number toggle, because in my code I found I used symbols much more often than numbers. There are two symbol layer keys because the symbols spread across the right and left half of the keyboard. Thus, some symbols are easier hit with the left hand modifier or right hand modifier.
|
||||
|
||||
The number layer key is only accessible by the left thumb because all of the number keys are on the right side of the keyboard. When in the number layer, you can press the key to the right to make that layer sticky when you are going to do a lot of number entry.
|
||||
|
||||
The function layer key is only accessible by the left thumb because all of the function keys are on the right side of the keyboard.
|
||||
|
||||
The navigation layer key is only accessible by the right thumb because all of the navigation keys are on the left side of the keyboard. You can press the key to the right of the navigation layer to make the navigation layer sticky when you are doing a lot of navigation, reading a web page for example.
|
||||
|
||||
When using the number or navigation layers, the same hand that accesses the momentary layer toggle key also has the 4 primary modifiers under their home row.
|
||||
|
||||
* Pointer finger is control
|
||||
* Middle finger is option
|
||||
* Ring finger is command
|
||||
* Pinky finger is shift
|
||||
|
||||
This is so you can easily press Cmd+Shift+F4 or when navigating, select text or words of text by pressing Shift+Control, for example.
|
||||
|
||||
Some keys are duplicated. For example, () are available in easy to reach locations while in the Number layer because they are often used in math.
|
||||
|
||||
The symbol layer has additional helpers for programming including a single keys that enter /=, \*=, -=, +=, !=, <>, ||, and &&. It also includes three special Return keys on the left:
|
||||
|
||||
* Up CR which moves the cursor up, to the end of the line and then presses CR
|
||||
* Down CR which moves the cursor to the end of the line and then presses CR
|
||||
* Right ; which moves the cursor to the end of the line and presses ; for C styled languages, such as JavaScript which is a primary language I use
|
||||
|
||||
Word of Warning
|
||||
---------------
|
||||
|
||||
I have been using the keymap for some time now and believe it to be a good keymap. There are a few things through the week that I wonder if it would have been better if this key were moved to that location.
|
||||
|
||||
This keymap may change for further optimization.
|
||||
|
||||
Please Give Feedback!
|
||||
---------------------
|
||||
|
||||
I am very interested in your feedback. Send me a message here on GitHub, r/jcowgar or @jcowgar.
|
@ -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,5 @@
|
||||
SUBPROJECT = rev3
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
@ -0,0 +1,2 @@
|
||||
#include "../../config.h"
|
||||
#define PREVENT_STUCK_MODIFIERS
|
@ -0,0 +1,70 @@
|
||||
#include "keymap.h"
|
||||
#include "quantum.h"
|
||||
|
||||
#define QWERTY 0
|
||||
#define LOWER 1
|
||||
#define RAISE 2
|
||||
|
||||
// Alias to make layering more clear
|
||||
#define _______ KC_TRNS
|
||||
|
||||
// In MacOS, switch between windows within an application
|
||||
#define GUI_GRV LGUI(KC_GRV)
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* Qwerty
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Ctl | A | S | D | F | G | H | J | K | L | ; | " |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Esc | Del | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[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_LCTL, 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, MT(MOD_RSFT, KC_ENT) },
|
||||
{KC_ESC, KC_DEL, KC_LALT, KC_LGUI, MO(1), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
|
||||
},
|
||||
|
||||
/* Lower
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | GUIGR| | | | | | | & | * | ( | ) | Del |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Caps | | Mute | Vol- | Vol+ | | Bksp | $ | % | ^ | | | | |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | | | | | | | ! | @ | # | \ |Enter |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | Enter | | | PgUp | PgUn | |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[LOWER] = {
|
||||
{GUI_GRV, _______, _______, _______, _______, _______, _______, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL},
|
||||
{KC_CAPS, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, KC_BSPC, KC_DLR, KC_PERC, KC_CIRC, KC_PIPE, KC_PIPE},
|
||||
{_______, _______, _______, _______, _______, _______, _______, KC_EXLM, KC_AT, KC_HASH, KC_BSLS, KC_ENT},
|
||||
{_______, _______, _______, _______, _______, KC_ENT, KC_ENT, _______, _______, KC_PGDN, KC_PGUP, _______}
|
||||
},
|
||||
|
||||
/* Raise
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | ` | ` | ~ | ( | ) | | | 7 | 8 | 9 | 0 | |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | | [ | ] | { | } | | | 4 | 5 | 6 | | \ |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | - | _ | = | + | | | 1 | 2 | 3 | |Enter |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | Enter | | | | | |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
|
||||
[RAISE] = {
|
||||
{KC_GRV, KC_GRV, KC_TILD, KC_LPRN, KC_RPRN, _______, _______, KC_7, KC_8, KC_9, KC_0, _______},
|
||||
{_______, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, _______, _______, KC_4, KC_5, KC_6, _______, KC_BSLS},
|
||||
{_______, KC_MINS, KC_UNDS, KC_EQL, KC_PLUS, _______, _______, KC_1, KC_2, KC_3, _______, KC_ENT},
|
||||
{_______, _______, _______, _______, _______, KC_ENT, KC_ENT, _______, _______, KC_PGDN, KC_PGUP, _______}
|
||||
}
|
||||
};
|
@ -0,0 +1,26 @@
|
||||
## Flashing Keyboard
|
||||
|
||||
1. Install `dfu` tools:
|
||||
|
||||
brew tap osx-cross/avr
|
||||
brew install avr-libc
|
||||
brew install dfu-programmer
|
||||
|
||||
2. Move to this directory.
|
||||
3. Hit the reset button on the keyboard.
|
||||
4. run `make dfu`.
|
||||
|
||||
## The Keymap
|
||||
|
||||
This keymap is designed for a rev3 Planck Keyboard.
|
||||
|
||||
The default layer is QWERTY. The raise layer has a ten key on the right
|
||||
and common programming punctuation on the left. The lower layer provides the
|
||||
rest of the symbols, mostly mapped with the ten key numbers.
|
||||
|
||||
The normal right shift key uses the `MT` macro to trigger Enter on tap and right
|
||||
shift when held.
|
||||
|
||||
This keymap sets the `PREVENT_STUCK_MODIFIERS` flag to avoid the occasional WTF
|
||||
moments when using a modifier keys and accidentally releasing them after moving
|
||||
to a new layer.
|
@ -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 |
@ -1,49 +0,0 @@
|
||||
#include "keymap.h"
|
||||
|
||||
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = KEYMAP(
|
||||
TAB, Q, W, E, R, T, Y, U, I, O, P, BSPC,
|
||||
LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT,
|
||||
LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, FN3,
|
||||
ESC, DEL, LALT, LGUI, FN2, SPC, FN1, LEFT, DOWN, UP, RGHT),
|
||||
[1] = KEYMAP(
|
||||
GRV, GRV, FN22, FN19, FN10, TRNS, TRNS, 7, 8, 9, 0, BSPC,
|
||||
TRNS, LBRC, RBRC, FN23, FN24, TRNS, TRNS, 4, 5, 6, TRNS, BSLS,
|
||||
TRNS, MINS, FN20, EQL, FN21, TRNS, TRNS, 1, 2, 3, TRNS, ENT,
|
||||
TRNS, TRNS, TRNS, TRNS, TRNS, SPC, FN1, TRNS, PGDN, PGUP, TRNS),
|
||||
[2] = KEYMAP(
|
||||
FN26, FN10, FN11, FN12, FN13, FN14, FN15, FN17, FN18, FN19, FN10, DEL,
|
||||
TRNS, TRNS, MUTE, VOLD, VOLU, TRNS, BSPC, FN14, FN15, FN16, TRNS, FN25,
|
||||
TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN11, FN12, FN13, TRNS, ENT,
|
||||
TRNS, TRNS, TRNS, TRNS, FN2, ENT, TRNS, TRNS, PGDN, PGUP, TRNS),
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[1] = ACTION_LAYER_MOMENTARY(1), // Switch layer raise
|
||||
[2] = ACTION_LAYER_MOMENTARY(2), // Switch layer lower
|
||||
|
||||
[3] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), // Right shift serves as Enter on tap
|
||||
|
||||
// Numeric shift modifiers
|
||||
[10] = ACTION_MODS_KEY(MOD_LSFT, KC_0),
|
||||
[11] = ACTION_MODS_KEY(MOD_LSFT, KC_1),
|
||||
[12] = ACTION_MODS_KEY(MOD_LSFT, KC_2),
|
||||
[13] = ACTION_MODS_KEY(MOD_LSFT, KC_3),
|
||||
[14] = ACTION_MODS_KEY(MOD_LSFT, KC_4),
|
||||
[15] = ACTION_MODS_KEY(MOD_LSFT, KC_5),
|
||||
[16] = ACTION_MODS_KEY(MOD_LSFT, KC_6),
|
||||
[17] = ACTION_MODS_KEY(MOD_LSFT, KC_7),
|
||||
[18] = ACTION_MODS_KEY(MOD_LSFT, KC_8),
|
||||
[19] = ACTION_MODS_KEY(MOD_LSFT, KC_9),
|
||||
|
||||
// Other shift modifiers
|
||||
[20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS), // _
|
||||
[21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL), // +
|
||||
[22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // ~
|
||||
[23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC), // {
|
||||
[24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC), // }
|
||||
[25] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), // |
|
||||
|
||||
// Switch windows in app
|
||||
[26] = ACTION_MODS_KEY(MOD_LGUI, KC_GRV),
|
||||
};
|
@ -0,0 +1,3 @@
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../../Makefile
|
||||
endif
|
@ -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,3 @@
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
@ -0,0 +1,61 @@
|
||||
ps2avrGB keyboard firmware
|
||||
==========================
|
||||
|
||||
This is a port of the QMK firmware for boards that are based on the
|
||||
ps2avrGB firmware, like the [ps2avrGB
|
||||
keyboard](https://www.keyclack.com/product/gb-ps2avrgb/) or the ones sold
|
||||
by [Winkeyless](http://winkeyless.kr/product/ps2avrgb-parts/).
|
||||
|
||||
Note that this is a complete replacement for the firmware, so you won't be
|
||||
using Bootmapper Client to change any keyboard settings, since not all the
|
||||
USB report options are supported.
|
||||
|
||||
## Supported Boards
|
||||
|
||||
Only the [B.mini X2](http://winkeyless.kr/product/b-mini-x2-pcb/) has been
|
||||
tested so far (since it's the only one I own). But other boards that use
|
||||
the ps2avrGB firmware should work as well.
|
||||
|
||||
## Installing
|
||||
|
||||
First, install the requirements. These commands are for OSX, but all you
|
||||
need is the AVR toolchain and `bootloadHID` for flashing:
|
||||
|
||||
```
|
||||
$ brew cask install crosspack-avr
|
||||
$ brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb
|
||||
```
|
||||
|
||||
In order to use the `./program` script, which can reboot the board into
|
||||
the bootloader, you'll need Python 2 with PyUSB installed:
|
||||
|
||||
```
|
||||
$ pip install pyusb
|
||||
```
|
||||
|
||||
Then, with the keyboard plugged in, simply run this command from the
|
||||
`qmk_firmware` directory:
|
||||
|
||||
```
|
||||
$ make ps2avrGB-program
|
||||
```
|
||||
|
||||
If you prefer, you can just build it and flash the firmware directly with
|
||||
`bootloadHID` if you boot the board while holding down `L_Ctrl` to keep it
|
||||
in the bootloader:
|
||||
|
||||
```
|
||||
$ make ps2avrGB
|
||||
$ bootloadHID -r ps2avrGB_default.hex
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
From my experience, it's really hard to brick these boards. But these
|
||||
tricks have been useful when it got stuck in a weird scenario.
|
||||
|
||||
1. Try plugging the board in while pressing `L_Ctrl`. This will force it
|
||||
to boot only the bootloader without loading the firmware. Once this is
|
||||
done, just reflash the board with the original firmware.
|
||||
2. Sometimes USB hubs can act weird, so try connecting the board directly
|
||||
to your computer or plugging/unplugging the USB hub.
|
@ -0,0 +1,38 @@
|
||||
/*
|
||||
Copyright 2017 Luiz Ribeiro <luizribeiro@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
|
||||
|
||||
#define VENDOR_ID 0x20A0
|
||||
#define PRODUCT_ID 0x422D
|
||||
// TODO: share these strings with usbconfig.h
|
||||
// Edit usbconfig.h to change these.
|
||||
#define MANUFACTURER winkeyless.kr
|
||||
#define PRODUCT ps2avrGB
|
||||
|
||||
/* matrix size */
|
||||
#define MATRIX_ROWS 8
|
||||
#define MATRIX_COLS 15
|
||||
|
||||
#define NO_UART 1
|
||||
#define BOOTLOADHID_BOOTLOADER 1
|
||||
|
||||
/* key combination for command */
|
||||
#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))
|
||||
|
||||
#endif
|
@ -0,0 +1,32 @@
|
||||
/*
|
||||
Copyright 2017 Luiz Ribeiro <luizribeiro@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/>.
|
||||
*/
|
||||
|
||||
#include "ps2avrGB.h"
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
KEYMAP( \
|
||||
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,HOME,END, \
|
||||
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, DEL, \
|
||||
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, INS, \
|
||||
CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT,ENT, PGUP,\
|
||||
LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH,RSFT, UP, PGDN,\
|
||||
LCTL,LALT,LGUI, SPC, RGUI,RALT,RCTL,LEFT,DOWN,RGHT \
|
||||
),
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
};
|
@ -0,0 +1,104 @@
|
||||
/*
|
||||
Copyright 2017 Luiz Ribeiro <luizribeiro@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/>.
|
||||
*/
|
||||
|
||||
#include <avr/io.h>
|
||||
#include <util/delay.h>
|
||||
|
||||
#include "matrix.h"
|
||||
|
||||
#ifndef DEBOUNCE
|
||||
# define DEBOUNCE 5
|
||||
#endif
|
||||
|
||||
static uint8_t debouncing = DEBOUNCE;
|
||||
|
||||
static matrix_row_t matrix[MATRIX_ROWS];
|
||||
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
||||
|
||||
void matrix_init(void) {
|
||||
// all outputs for rows high
|
||||
DDRB = 0xFF;
|
||||
PORTB = 0xFF;
|
||||
// all inputs for columns
|
||||
DDRA = 0x00;
|
||||
DDRC &= ~(0x111111<<2);
|
||||
DDRD &= ~(1<<PIND7);
|
||||
// all columns are pulled-up
|
||||
PORTA = 0xFF;
|
||||
PORTC |= (0b111111<<2);
|
||||
PORTD |= (1<<PIND7);
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||
matrix[row] = 0x00;
|
||||
matrix_debouncing[row] = 0x00;
|
||||
}
|
||||
}
|
||||
|
||||
void matrix_set_row_status(uint8_t row) {
|
||||
DDRB = (1 << row);
|
||||
PORTB = ~(1 << row);
|
||||
}
|
||||
|
||||
uint8_t bit_reverse(uint8_t x) {
|
||||
x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa);
|
||||
x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc);
|
||||
x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0);
|
||||
return x;
|
||||
}
|
||||
|
||||
uint8_t matrix_scan(void) {
|
||||
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||
matrix_set_row_status(row);
|
||||
_delay_us(5);
|
||||
|
||||
matrix_row_t cols = (
|
||||
// cols 0..7, PORTA 0 -> 7
|
||||
(~PINA) & 0xFF
|
||||
) | (
|
||||
// cols 8..13, PORTC 7 -> 0
|
||||
bit_reverse((~PINC) & 0xFF) << 8
|
||||
) | (
|
||||
// col 14, PORTD 7
|
||||
((~PIND) & (1 << PIND7)) << 7
|
||||
);
|
||||
|
||||
if (matrix_debouncing[row] != cols) {
|
||||
matrix_debouncing[row] = cols;
|
||||
debouncing = DEBOUNCE;
|
||||
}
|
||||
}
|
||||
|
||||
if (debouncing) {
|
||||
if (--debouncing) {
|
||||
_delay_ms(1);
|
||||
} else {
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
matrix[i] = matrix_debouncing[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
inline matrix_row_t matrix_get_row(uint8_t row) {
|
||||
return matrix[row];
|
||||
}
|
||||
|
||||
void matrix_print(void) {
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright 2017 Luiz Ribeiro <luizribeiro@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/>.
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
import usb
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print('Usage: %s <firmware.hex>' % sys.argv[0])
|
||||
sys.exit(1)
|
||||
|
||||
print('Searching for ps2avrGB... ', end='')
|
||||
|
||||
dev = usb.core.find(idVendor=0x20A0, idProduct=0x422D)
|
||||
if dev is None:
|
||||
raise ValueError('Device not found')
|
||||
|
||||
print('Found', end='\n\n')
|
||||
|
||||
print('Device Information:')
|
||||
print(' idVendor: %d (0x%04x)' % (dev.idVendor, dev.idVendor))
|
||||
print(' idProduct: %d (0x%04x)' % (dev.idProduct, dev.idProduct))
|
||||
print('Manufacturer: %s' % (dev.iManufacturer))
|
||||
print('Serial: %s' % (dev.iSerialNumber))
|
||||
print('Product: %s' % (dev.iProduct), end='\n\n')
|
||||
|
||||
print('Transferring control to bootloader... ', end='')
|
||||
|
||||
dev.set_configuration()
|
||||
|
||||
request_type = usb.util.build_request_type(
|
||||
usb.util.CTRL_OUT,
|
||||
usb.util.CTRL_TYPE_CLASS,
|
||||
usb.util.CTRL_RECIPIENT_DEVICE)
|
||||
|
||||
USBRQ_HID_SET_REPORT = 0x09
|
||||
HID_REPORT_OPTION = 0x0301
|
||||
|
||||
|
||||
try:
|
||||
dev.ctrl_transfer(
|
||||
request_type,
|
||||
USBRQ_HID_SET_REPORT,
|
||||
HID_REPORT_OPTION,
|
||||
0,
|
||||
[0, 0, 0xFF] + [0] * 5
|
||||
)
|
||||
except usb.core.USBError:
|
||||
# for some reason I keep getting USBError, but it works!
|
||||
pass
|
||||
|
||||
# wait a bit until bootloader starts up
|
||||
time.sleep(2)
|
||||
|
||||
print('OK')
|
||||
print('Programming...')
|
||||
if os.system('bootloadHID -r "%s"' % sys.argv[1]) == 0:
|
||||
print('\nDone!')
|
@ -0,0 +1,43 @@
|
||||
/*
|
||||
Copyright 2017 Luiz Ribeiro <luizribeiro@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 KEYMAP_COMMON_H
|
||||
#define KEYMAP_COMMON_H
|
||||
|
||||
#include "keycode.h"
|
||||
#include "action.h"
|
||||
|
||||
#define KEYMAP( \
|
||||
K05, K25, K35, K45, K55, K06, KA6, KA7, K07, KB5, KC5, KD5, KE5, KD1, KE1, KE2, \
|
||||
K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, KD0, \
|
||||
K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, KD3, K67, \
|
||||
K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KD2, KE0, \
|
||||
K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, K86, K77, \
|
||||
K00, K10, K20, K56, K57, KB0, KC0, K66, K76, K96 \
|
||||
) \
|
||||
{ \
|
||||
{ KC_##K00, KC_##K10, KC_##K20, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_##KB0, KC_##KC0, KC_##KD0, KC_##KE0 }, \
|
||||
{ KC_##K01, KC_##K11, KC_##K21, KC_##K31, KC_##K41, KC_##K51, KC_NO, KC_NO, KC_NO, KC_NO, KC_##KA1, KC_##KB1, KC_NO, KC_##KD1, KC_##KE1 }, \
|
||||
{ KC_##K02, KC_##K12, KC_##K22, KC_##K32, KC_##K42, KC_##K52, KC_NO, KC_NO, KC_NO, KC_NO, KC_##KA2, KC_##KB2, KC_NO, KC_##KD2, KC_##KE2 }, \
|
||||
{ KC_##K03, KC_##K13, KC_##K23, KC_##K33, KC_##K43, KC_##K53, KC_NO, KC_NO, KC_NO, KC_NO, KC_##KA3, KC_##KB3, KC_##KC3, KC_##KD3, KC_NO }, \
|
||||
{ KC_##K04, KC_##K14, KC_##K24, KC_##K34, KC_##K44, KC_##K54, KC_NO, KC_NO, KC_NO, KC_NO, KC_##KA4, KC_##KB4, KC_##KC4, KC_NO, KC_##KE4 }, \
|
||||
{ KC_##K05, KC_NO, KC_##K25, KC_##K35, KC_##K45, KC_##K55, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_##KB5, KC_##KC5, KC_##KD5, KC_##KE5 }, \
|
||||
{ KC_##K06, KC_##K16, KC_##K26, KC_##K36, KC_##K46, KC_##K56, KC_##K66, KC_##K76, KC_##K86, KC_##K96, KC_##KA6, KC_##KB6, KC_##KC6, KC_##KD6, KC_##KE6 }, \
|
||||
{ KC_##K07, KC_##K17, KC_##K27, KC_##K37, KC_##K47, KC_##K57, KC_##K67, KC_##K77, KC_NO, KC_NO, KC_##KA7, KC_##KB7, KC_##KC7, KC_##KD7, KC_##KE7 } \
|
||||
}
|
||||
|
||||
#endif
|
@ -0,0 +1,43 @@
|
||||
# Copyright 2017 Luiz Ribeiro <luizribeiro@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/>.
|
||||
|
||||
# MCU name
|
||||
MCU = atmega32a
|
||||
PROTOCOL = VUSB
|
||||
|
||||
# unsupported features for now
|
||||
NO_UART = yes
|
||||
NO_SUSPEND_POWER_DOWN = yes
|
||||
BACKLIGHT_ENABLE = no
|
||||
|
||||
# processor frequency
|
||||
F_CPU = 12000000
|
||||
|
||||
# build options
|
||||
BOOTMAGIC_ENABLE = yes
|
||||
MOUSEKEY_ENABLE = yes
|
||||
EXTRAKEY_ENABLE = yes
|
||||
CONSOLE_ENABLE = yes
|
||||
COMMAND_ENABLE = yes
|
||||
|
||||
OPT_DEFS = -DDEBUG_LEVEL=0
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=2048
|
||||
|
||||
# custom matrix setup
|
||||
CUSTOM_MATRIX = yes
|
||||
SRC = matrix.c
|
||||
|
||||
# programming options
|
||||
PROGRAM_CMD = ./keyboards/ps2avrGB/program $(TARGET).hex
|
@ -0,0 +1,396 @@
|
||||
/* Name: usbconfig.h
|
||||
* Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers
|
||||
* Author: Christian Starkjohann
|
||||
* Creation Date: 2005-04-01
|
||||
* Tabsize: 4
|
||||
* Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH
|
||||
* License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
|
||||
* This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $
|
||||
*/
|
||||
|
||||
#ifndef __usbconfig_h_included__
|
||||
#define __usbconfig_h_included__
|
||||
|
||||
#include "config.h"
|
||||
|
||||
/*
|
||||
General Description:
|
||||
This file is an example configuration (with inline documentation) for the USB
|
||||
driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is
|
||||
also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may
|
||||
wire the lines to any other port, as long as D+ is also wired to INT0 (or any
|
||||
other hardware interrupt, as long as it is the highest level interrupt, see
|
||||
section at the end of this file).
|
||||
*/
|
||||
|
||||
/* ---------------------------- Hardware Config ---------------------------- */
|
||||
|
||||
#define USB_CFG_IOPORTNAME D
|
||||
/* This is the port where the USB bus is connected. When you configure it to
|
||||
* "B", the registers PORTB, PINB and DDRB will be used.
|
||||
*/
|
||||
#define USB_CFG_DMINUS_BIT 3
|
||||
/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected.
|
||||
* This may be any bit in the port.
|
||||
*/
|
||||
#define USB_CFG_DPLUS_BIT 2
|
||||
/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected.
|
||||
* This may be any bit in the port. Please note that D+ must also be connected
|
||||
* to interrupt pin INT0! [You can also use other interrupts, see section
|
||||
* "Optional MCU Description" below, or you can connect D- to the interrupt, as
|
||||
* it is required if you use the USB_COUNT_SOF feature. If you use D- for the
|
||||
* interrupt, the USB interrupt will also be triggered at Start-Of-Frame
|
||||
* markers every millisecond.]
|
||||
*/
|
||||
#define USB_CFG_CLOCK_KHZ (F_CPU/1000)
|
||||
/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000,
|
||||
* 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code
|
||||
* require no crystal, they tolerate +/- 1% deviation from the nominal
|
||||
* frequency. All other rates require a precision of 2000 ppm and thus a
|
||||
* crystal!
|
||||
* Since F_CPU should be defined to your actual clock rate anyway, you should
|
||||
* not need to modify this setting.
|
||||
*/
|
||||
#define USB_CFG_CHECK_CRC 0
|
||||
/* Define this to 1 if you want that the driver checks integrity of incoming
|
||||
* data packets (CRC checks). CRC checks cost quite a bit of code size and are
|
||||
* currently only available for 18 MHz crystal clock. You must choose
|
||||
* USB_CFG_CLOCK_KHZ = 18000 if you enable this option.
|
||||
*/
|
||||
|
||||
/* ----------------------- Optional Hardware Config ------------------------ */
|
||||
|
||||
/* #define USB_CFG_PULLUP_IOPORTNAME D */
|
||||
/* If you connect the 1.5k pullup resistor from D- to a port pin instead of
|
||||
* V+, you can connect and disconnect the device from firmware by calling
|
||||
* the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h).
|
||||
* This constant defines the port on which the pullup resistor is connected.
|
||||
*/
|
||||
/* #define USB_CFG_PULLUP_BIT 4 */
|
||||
/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined
|
||||
* above) where the 1.5k pullup resistor is connected. See description
|
||||
* above for details.
|
||||
*/
|
||||
|
||||
/* --------------------------- Functional Range ---------------------------- */
|
||||
|
||||
#define USB_CFG_HAVE_INTRIN_ENDPOINT 1
|
||||
/* Define this to 1 if you want to compile a version with two endpoints: The
|
||||
* default control endpoint 0 and an interrupt-in endpoint (any other endpoint
|
||||
* number).
|
||||
*/
|
||||
#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1
|
||||
/* Define this to 1 if you want to compile a version with three endpoints: The
|
||||
* default control endpoint 0, an interrupt-in endpoint 3 (or the number
|
||||
* configured below) and a catch-all default interrupt-in endpoint as above.
|
||||
* You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature.
|
||||
*/
|
||||
#define USB_CFG_EP3_NUMBER 3
|
||||
/* If the so-called endpoint 3 is used, it can now be configured to any other
|
||||
* endpoint number (except 0) with this macro. Default if undefined is 3.
|
||||
*/
|
||||
/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */
|
||||
/* The above macro defines the startup condition for data toggling on the
|
||||
* interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1.
|
||||
* Since the token is toggled BEFORE sending any data, the first packet is
|
||||
* sent with the oposite value of this configuration!
|
||||
*/
|
||||
#define USB_CFG_IMPLEMENT_HALT 0
|
||||
/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature
|
||||
* for endpoint 1 (interrupt endpoint). Although you may not need this feature,
|
||||
* it is required by the standard. We have made it a config option because it
|
||||
* bloats the code considerably.
|
||||
*/
|
||||
#define USB_CFG_SUPPRESS_INTR_CODE 0
|
||||
/* Define this to 1 if you want to declare interrupt-in endpoints, but don't
|
||||
* want to send any data over them. If this macro is defined to 1, functions
|
||||
* usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if
|
||||
* you need the interrupt-in endpoints in order to comply to an interface
|
||||
* (e.g. HID), but never want to send any data. This option saves a couple
|
||||
* of bytes in flash memory and the transmit buffers in RAM.
|
||||
*/
|
||||
#define USB_CFG_INTR_POLL_INTERVAL 1
|
||||
/* If you compile a version with endpoint 1 (interrupt-in), this is the poll
|
||||
* interval. The value is in milliseconds and must not be less than 10 ms for
|
||||
* low speed devices.
|
||||
*/
|
||||
#define USB_CFG_IS_SELF_POWERED 0
|
||||
/* Define this to 1 if the device has its own power supply. Set it to 0 if the
|
||||
* device is powered from the USB bus.
|
||||
*/
|
||||
#define USB_CFG_MAX_BUS_POWER 500
|
||||
/* Set this variable to the maximum USB bus power consumption of your device.
|
||||
* The value is in milliamperes. [It will be divided by two since USB
|
||||
* communicates power requirements in units of 2 mA.]
|
||||
*/
|
||||
#define USB_CFG_IMPLEMENT_FN_WRITE 1
|
||||
/* Set this to 1 if you want usbFunctionWrite() to be called for control-out
|
||||
* transfers. Set it to 0 if you don't need it and want to save a couple of
|
||||
* bytes.
|
||||
*/
|
||||
#define USB_CFG_IMPLEMENT_FN_READ 0
|
||||
/* Set this to 1 if you need to send control replies which are generated
|
||||
* "on the fly" when usbFunctionRead() is called. If you only want to send
|
||||
* data from a static buffer, set it to 0 and return the data from
|
||||
* usbFunctionSetup(). This saves a couple of bytes.
|
||||
*/
|
||||
#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0
|
||||
/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints.
|
||||
* You must implement the function usbFunctionWriteOut() which receives all
|
||||
* interrupt/bulk data sent to any endpoint other than 0. The endpoint number
|
||||
* can be found in 'usbRxToken'.
|
||||
*/
|
||||
#define USB_CFG_HAVE_FLOWCONTROL 0
|
||||
/* Define this to 1 if you want flowcontrol over USB data. See the definition
|
||||
* of the macros usbDisableAllRequests() and usbEnableAllRequests() in
|
||||
* usbdrv.h.
|
||||
*/
|
||||
#define USB_CFG_DRIVER_FLASH_PAGE 0
|
||||
/* If the device has more than 64 kBytes of flash, define this to the 64 k page
|
||||
* where the driver's constants (descriptors) are located. Or in other words:
|
||||
* Define this to 1 for boot loaders on the ATMega128.
|
||||
*/
|
||||
#define USB_CFG_LONG_TRANSFERS 0
|
||||
/* Define this to 1 if you want to send/receive blocks of more than 254 bytes
|
||||
* in a single control-in or control-out transfer. Note that the capability
|
||||
* for long transfers increases the driver size.
|
||||
*/
|
||||
/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */
|
||||
/* This macro is a hook if you want to do unconventional things. If it is
|
||||
* defined, it's inserted at the beginning of received message processing.
|
||||
* If you eat the received message and don't want default processing to
|
||||
* proceed, do a return after doing your things. One possible application
|
||||
* (besides debugging) is to flash a status LED on each packet.
|
||||
*/
|
||||
/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */
|
||||
/* This macro is a hook if you need to know when an USB RESET occurs. It has
|
||||
* one parameter which distinguishes between the start of RESET state and its
|
||||
* end.
|
||||
*/
|
||||
/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */
|
||||
/* This macro (if defined) is executed when a USB SET_ADDRESS request was
|
||||
* received.
|
||||
*/
|
||||
#define USB_COUNT_SOF 1
|
||||
/* define this macro to 1 if you need the global variable "usbSofCount" which
|
||||
* counts SOF packets. This feature requires that the hardware interrupt is
|
||||
* connected to D- instead of D+.
|
||||
*/
|
||||
/* #ifdef __ASSEMBLER__
|
||||
* macro myAssemblerMacro
|
||||
* in YL, TCNT0
|
||||
* sts timer0Snapshot, YL
|
||||
* endm
|
||||
* #endif
|
||||
* #define USB_SOF_HOOK myAssemblerMacro
|
||||
* This macro (if defined) is executed in the assembler module when a
|
||||
* Start Of Frame condition is detected. It is recommended to define it to
|
||||
* the name of an assembler macro which is defined here as well so that more
|
||||
* than one assembler instruction can be used. The macro may use the register
|
||||
* YL and modify SREG. If it lasts longer than a couple of cycles, USB messages
|
||||
* immediately after an SOF pulse may be lost and must be retried by the host.
|
||||
* What can you do with this hook? Since the SOF signal occurs exactly every
|
||||
* 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in
|
||||
* designs running on the internal RC oscillator.
|
||||
* Please note that Start Of Frame detection works only if D- is wired to the
|
||||
* interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES!
|
||||
*/
|
||||
#define USB_CFG_CHECK_DATA_TOGGLING 0
|
||||
/* define this macro to 1 if you want to filter out duplicate data packets
|
||||
* sent by the host. Duplicates occur only as a consequence of communication
|
||||
* errors, when the host does not receive an ACK. Please note that you need to
|
||||
* implement the filtering yourself in usbFunctionWriteOut() and
|
||||
* usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable
|
||||
* for each control- and out-endpoint to check for duplicate packets.
|
||||
*/
|
||||
#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0
|
||||
/* define this macro to 1 if you want the function usbMeasureFrameLength()
|
||||
* compiled in. This function can be used to calibrate the AVR's RC oscillator.
|
||||
*/
|
||||
#define USB_USE_FAST_CRC 0
|
||||
/* The assembler module has two implementations for the CRC algorithm. One is
|
||||
* faster, the other is smaller. This CRC routine is only used for transmitted
|
||||
* messages where timing is not critical. The faster routine needs 31 cycles
|
||||
* per byte while the smaller one needs 61 to 69 cycles. The faster routine
|
||||
* may be worth the 32 bytes bigger code size if you transmit lots of data and
|
||||
* run the AVR close to its limit.
|
||||
*/
|
||||
|
||||
/* -------------------------- Device Description --------------------------- */
|
||||
|
||||
#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF)
|
||||
/* USB vendor ID for the device, low byte first. If you have registered your
|
||||
* own Vendor ID, define it here. Otherwise you may use one of obdev's free
|
||||
* shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules!
|
||||
* *** IMPORTANT NOTE ***
|
||||
* This template uses obdev's shared VID/PID pair for Vendor Class devices
|
||||
* with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand
|
||||
* the implications!
|
||||
*/
|
||||
#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF)
|
||||
/* This is the ID of the product, low byte first. It is interpreted in the
|
||||
* scope of the vendor ID. If you have registered your own VID with usb.org
|
||||
* or if you have licensed a PID from somebody else, define it here. Otherwise
|
||||
* you may use one of obdev's free shared VID/PID pairs. See the file
|
||||
* USB-IDs-for-free.txt for details!
|
||||
* *** IMPORTANT NOTE ***
|
||||
* This template uses obdev's shared VID/PID pair for Vendor Class devices
|
||||
* with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand
|
||||
* the implications!
|
||||
*/
|
||||
#define USB_CFG_DEVICE_VERSION 0x00, 0x02
|
||||
/* Version number of the device: Minor number first, then major number.
|
||||
*/
|
||||
#define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r'
|
||||
#define USB_CFG_VENDOR_NAME_LEN 13
|
||||
/* These two values define the vendor name returned by the USB device. The name
|
||||
* must be given as a list of characters under single quotes. The characters
|
||||
* are interpreted as Unicode (UTF-16) entities.
|
||||
* If you don't want a vendor name string, undefine these macros.
|
||||
* ALWAYS define a vendor name containing your Internet domain name if you use
|
||||
* obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for
|
||||
* details.
|
||||
*/
|
||||
#define USB_CFG_DEVICE_NAME 'p', 's', '2', 'a', 'v', 'r', 'G', 'B'
|
||||
#define USB_CFG_DEVICE_NAME_LEN 8
|
||||
/* Same as above for the device name. If you don't want a device name, undefine
|
||||
* the macros. See the file USB-IDs-for-free.txt before you assign a name if
|
||||
* you use a shared VID/PID.
|
||||
*/
|
||||
/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */
|
||||
/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */
|
||||
/* Same as above for the serial number. If you don't want a serial number,
|
||||
* undefine the macros.
|
||||
* It may be useful to provide the serial number through other means than at
|
||||
* compile time. See the section about descriptor properties below for how
|
||||
* to fine tune control over USB descriptors such as the string descriptor
|
||||
* for the serial number.
|
||||
*/
|
||||
#define USB_CFG_DEVICE_CLASS 0
|
||||
#define USB_CFG_DEVICE_SUBCLASS 0
|
||||
/* See USB specification if you want to conform to an existing device class.
|
||||
* Class 0xff is "vendor specific".
|
||||
*/
|
||||
#define USB_CFG_INTERFACE_CLASS 3 /* HID */
|
||||
#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */
|
||||
#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */
|
||||
/* See USB specification if you want to conform to an existing device class or
|
||||
* protocol. The following classes must be set at interface level:
|
||||
* HID class is 3, no subclass and protocol required (but may be useful!)
|
||||
* CDC class is 2, use subclass 2 and protocol 1 for ACM
|
||||
*/
|
||||
#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0
|
||||
/* Define this to the length of the HID report descriptor, if you implement
|
||||
* an HID device. Otherwise don't define it or define it to 0.
|
||||
* If you use this define, you must add a PROGMEM character array named
|
||||
* "usbHidReportDescriptor" to your code which contains the report descriptor.
|
||||
* Don't forget to keep the array and this define in sync!
|
||||
*/
|
||||
|
||||
/* #define USB_PUBLIC static */
|
||||
/* Use the define above if you #include usbdrv.c instead of linking against it.
|
||||
* This technique saves a couple of bytes in flash memory.
|
||||
*/
|
||||
|
||||
/* ------------------- Fine Control over USB Descriptors ------------------- */
|
||||
/* If you don't want to use the driver's default USB descriptors, you can
|
||||
* provide our own. These can be provided as (1) fixed length static data in
|
||||
* flash memory, (2) fixed length static data in RAM or (3) dynamically at
|
||||
* runtime in the function usbFunctionDescriptor(). See usbdrv.h for more
|
||||
* information about this function.
|
||||
* Descriptor handling is configured through the descriptor's properties. If
|
||||
* no properties are defined or if they are 0, the default descriptor is used.
|
||||
* Possible properties are:
|
||||
* + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched
|
||||
* at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is
|
||||
* used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if
|
||||
* you want RAM pointers.
|
||||
* + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found
|
||||
* in static memory is in RAM, not in flash memory.
|
||||
* + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash),
|
||||
* the driver must know the descriptor's length. The descriptor itself is
|
||||
* found at the address of a well known identifier (see below).
|
||||
* List of static descriptor names (must be declared PROGMEM if in flash):
|
||||
* char usbDescriptorDevice[];
|
||||
* char usbDescriptorConfiguration[];
|
||||
* char usbDescriptorHidReport[];
|
||||
* char usbDescriptorString0[];
|
||||
* int usbDescriptorStringVendor[];
|
||||
* int usbDescriptorStringDevice[];
|
||||
* int usbDescriptorStringSerialNumber[];
|
||||
* Other descriptors can't be provided statically, they must be provided
|
||||
* dynamically at runtime.
|
||||
*
|
||||
* Descriptor properties are or-ed or added together, e.g.:
|
||||
* #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18))
|
||||
*
|
||||
* The following descriptors are defined:
|
||||
* USB_CFG_DESCR_PROPS_DEVICE
|
||||
* USB_CFG_DESCR_PROPS_CONFIGURATION
|
||||
* USB_CFG_DESCR_PROPS_STRINGS
|
||||
* USB_CFG_DESCR_PROPS_STRING_0
|
||||
* USB_CFG_DESCR_PROPS_STRING_VENDOR
|
||||
* USB_CFG_DESCR_PROPS_STRING_PRODUCT
|
||||
* USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER
|
||||
* USB_CFG_DESCR_PROPS_HID
|
||||
* USB_CFG_DESCR_PROPS_HID_REPORT
|
||||
* USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver)
|
||||
*
|
||||
* Note about string descriptors: String descriptors are not just strings, they
|
||||
* are Unicode strings prefixed with a 2 byte header. Example:
|
||||
* int serialNumberDescriptor[] = {
|
||||
* USB_STRING_DESCRIPTOR_HEADER(6),
|
||||
* 'S', 'e', 'r', 'i', 'a', 'l'
|
||||
* };
|
||||
*/
|
||||
|
||||
#define USB_CFG_DESCR_PROPS_DEVICE 0
|
||||
#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC
|
||||
//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0
|
||||
#define USB_CFG_DESCR_PROPS_STRINGS 0
|
||||
#define USB_CFG_DESCR_PROPS_STRING_0 0
|
||||
#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0
|
||||
#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0
|
||||
#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0
|
||||
#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC
|
||||
//#define USB_CFG_DESCR_PROPS_HID 0
|
||||
#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC
|
||||
//#define USB_CFG_DESCR_PROPS_HID_REPORT 0
|
||||
#define USB_CFG_DESCR_PROPS_UNKNOWN 0
|
||||
|
||||
#define usbMsgPtr_t unsigned short
|
||||
/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to
|
||||
* a scalar type here because gcc generates slightly shorter code for scalar
|
||||
* arithmetics than for pointer arithmetics. Remove this define for backward
|
||||
* type compatibility or define it to an 8 bit type if you use data in RAM only
|
||||
* and all RAM is below 256 bytes (tiny memory model in IAR CC).
|
||||
*/
|
||||
|
||||
/* ----------------------- Optional MCU Description ------------------------ */
|
||||
|
||||
/* The following configurations have working defaults in usbdrv.h. You
|
||||
* usually don't need to set them explicitly. Only if you want to run
|
||||
* the driver on a device which is not yet supported or with a compiler
|
||||
* which is not fully supported (such as IAR C) or if you use a differnt
|
||||
* interrupt than INT0, you may have to define some of these.
|
||||
*/
|
||||
/* #define USB_INTR_CFG MCUCR */
|
||||
/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */
|
||||
/* #define USB_INTR_CFG_CLR 0 */
|
||||
/* #define USB_INTR_ENABLE GIMSK */
|
||||
/* #define USB_INTR_ENABLE_BIT INT0 */
|
||||
/* #define USB_INTR_PENDING GIFR */
|
||||
/* #define USB_INTR_PENDING_BIT INTF0 */
|
||||
/* #define USB_INTR_VECTOR INT0_vect */
|
||||
|
||||
/* Set INT1 for D- falling edge to count SOF */
|
||||
/* #define USB_INTR_CFG EICRA */
|
||||
#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10))
|
||||
/* #define USB_INTR_CFG_CLR 0 */
|
||||
/* #define USB_INTR_ENABLE EIMSK */
|
||||
#define USB_INTR_ENABLE_BIT INT1
|
||||
/* #define USB_INTR_PENDING EIFR */
|
||||
#define USB_INTR_PENDING_BIT INTF1
|
||||
#define USB_INTR_VECTOR INT1_vect
|
||||
|
||||
#endif /* __usbconfig_h_included__ */
|
@ -0,0 +1,152 @@
|
||||
#include "satan.h"
|
||||
#include "action_layer.h"
|
||||
#include "rgblight.h"
|
||||
|
||||
#define _DEFAULT 0
|
||||
#define _FN 1
|
||||
#define _SFX 2
|
||||
|
||||
enum planck_keycodes {
|
||||
DEFAULT = SAFE_RANGE
|
||||
};
|
||||
|
||||
// Fillers to make layering more clear
|
||||
#define ______ KC_TRNS
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Qwerty gui/alt/space/alt/gui
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Bksp |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | Enter |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Shift | Z | X | C | V | B | N | M | , | . | / | RShift | FN |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* |LGUI | LAlt | Space | RAlt |RGUI |
|
||||
* `-----------------------------------------------------------------'
|
||||
*/
|
||||
[_DEFAULT] = KEYMAP_HHKB( /* Basic QWERTY */
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSPC, \
|
||||
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FN), \
|
||||
______, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, ______, ______ \
|
||||
),
|
||||
|
||||
/* FN Layer
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | CAPS | BL- | BL+ | BL | | | | | Psc | Slck| Paus| Up | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | Vol-| Vol+| Mute| | | * | / | Home| PgUp| Left|Right| |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | Prev| Play| Next| | | + | - | End |PgDn| Down| | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | Stop | |
|
||||
* `-----------------------------------------------------------------'
|
||||
*/
|
||||
[_FN] = KEYMAP_HHKB( /* Layer 1 */
|
||||
TG(_SFX), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \
|
||||
KC_CAPS, ______, ______, ______, ______, ______, ______, ______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, ______, ______, \
|
||||
______, KC_VOLD,KC_VOLU,KC_MUTE,______, ______, KC_PAST,KC_PSLS,KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, ______, \
|
||||
______, KC_MPRV,KC_MPLY,KC_MNXT,______, ______, KC_PPLS,KC_PMNS,KC_END, KC_PGDN, KC_DOWN, ______, ______, \
|
||||
______, ______, ______, ______, KC_MSTP, ______, ______, ______ \
|
||||
),
|
||||
|
||||
/* SFX Layer
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | BL- | BL+ | BL | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | RGBT| RGBM| | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | Hue+| Hue-| Sat+| Sat-| Val+| Val-| | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | |
|
||||
* `-----------------------------------------------------------------'
|
||||
*/
|
||||
[_SFX] = KEYMAP_HHKB(
|
||||
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
|
||||
______, BL_DEC, BL_INC, BL_TOGG,______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
|
||||
______, F(0), F(1), ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \
|
||||
______, F(2), F(3), F(4), F(5), F(6), F(7), ______, ______, ______, ______, ______, ______, \
|
||||
______, ______, ______, ______, ______, ______, ______, ______ \
|
||||
)
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
// MACRODOWN only works in this function
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
enum function_id {
|
||||
RGBLED_TOGGLE,
|
||||
RGBLED_STEP_MODE,
|
||||
RGBLED_INCREASE_HUE,
|
||||
RGBLED_DECREASE_HUE,
|
||||
RGBLED_INCREASE_SAT,
|
||||
RGBLED_DECREASE_SAT,
|
||||
RGBLED_INCREASE_VAL,
|
||||
RGBLED_DECREASE_VAL
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[0] = ACTION_FUNCTION(RGBLED_TOGGLE),
|
||||
[1] = ACTION_FUNCTION(RGBLED_STEP_MODE),
|
||||
[2] = ACTION_FUNCTION(RGBLED_INCREASE_HUE),
|
||||
[3] = ACTION_FUNCTION(RGBLED_DECREASE_HUE),
|
||||
[4] = ACTION_FUNCTION(RGBLED_INCREASE_SAT),
|
||||
[5] = ACTION_FUNCTION(RGBLED_DECREASE_SAT),
|
||||
[6] = ACTION_FUNCTION(RGBLED_INCREASE_VAL),
|
||||
[7] = ACTION_FUNCTION(RGBLED_DECREASE_VAL)
|
||||
};
|
||||
|
||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
switch (id) {
|
||||
case RGBLED_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
rgblight_toggle();
|
||||
}
|
||||
break;
|
||||
case RGBLED_INCREASE_HUE:
|
||||
if (record->event.pressed) {
|
||||
rgblight_increase_hue();
|
||||
}
|
||||
break;
|
||||
case RGBLED_DECREASE_HUE:
|
||||
if (record->event.pressed) {
|
||||
rgblight_decrease_hue();
|
||||
}
|
||||
break;
|
||||
case RGBLED_INCREASE_SAT:
|
||||
if (record->event.pressed) {
|
||||
rgblight_increase_sat();
|
||||
}
|
||||
break;
|
||||
case RGBLED_DECREASE_SAT:
|
||||
if (record->event.pressed) {
|
||||
rgblight_decrease_sat();
|
||||
}
|
||||
break;
|
||||
case RGBLED_INCREASE_VAL:
|
||||
if (record->event.pressed) {
|
||||
rgblight_increase_val();
|
||||
}
|
||||
break;
|
||||
case RGBLED_DECREASE_VAL:
|
||||
if (record->event.pressed) {
|
||||
rgblight_decrease_val();
|
||||
}
|
||||
break;
|
||||
case RGBLED_STEP_MODE:
|
||||
if (record->event.pressed) {
|
||||
rgblight_step();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
@ -1,110 +0,0 @@
|
||||
// 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 "satan.h"
|
||||
|
||||
#define _DEFAULT 0
|
||||
#define _ALTDISP 1
|
||||
#define _FN 2
|
||||
|
||||
enum planck_keycodes {
|
||||
DEFAULT = SAFE_RANGE,
|
||||
ALTDISP
|
||||
};
|
||||
|
||||
// Fillers to make layering more clear
|
||||
#define ______ KC_TRNS
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Qwerty alt/gui/space/gui/alt
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Bksp |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | Enter |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Shift | Z | X | C | V | B | N | M | , | . | / | RShift | FN |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | LAlt| LGUI | Space | RGUI | RAlt |
|
||||
* `-----------------------------------------------------------------'
|
||||
*/
|
||||
[_DEFAULT] = KEYMAP_HHKB( /* Basic QWERTY */
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \
|
||||
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FN), \
|
||||
______, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, ______, ______ \
|
||||
),
|
||||
|
||||
/* Qwerty gui/alt/space/alt/gui
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Bksp |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | Enter |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Shift | Z | X | C | V | B | N | M | , | . | / | RShift | FN |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* |LGUI | LAlt | Space | RAlt |RGUI |
|
||||
* `-----------------------------------------------------------------'
|
||||
*/
|
||||
[_ALTDISP] = KEYMAP_HHKB( /* Basic QWERTY */
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \
|
||||
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FN), \
|
||||
______, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, ______, ______ \
|
||||
),
|
||||
|
||||
/* FN Layer
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | CAPS | BL- | BL+ | BL | | | | | Psc | Slck| Paus| Up | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | Vol-| Vol+| Mute| | | * | / | Home| PgUp| Left|Right| |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | Prev| Play| Next| | | + | - | End |PgDn| Down| | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | Stop | |
|
||||
* `-----------------------------------------------------------------'
|
||||
*/
|
||||
[_FN] = KEYMAP_HHKB( /* Layer 1 */
|
||||
______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \
|
||||
KC_CAPS, BL_DEC, BL_INC, BL_TOGG, ______, ______, ______, ______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, ______, ______, \
|
||||
______, KC_VOLD, KC_VOLU, KC_MUTE, ______, ______, KC_PAST, KC_PSLS,KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, ______, \
|
||||
______, KC_MPRV, KC_MPLY, KC_MNXT,______,______,KC_PPLS,KC_PMNS,KC_END, KC_PGDN, KC_DOWN, ______,______, \
|
||||
______, DEFAULT, ALTDISP, ______, KC_MSTP, ______, ______, ______ \
|
||||
)
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
// MACRODOWN only works in this function
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
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 DEFAULT:
|
||||
if (record->event.pressed) {
|
||||
persistant_default_layer_set(1UL<<_DEFAULT);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case ALTDISP:
|
||||
if (record->event.pressed) {
|
||||
persistant_default_layer_set(1UL<<_ALTDISP);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
@ -0,0 +1,280 @@
|
||||
#include "subatomic.h"
|
||||
#include "action_layer.h"
|
||||
#include "eeconfig.h"
|
||||
#ifdef AUDIO_ENABLE
|
||||
#include "audio.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 _COLEMAK 1
|
||||
#define _DVORAK 2
|
||||
#define _LOWER 3
|
||||
#define _RAISE 4
|
||||
#define _ADJUST 16
|
||||
|
||||
enum subatomic_keycodes {
|
||||
QWERTY = SAFE_RANGE,
|
||||
COLEMAK,
|
||||
DVORAK,
|
||||
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] = {
|
||||
|
||||
/* Qwerty
|
||||
* ,-------------------------------------------------------------------------------------------------.
|
||||
* | Ins | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | Del |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | - | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] |
|
||||
* |------+------+------+------+------+------+-------------+------+------+------+------+------+------|
|
||||
* | = | Esc | A | S | D | F | G | H | J | K | L | ; | " |Enter |
|
||||
* |------+------+------+------+------+------+------|------+------+------+------+------+------+------|
|
||||
* | Pg Up| Shift| Z | X | C | V | B | N | M | , | . | / | Home | End |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Pg Dn| Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up | Right| \ |
|
||||
* `-------------------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_QWERTY] = {
|
||||
{KC_TRNS, 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_TRNS},
|
||||
{KC_TRNS, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, KC_TRNS},
|
||||
{KC_TRNS, 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_TRNS},
|
||||
{KC_TRNS, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, KC_TRNS},
|
||||
{KC_TRNS, BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS}
|
||||
},
|
||||
|
||||
/* Colemak
|
||||
* ,-------------------------------------------------------------------------------------------------.
|
||||
* | Ins | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | Del |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | - | Tab | Q | W | F | P | G | J | L | U | Y | ; | [ | ] |
|
||||
* |------+------+------+------+------+------+-------------+------+------+------+------+------+------|
|
||||
* | = | Esc | A | R | S | T | D | H | N | E | I | O | " |Enter |
|
||||
* |------+------+------+------+------+------+------|------+------+------+------+------+------+------|
|
||||
* | Pg Up| Shift| Z | X | C | V | B | K | M | , | . | / | Home | End |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Pg Dn| Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up | Right| \ |
|
||||
* `-------------------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_COLEMAK] = {
|
||||
{KC_TRNS, 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_TRNS},
|
||||
{KC_TRNS, KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL, KC_TRNS},
|
||||
{KC_TRNS, KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_TRNS},
|
||||
{KC_TRNS, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, KC_TRNS},
|
||||
{KC_TRNS, BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS}
|
||||
},
|
||||
|
||||
/* Dvorak
|
||||
* ,-------------------------------------------------------------------------------------------------.
|
||||
* | Ins | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | Del |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | [ | Tab | " | , | . | P | Y | F | G | C | R | L | / | = |
|
||||
* |------+------+------+------+------+------+-------------+------+------+------+------+------+------|
|
||||
* | ] | Esc | A | O | E | U | I | D | H | T | N | S | - |Enter |
|
||||
* |------+------+------+------+------+------+------|------+------+------+------+------+------+------|
|
||||
* | Pg Up| Shift| ; | Q | J | K | X | B | M | W | V | Z | Home | End |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Pg Dn| Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up | Right| \ |
|
||||
* `-------------------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_DVORAK] = {
|
||||
{KC_TRNS, 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_TRNS},
|
||||
{KC_TRNS, KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, KC_TRNS},
|
||||
{KC_TRNS, KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, KC_TRNS},
|
||||
{KC_TRNS, KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT, KC_TRNS},
|
||||
{KC_TRNS, BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS}
|
||||
},
|
||||
|
||||
/* Lower
|
||||
* ,-------------------------------------------------------------------------------------------------.
|
||||
* | | ~ | F1 | F3 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
|
||||
* |------+------+------+------+------+------+-------------+------+------+------+------+------+------|
|
||||
* | _ | Tab | ! | @ | # | $ | % | ^ | & | * | ( | ) | { | } |
|
||||
* |------+------+------+------+------+------+-------------+------+------+------+------+------+------|
|
||||
* | + | Esc | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
|
||||
* |------+------+------+------+------+------+------|------+------+------+------+------+------+------|
|
||||
* | | Shift| F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | | | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | | | Next | Vol- | Vol+ | Play | |
|
||||
* `-------------------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_LOWER] = {
|
||||
{KC_TRNS, KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, KC_TRNS},
|
||||
{KC_TRNS, 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_TRNS},
|
||||
{KC_TRNS, KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, KC_TRNS},
|
||||
{KC_TRNS, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______,KC_TRNS},
|
||||
{KC_TRNS, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, KC_TRNS}
|
||||
},
|
||||
|
||||
/* Raise
|
||||
* ,-------------------------------------------------------------------------------------------------.
|
||||
* | | ~ | F1 | F3 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | _ | Tab | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | { | } |
|
||||
* |------+------+------+------+------+------+-------------+------+------+------+------+------+------|
|
||||
* | + | Esc | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | | |
|
||||
* |------+------+------+------+------+------+------|------+------+------+------+------+------+------|
|
||||
* | | Shift| F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | | | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | | | Next | Vol- | Vol+ | | Play |
|
||||
* `-------------------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_RAISE] = {
|
||||
{KC_TRNS, 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_TRNS},
|
||||
{KC_TRNS, 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_TRNS},
|
||||
{KC_TRNS, KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, KC_TRNS},
|
||||
{KC_TRNS, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, KC_TRNS},
|
||||
{KC_TRNS, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, KC_TRNS}
|
||||
},
|
||||
|
||||
/* Adjust (Lower + Raise)
|
||||
* ,-------------------------------------------------------------------------------------------------.
|
||||
* | | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | Reset| | | | | | | | | | | |
|
||||
* |------+------+------+------+------+------+-------------+------+------+------+------+------+------|
|
||||
* | | | | |Aud on|AudOff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | |
|
||||
* |------+------+------+------+------+------+------|------+------+------+------+------+------+------|
|
||||
* | | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | | | |
|
||||
* `-------------------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_ADJUST] = {
|
||||
{KC_TRNS, 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, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, KC_TRNS},
|
||||
{KC_TRNS, _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, KC_TRNS},
|
||||
{KC_TRNS, _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, KC_TRNS},
|
||||
{KC_TRNS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_TRNS}
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
float tone_startup[][2] = {
|
||||
{NOTE_B5, 20},
|
||||
{NOTE_B6, 8},
|
||||
{NOTE_DS6, 20},
|
||||
{NOTE_B6, 8}
|
||||
};
|
||||
|
||||
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
|
||||
float tone_dvorak[][2] = SONG(DVORAK_SOUND);
|
||||
float tone_colemak[][2] = SONG(COLEMAK_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 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 COLEMAK:
|
||||
if (record->event.pressed) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_NOTE_ARRAY(tone_colemak, false, 0);
|
||||
#endif
|
||||
persistant_default_layer_set(1UL<<_COLEMAK);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
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 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,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,3 @@
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
@ -0,0 +1 @@
|
||||
#define KIIBOHD_BOOTLOADER
|
@ -0,0 +1,524 @@
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file templates/chconf.h
|
||||
* @brief Configuration file template.
|
||||
* @details A copy of this file must be placed in each project directory, it
|
||||
* contains the application specific kernel settings.
|
||||
*
|
||||
* @addtogroup config
|
||||
* @details Kernel related settings and hooks.
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef CHCONF_H
|
||||
#define CHCONF_H
|
||||
|
||||
#define _CHIBIOS_RT_CONF_
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name System timers settings
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief System time counter resolution.
|
||||
* @note Allowed values are 16 or 32 bits.
|
||||
*/
|
||||
#define CH_CFG_ST_RESOLUTION 32
|
||||
|
||||
/**
|
||||
* @brief System tick frequency.
|
||||
* @details Frequency of the system timer that drives the system ticks. This
|
||||
* setting also defines the system tick time unit.
|
||||
*/
|
||||
#define CH_CFG_ST_FREQUENCY 100000
|
||||
|
||||
/**
|
||||
* @brief Time delta constant for the tick-less mode.
|
||||
* @note If this value is zero then the system uses the classic
|
||||
* periodic tick. This value represents the minimum number
|
||||
* of ticks that is safe to specify in a timeout directive.
|
||||
* The value one is not valid, timeouts are rounded up to
|
||||
* this value.
|
||||
*/
|
||||
#define CH_CFG_ST_TIMEDELTA 0
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Kernel parameters and options
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Round robin interval.
|
||||
* @details This constant is the number of system ticks allowed for the
|
||||
* threads before preemption occurs. Setting this value to zero
|
||||
* disables the preemption for threads with equal priority and the
|
||||
* round robin becomes cooperative. Note that higher priority
|
||||
* threads can still preempt, the kernel is always preemptive.
|
||||
* @note Disabling the round robin preemption makes the kernel more compact
|
||||
* and generally faster.
|
||||
* @note The round robin preemption is not supported in tickless mode and
|
||||
* must be set to zero in that case.
|
||||
*/
|
||||
#define CH_CFG_TIME_QUANTUM 20
|
||||
|
||||
/**
|
||||
* @brief Managed RAM size.
|
||||
* @details Size of the RAM area to be managed by the OS. If set to zero
|
||||
* then the whole available RAM is used. The core memory is made
|
||||
* available to the heap allocator and/or can be used directly through
|
||||
* the simplified core memory allocator.
|
||||
*
|
||||
* @note In order to let the OS manage the whole RAM the linker script must
|
||||
* provide the @p __heap_base__ and @p __heap_end__ symbols.
|
||||
* @note Requires @p CH_CFG_USE_MEMCORE.
|
||||
*/
|
||||
#define CH_CFG_MEMCORE_SIZE 0
|
||||
|
||||
/**
|
||||
* @brief Idle thread automatic spawn suppression.
|
||||
* @details When this option is activated the function @p chSysInit()
|
||||
* does not spawn the idle thread. The application @p main()
|
||||
* function becomes the idle thread and must implement an
|
||||
* infinite loop.
|
||||
*/
|
||||
#define CH_CFG_NO_IDLE_THREAD FALSE
|
||||
|
||||
/* Use __WFI in the idle thread for waiting. Does lower the power
|
||||
* consumption. */
|
||||
#define CORTEX_ENABLE_WFI_IDLE TRUE
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Performance options
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief OS optimization.
|
||||
* @details If enabled then time efficient rather than space efficient code
|
||||
* is used when two possible implementations exist.
|
||||
*
|
||||
* @note This is not related to the compiler optimization options.
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_OPTIMIZE_SPEED TRUE
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Subsystem options
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Time Measurement APIs.
|
||||
* @details If enabled then the time measurement APIs are included in
|
||||
* the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_TM FALSE
|
||||
|
||||
/**
|
||||
* @brief Threads registry APIs.
|
||||
* @details If enabled then the registry APIs are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_REGISTRY TRUE
|
||||
|
||||
/**
|
||||
* @brief Threads synchronization APIs.
|
||||
* @details If enabled then the @p chThdWait() function is included in
|
||||
* the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_WAITEXIT TRUE
|
||||
|
||||
/**
|
||||
* @brief Semaphores APIs.
|
||||
* @details If enabled then the Semaphores APIs are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_SEMAPHORES TRUE
|
||||
|
||||
/**
|
||||
* @brief Semaphores queuing mode.
|
||||
* @details If enabled then the threads are enqueued on semaphores by
|
||||
* priority rather than in FIFO order.
|
||||
*
|
||||
* @note The default is @p FALSE. Enable this if you have special
|
||||
* requirements.
|
||||
* @note Requires @p CH_CFG_USE_SEMAPHORES.
|
||||
*/
|
||||
#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE
|
||||
|
||||
/**
|
||||
* @brief Mutexes APIs.
|
||||
* @details If enabled then the mutexes APIs are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_MUTEXES TRUE
|
||||
|
||||
/**
|
||||
* @brief Enables recursive behavior on mutexes.
|
||||
* @note Recursive mutexes are heavier and have an increased
|
||||
* memory footprint.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
* @note Requires @p CH_CFG_USE_MUTEXES.
|
||||
*/
|
||||
#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE
|
||||
|
||||
/**
|
||||
* @brief Conditional Variables APIs.
|
||||
* @details If enabled then the conditional variables APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_MUTEXES.
|
||||
*/
|
||||
#define CH_CFG_USE_CONDVARS TRUE
|
||||
|
||||
/**
|
||||
* @brief Conditional Variables APIs with timeout.
|
||||
* @details If enabled then the conditional variables APIs with timeout
|
||||
* specification are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_CONDVARS.
|
||||
*/
|
||||
#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE
|
||||
|
||||
/**
|
||||
* @brief Events Flags APIs.
|
||||
* @details If enabled then the event flags APIs are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_EVENTS TRUE
|
||||
|
||||
/**
|
||||
* @brief Events Flags APIs with timeout.
|
||||
* @details If enabled then the events APIs with timeout specification
|
||||
* are included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_EVENTS.
|
||||
*/
|
||||
#define CH_CFG_USE_EVENTS_TIMEOUT TRUE
|
||||
|
||||
/**
|
||||
* @brief Synchronous Messages APIs.
|
||||
* @details If enabled then the synchronous messages APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_MESSAGES TRUE
|
||||
|
||||
/**
|
||||
* @brief Synchronous Messages queuing mode.
|
||||
* @details If enabled then messages are served by priority rather than in
|
||||
* FIFO order.
|
||||
*
|
||||
* @note The default is @p FALSE. Enable this if you have special
|
||||
* requirements.
|
||||
* @note Requires @p CH_CFG_USE_MESSAGES.
|
||||
*/
|
||||
#define CH_CFG_USE_MESSAGES_PRIORITY FALSE
|
||||
|
||||
/**
|
||||
* @brief Mailboxes APIs.
|
||||
* @details If enabled then the asynchronous messages (mailboxes) APIs are
|
||||
* included in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_SEMAPHORES.
|
||||
*/
|
||||
#define CH_CFG_USE_MAILBOXES TRUE
|
||||
|
||||
/**
|
||||
* @brief Core Memory Manager APIs.
|
||||
* @details If enabled then the core memory manager APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_MEMCORE TRUE
|
||||
|
||||
/**
|
||||
* @brief Heap Allocator APIs.
|
||||
* @details If enabled then the memory heap allocator APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
|
||||
* @p CH_CFG_USE_SEMAPHORES.
|
||||
* @note Mutexes are recommended.
|
||||
*/
|
||||
#define CH_CFG_USE_HEAP TRUE
|
||||
|
||||
/**
|
||||
* @brief Memory Pools Allocator APIs.
|
||||
* @details If enabled then the memory pools allocator APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#define CH_CFG_USE_MEMPOOLS TRUE
|
||||
|
||||
/**
|
||||
* @brief Dynamic Threads APIs.
|
||||
* @details If enabled then the dynamic threads creation APIs are included
|
||||
* in the kernel.
|
||||
*
|
||||
* @note The default is @p TRUE.
|
||||
* @note Requires @p CH_CFG_USE_WAITEXIT.
|
||||
* @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
|
||||
*/
|
||||
#define CH_CFG_USE_DYNAMIC TRUE
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Debug options
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Debug option, kernel statistics.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_STATISTICS FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, system state check.
|
||||
* @details If enabled the correct call protocol for system APIs is checked
|
||||
* at runtime.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_SYSTEM_STATE_CHECK FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, parameters checks.
|
||||
* @details If enabled then the checks on the API functions input
|
||||
* parameters are activated.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_ENABLE_CHECKS FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, consistency checks.
|
||||
* @details If enabled then all the assertions in the kernel code are
|
||||
* activated. This includes consistency checks inside the kernel,
|
||||
* runtime anomalies and port-defined checks.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_ENABLE_ASSERTS FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, trace buffer.
|
||||
* @details If enabled then the trace buffer is activated.
|
||||
*
|
||||
* @note The default is @p CH_DBG_TRACE_MASK_DISABLED.
|
||||
*/
|
||||
#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED
|
||||
|
||||
/**
|
||||
* @brief Trace buffer entries.
|
||||
* @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
|
||||
* different from @p CH_DBG_TRACE_MASK_DISABLED.
|
||||
*/
|
||||
#define CH_DBG_TRACE_BUFFER_SIZE 128
|
||||
|
||||
/**
|
||||
* @brief Debug option, stack checks.
|
||||
* @details If enabled then a runtime stack check is performed.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
* @note The stack check is performed in a architecture/port dependent way.
|
||||
* It may not be implemented or some ports.
|
||||
* @note The default failure mode is to halt the system with the global
|
||||
* @p panic_msg variable set to @p NULL.
|
||||
*/
|
||||
#define CH_DBG_ENABLE_STACK_CHECK FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, stacks initialization.
|
||||
* @details If enabled then the threads working area is filled with a byte
|
||||
* value when a thread is created. This can be useful for the
|
||||
* runtime measurement of the used stack.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#define CH_DBG_FILL_THREADS FALSE
|
||||
|
||||
/**
|
||||
* @brief Debug option, threads profiling.
|
||||
* @details If enabled then a field is added to the @p thread_t structure that
|
||||
* counts the system ticks occurred while executing the thread.
|
||||
*
|
||||
* @note The default is @p FALSE.
|
||||
* @note This debug option is not currently compatible with the
|
||||
* tickless mode.
|
||||
*/
|
||||
#define CH_DBG_THREADS_PROFILING FALSE
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/**
|
||||
* @name Kernel hooks
|
||||
* @{
|
||||
*/
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Threads descriptor structure extension.
|
||||
* @details User fields added to the end of the @p thread_t structure.
|
||||
*/
|
||||
#define CH_CFG_THREAD_EXTRA_FIELDS \
|
||||
/* Add threads custom fields here.*/
|
||||
|
||||
/**
|
||||
* @brief Threads initialization hook.
|
||||
* @details User initialization code added to the @p chThdInit() API.
|
||||
*
|
||||
* @note It is invoked from within @p chThdInit() and implicitly from all
|
||||
* the threads creation APIs.
|
||||
*/
|
||||
#define CH_CFG_THREAD_INIT_HOOK(tp) { \
|
||||
/* Add threads initialization code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Threads finalization hook.
|
||||
* @details User finalization code added to the @p chThdExit() API.
|
||||
*/
|
||||
#define CH_CFG_THREAD_EXIT_HOOK(tp) { \
|
||||
/* Add threads finalization code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Context switch hook.
|
||||
* @details This hook is invoked just before switching between threads.
|
||||
*/
|
||||
#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \
|
||||
/* Context switch code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ISR enter hook.
|
||||
*/
|
||||
#define CH_CFG_IRQ_PROLOGUE_HOOK() { \
|
||||
/* IRQ prologue code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ISR exit hook.
|
||||
*/
|
||||
#define CH_CFG_IRQ_EPILOGUE_HOOK() { \
|
||||
/* IRQ epilogue code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Idle thread enter hook.
|
||||
* @note This hook is invoked within a critical zone, no OS functions
|
||||
* should be invoked from here.
|
||||
* @note This macro can be used to activate a power saving mode.
|
||||
*/
|
||||
#define CH_CFG_IDLE_ENTER_HOOK() { \
|
||||
/* Idle-enter code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Idle thread leave hook.
|
||||
* @note This hook is invoked within a critical zone, no OS functions
|
||||
* should be invoked from here.
|
||||
* @note This macro can be used to deactivate a power saving mode.
|
||||
*/
|
||||
#define CH_CFG_IDLE_LEAVE_HOOK() { \
|
||||
/* Idle-leave code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Idle Loop hook.
|
||||
* @details This hook is continuously invoked by the idle thread loop.
|
||||
*/
|
||||
#define CH_CFG_IDLE_LOOP_HOOK() { \
|
||||
/* Idle loop code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System tick event hook.
|
||||
* @details This hook is invoked in the system tick handler immediately
|
||||
* after processing the virtual timers queue.
|
||||
*/
|
||||
#define CH_CFG_SYSTEM_TICK_HOOK() { \
|
||||
/* System tick event code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief System halt hook.
|
||||
* @details This hook is invoked in case to a system halting error before
|
||||
* the system is halted.
|
||||
*/
|
||||
#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
|
||||
/* System halt code here.*/ \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Trace hook.
|
||||
* @details This hook is invoked each time a new record is written in the
|
||||
* trace buffer.
|
||||
*/
|
||||
#define CH_CFG_TRACE_HOOK(tep) { \
|
||||
/* Trace code here.*/ \
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Port-specific settings (override port settings defaulted in chcore.h). */
|
||||
/*===========================================================================*/
|
||||
|
||||
#endif /* CHCONF_H */
|
||||
|
||||
/** @} */
|
@ -0,0 +1,78 @@
|
||||
/*
|
||||
Copyright 2015 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
|
||||
|
||||
#define PREVENT_STUCK_MODIFIERS
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x0F0F
|
||||
#define DEVICE_VER 0x0001
|
||||
/* in python2: list(u"whatever".encode('utf-16-le')) */
|
||||
/* at most 32 characters or the ugly hack in usb_main.c borks */
|
||||
#define MANUFACTURER "Input Club"
|
||||
#define USBSTR_MANUFACTURER 'I', '\x00', 'n', '\x00', 'p', '\x00', 'u', '\x00', 't', '\x00', ' ', '\x00', 'C', '\x00', 'l', '\x00', 'u', '\x00', 'b', '\x00'
|
||||
#define PRODUCT "WhiteFox/QMK"
|
||||
#define USBSTR_PRODUCT 'W', '\x00', 'h', '\x00', 'i', '\x00', 't', '\x00', 'e', '\x00', 'F', '\x00', 'o', '\x00', 'x', '\x00', ' ', '\x00'
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 9
|
||||
#define MATRIX_COLS 8
|
||||
|
||||
/* define if matrix has ghost */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* Set 0 if debouncing isn't needed */
|
||||
#define DEBOUNCE 6
|
||||
|
||||
/* 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)) \
|
||||
)
|
||||
|
||||
/* Keymap for Infinity prototype */
|
||||
//#define INFINITY_PROTOTYPE
|
||||
|
||||
/* Keymap for Infinity 1.1a (first revision with LED support) */
|
||||
//#define INFINITY_LED
|
||||
|
||||
/*
|
||||
* 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,353 @@
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file templates/halconf.h
|
||||
* @brief HAL configuration header.
|
||||
* @details HAL configuration file, this file allows to enable or disable the
|
||||
* various device drivers from your application. You may also use
|
||||
* this file in order to override the device drivers default settings.
|
||||
*
|
||||
* @addtogroup HAL_CONF
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef _HALCONF_H_
|
||||
#define _HALCONF_H_
|
||||
|
||||
#include "mcuconf.h"
|
||||
|
||||
/**
|
||||
* @brief Enables the PAL subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_PAL TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the ADC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_ADC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the CAN subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_CAN FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the DAC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_DAC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the EXT subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_EXT FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the GPT subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_GPT FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the I2C subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_I2C FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the I2S subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_I2S FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the ICU subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_ICU FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the MAC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_MAC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the MMC_SPI subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_MMC_SPI FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the PWM subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_PWM FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the RTC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_RTC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the SDC subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_SDC FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the SERIAL subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_SERIAL FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the SERIAL over USB subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_SERIAL_USB TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the SPI subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_SPI FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the UART subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_UART FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the USB subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_USB TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the WDG subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_WDG FALSE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* ADC driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Enables synchronous APIs.
|
||||
* @note Disabling this option saves both code and data space.
|
||||
*/
|
||||
#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__)
|
||||
#define ADC_USE_WAIT TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs.
|
||||
* @note Disabling this option saves both code and data space.
|
||||
*/
|
||||
#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
|
||||
#define ADC_USE_MUTUAL_EXCLUSION TRUE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* CAN driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Sleep mode related APIs inclusion switch.
|
||||
*/
|
||||
#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
|
||||
#define CAN_USE_SLEEP_MODE TRUE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* I2C driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Enables the mutual exclusion APIs on the I2C bus.
|
||||
*/
|
||||
#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
|
||||
#define I2C_USE_MUTUAL_EXCLUSION TRUE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* MAC driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Enables an event sources for incoming packets.
|
||||
*/
|
||||
#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__)
|
||||
#define MAC_USE_ZERO_COPY FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables an event sources for incoming packets.
|
||||
*/
|
||||
#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__)
|
||||
#define MAC_USE_EVENTS TRUE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* MMC_SPI driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Delays insertions.
|
||||
* @details If enabled this options inserts delays into the MMC waiting
|
||||
* routines releasing some extra CPU time for the threads with
|
||||
* lower priority, this may slow down the driver a bit however.
|
||||
* This option is recommended also if the SPI driver does not
|
||||
* use a DMA channel and heavily loads the CPU.
|
||||
*/
|
||||
#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__)
|
||||
#define MMC_NICE_WAITING TRUE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* SDC driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Number of initialization attempts before rejecting the card.
|
||||
* @note Attempts are performed at 10mS intervals.
|
||||
*/
|
||||
#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)
|
||||
#define SDC_INIT_RETRY 100
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Include support for MMC cards.
|
||||
* @note MMC support is not yet implemented so this option must be kept
|
||||
* at @p FALSE.
|
||||
*/
|
||||
#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__)
|
||||
#define SDC_MMC_SUPPORT FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Delays insertions.
|
||||
* @details If enabled this options inserts delays into the MMC waiting
|
||||
* routines releasing some extra CPU time for the threads with
|
||||
* lower priority, this may slow down the driver a bit however.
|
||||
*/
|
||||
#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
|
||||
#define SDC_NICE_WAITING TRUE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* SERIAL driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Default bit rate.
|
||||
* @details Configuration parameter, this is the baud rate selected for the
|
||||
* default configuration.
|
||||
*/
|
||||
#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__)
|
||||
#define SERIAL_DEFAULT_BITRATE 38400
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Serial buffers size.
|
||||
* @details Configuration parameter, you can change the depth of the queue
|
||||
* buffers depending on the requirements of your application.
|
||||
* @note The default is 64 bytes for both the transmission and receive
|
||||
* buffers.
|
||||
*/
|
||||
#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
|
||||
#define SERIAL_BUFFERS_SIZE 16
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* SERIAL_USB driver related setting. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Serial over USB buffers size.
|
||||
* @details Configuration parameter, the buffer size must be a multiple of
|
||||
* the USB data endpoint maximum packet size.
|
||||
* @note The default is 64 bytes for both the transmission and receive
|
||||
* buffers.
|
||||
*/
|
||||
#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
|
||||
#define SERIAL_USB_BUFFERS_SIZE 256
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* SPI driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Enables synchronous APIs.
|
||||
* @note Disabling this option saves both code and data space.
|
||||
*/
|
||||
#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__)
|
||||
#define SPI_USE_WAIT TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs.
|
||||
* @note Disabling this option saves both code and data space.
|
||||
*/
|
||||
#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
|
||||
#define SPI_USE_MUTUAL_EXCLUSION TRUE
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* USB driver related settings. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Enables synchronous APIs.
|
||||
* @note Disabling this option saves both code and data space.
|
||||
*/
|
||||
#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
|
||||
#define USB_USE_WAIT TRUE
|
||||
#endif
|
||||
|
||||
#endif /* _HALCONF_H_ */
|
||||
|
||||
/** @} */
|
@ -0,0 +1,51 @@
|
||||
/*
|
||||
Copyright 2015 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/>.
|
||||
*/
|
||||
#include "whitefox.h"
|
||||
|
||||
const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Layer 0: Default Layer
|
||||
* ,---------------------------------------------------------------.
|
||||
* |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `|Ins|
|
||||
* |---------------------------------------------------------------|
|
||||
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Backs|Del|
|
||||
* |---------------------------------------------------------------|
|
||||
* |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Enter |PgU|
|
||||
* |---------------------------------------------------------------|
|
||||
* |Shif| | Z| X| C| V| B| N| M| ,| .| /|Shift |Up |PgD|
|
||||
* |---------------------------------------------------------------|
|
||||
* |Ctrl|Gui |Alt | Space |Fn0 |Alt |Gui | |Lef|Dow|Rig|
|
||||
* `---------------------------------------------------------------'
|
||||
*/
|
||||
[0] = KEYMAP( \
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSLS,KC_GRV, KC_INS, \
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSPC, KC_DEL, \
|
||||
KC_CAPS,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_NUHS,KC_ENT, KC_PGUP,\
|
||||
KC_LSFT,KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT, KC_UP, KC_PGDN,\
|
||||
KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_FN0, KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT \
|
||||
),
|
||||
[1] = KEYMAP( \
|
||||
KC_TRNS,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_MUTE,\
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PSCR,KC_SLCK,KC_PAUS,KC_TRNS, KC_TRNS,\
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_VOLU,\
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_PGUP,KC_VOLD,\
|
||||
KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_HOME,KC_PGDN,KC_END \
|
||||
),
|
||||
};
|
||||
|
||||
const uint16_t fn_actions[] = {
|
||||
[0] = ACTION_LAYER_MOMENTARY(1),
|
||||
};
|
@ -0,0 +1,92 @@
|
||||
/*
|
||||
Copyright 2015 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/>.
|
||||
*/
|
||||
#include "whitefox.h"
|
||||
|
||||
const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Layer 0: Default Layer
|
||||
* ,---------------------------------------------------------------.
|
||||
* |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `|Ins|
|
||||
* |---------------------------------------------------------------|
|
||||
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Backs|Del|
|
||||
* |---------------------------------------------------------------|
|
||||
* |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Enter |PgU|
|
||||
* |---------------------------------------------------------------|
|
||||
* |Shif| | Z| X| C| V| B| N| M| ,| .| /|Shift |Up |PgD|
|
||||
* |---------------------------------------------------------------|
|
||||
* |Ctrl|Gui |Alt | Space |Fn0 |Alt |Gui | |Lef|Dow|Rig|
|
||||
* `---------------------------------------------------------------'
|
||||
*/
|
||||
[0] = KEYMAP( \
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSLS,KC_GRV, KC_MUTE,\
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSPC, KC_DEL, \
|
||||
KC_FN0, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_NUHS,KC_ENT, KC_PGUP,\
|
||||
KC_LSFT,KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT, KC_UP, KC_PGDN,\
|
||||
KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_FN1, KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT \
|
||||
),
|
||||
[1] = KEYMAP( \
|
||||
KC_TRNS,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_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_DEL , KC_INS ,\
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_VOLU,\
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_PGUP,KC_VOLD,\
|
||||
KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_HOME,KC_PGDN,KC_END \
|
||||
),
|
||||
[2] = KEYMAP( \
|
||||
KC_SLEP,KC_P1, KC_P2, KC_P3, KC_P4, KC_P5, KC_P6, KC_P7, KC_P8, KC_P9, KC_P0, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_FN2, \
|
||||
KC_TRNS,KC_TRNS,KC_FN5 ,KC_FN6 ,KC_TRNS,KC_FN7 ,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PSCR,KC_TRNS,KC_TRNS,KC_TRNS, KC_FN3, \
|
||||
KC_CAPS,KC_TRNS,KC_TRNS,KC_TRNS,KC_FN4 ,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,\
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_CALC,KC_TRNS,KC_TRNS,KC_TRNS,KC_MAIL,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,\
|
||||
KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS \
|
||||
),
|
||||
};
|
||||
|
||||
/* Give numbers some descriptive names */
|
||||
#define ACTION_LEDS_ALL 1
|
||||
#define ACTION_LEDS_GAME 2
|
||||
|
||||
const uint16_t fn_actions[] = {
|
||||
[0] = ACTION_LAYER_MOMENTARY(1),
|
||||
[1] = ACTION_LAYER_MOMENTARY(2),
|
||||
[2] = ACTION_FUNCTION(ACTION_LEDS_ALL),
|
||||
[3] = ACTION_FUNCTION(ACTION_LEDS_GAME),
|
||||
|
||||
[4] = ACTION_USAGE_CONSUMER(0x1B4),
|
||||
[5] = ACTION_USAGE_CONSUMER(0x196),
|
||||
[6] = ACTION_USAGE_CONSUMER(0x1A6),
|
||||
[7] = ACTION_USAGE_CONSUMER(0x1A0),
|
||||
|
||||
};
|
||||
|
||||
/* custom action function */
|
||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
/*
|
||||
(void)opt;
|
||||
switch(id) {
|
||||
case ACTION_LEDS_ALL:
|
||||
if(record->event.pressed) {
|
||||
// signal the LED controller thread
|
||||
chMBPost(&led_mailbox, LED_MSG_GAME_TOGGLE, TIME_IMMEDIATE);
|
||||
}
|
||||
break;
|
||||
case ACTION_LEDS_GAME:
|
||||
if(record->event.pressed) {
|
||||
// signal the LED controller thread
|
||||
chMBPost(&led_mailbox, LED_MSG_ALL_TOGGLE, TIME_IMMEDIATE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
*/
|
||||
}
|
@ -1,31 +1,24 @@
|
||||
/*
|
||||
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/>.
|
||||
*/
|
||||
|
||||
#include <avr/io.h>
|
||||
#include "stdint.h"
|
||||
#include "hal.h"
|
||||
|
||||
#include "led.h"
|
||||
|
||||
|
||||
void led_set(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);
|
||||
}
|
||||
}
|
||||
void led_set(uint8_t usb_led) {
|
||||
}
|
@ -0,0 +1,132 @@
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include "hal.h"
|
||||
#include "timer.h"
|
||||
#include "wait.h"
|
||||
#include "print.h"
|
||||
#include "matrix.h"
|
||||
|
||||
|
||||
/*
|
||||
* Matt3o's WhiteFox
|
||||
* Column pins are input with internal pull-down. Row pins are output and strobe with high.
|
||||
* Key is high or 1 when it turns on.
|
||||
*
|
||||
* col: { PTD0, PTD1, PTD4, PTD5, PTD6, PTD7, PTC1, PTC2 }
|
||||
* row: { PTB2, PTB3, PTB18, PTB19, PTC0, PTC8, PTC9, PTC10, PTC11 }
|
||||
*/
|
||||
/* matrix state(1:on, 0:off) */
|
||||
static matrix_row_t matrix[MATRIX_ROWS];
|
||||
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
||||
static bool debouncing = false;
|
||||
static uint16_t debouncing_time = 0;
|
||||
|
||||
|
||||
void matrix_init(void)
|
||||
{
|
||||
//debug_matrix = true;
|
||||
/* Column(sense) */
|
||||
palSetPadMode(GPIOD, 0, PAL_MODE_INPUT_PULLDOWN);
|
||||
palSetPadMode(GPIOD, 1, PAL_MODE_INPUT_PULLDOWN);
|
||||
palSetPadMode(GPIOD, 4, PAL_MODE_INPUT_PULLDOWN);
|
||||
palSetPadMode(GPIOD, 5, PAL_MODE_INPUT_PULLDOWN);
|
||||
palSetPadMode(GPIOD, 6, PAL_MODE_INPUT_PULLDOWN);
|
||||
palSetPadMode(GPIOD, 7, PAL_MODE_INPUT_PULLDOWN);
|
||||
palSetPadMode(GPIOC, 1, PAL_MODE_INPUT_PULLDOWN);
|
||||
palSetPadMode(GPIOC, 2, PAL_MODE_INPUT_PULLDOWN);
|
||||
|
||||
/* Row(strobe) */
|
||||
palSetPadMode(GPIOB, 2, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPadMode(GPIOB, 3, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPadMode(GPIOB, 18, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPadMode(GPIOB, 19, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPadMode(GPIOC, 0, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPadMode(GPIOC, 8, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPadMode(GPIOC, 9, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPadMode(GPIOC, 10, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPadMode(GPIOC, 11, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
|
||||
memset(matrix, 0, MATRIX_ROWS);
|
||||
memset(matrix_debouncing, 0, MATRIX_ROWS);
|
||||
}
|
||||
|
||||
uint8_t matrix_scan(void)
|
||||
{
|
||||
for (int row = 0; row < MATRIX_ROWS; row++) {
|
||||
matrix_row_t data = 0;
|
||||
|
||||
// strobe row
|
||||
switch (row) {
|
||||
case 0: palSetPad(GPIOB, 2); break;
|
||||
case 1: palSetPad(GPIOB, 3); break;
|
||||
case 2: palSetPad(GPIOB, 18); break;
|
||||
case 3: palSetPad(GPIOB, 19); break;
|
||||
case 4: palSetPad(GPIOC, 0); break;
|
||||
case 5: palSetPad(GPIOC, 8); break;
|
||||
case 6: palSetPad(GPIOC, 9); break;
|
||||
case 7: palSetPad(GPIOC, 10); break;
|
||||
case 8: palSetPad(GPIOC, 11); break;
|
||||
}
|
||||
|
||||
wait_us(20); // need wait to settle pin state
|
||||
|
||||
// read col data: { PTD0, PTD1, PTD4, PTD5, PTD6, PTD7, PTC1, PTC2 }
|
||||
data = ((palReadPort(GPIOC) & 0x06UL) << 5) |
|
||||
((palReadPort(GPIOD) & 0xF0UL) >> 2) |
|
||||
(palReadPort(GPIOD) & 0x03UL);
|
||||
|
||||
// un-strobe row
|
||||
switch (row) {
|
||||
case 0: palClearPad(GPIOB, 2); break;
|
||||
case 1: palClearPad(GPIOB, 3); break;
|
||||
case 2: palClearPad(GPIOB, 18); break;
|
||||
case 3: palClearPad(GPIOB, 19); break;
|
||||
case 4: palClearPad(GPIOC, 0); break;
|
||||
case 5: palClearPad(GPIOC, 8); break;
|
||||
case 6: palClearPad(GPIOC, 9); break;
|
||||
case 7: palClearPad(GPIOC, 10); break;
|
||||
case 8: palClearPad(GPIOC, 11); break;
|
||||
}
|
||||
|
||||
if (matrix_debouncing[row] != data) {
|
||||
matrix_debouncing[row] = data;
|
||||
debouncing = true;
|
||||
debouncing_time = timer_read();
|
||||
}
|
||||
}
|
||||
|
||||
if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) {
|
||||
for (int row = 0; row < MATRIX_ROWS; row++) {
|
||||
matrix[row] = matrix_debouncing[row];
|
||||
}
|
||||
debouncing = false;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool matrix_is_on(uint8_t row, uint8_t col)
|
||||
{
|
||||
return (matrix[row] & (1<<col));
|
||||
}
|
||||
|
||||
matrix_row_t matrix_get_row(uint8_t row)
|
||||
{
|
||||
return matrix[row];
|
||||
}
|
||||
|
||||
void matrix_print(void)
|
||||
{
|
||||
xprintf("\nr/c 01234567\n");
|
||||
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||
xprintf("%X0: ", row);
|
||||
matrix_row_t data = matrix_get_row(row);
|
||||
for (int col = 0; col < MATRIX_COLS; col++) {
|
||||
if (data & (1<<col))
|
||||
xprintf("1");
|
||||
else
|
||||
xprintf("0");
|
||||
}
|
||||
xprintf("\n");
|
||||
}
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef _MCUCONF_H_
|
||||
#define _MCUCONF_H_
|
||||
|
||||
#define K20x_MCUCONF
|
||||
|
||||
/*
|
||||
* HAL driver system settings.
|
||||
*/
|
||||
|
||||
/* Select the MCU clocking mode below by enabling the appropriate block. */
|
||||
|
||||
#define KINETIS_NO_INIT FALSE
|
||||
|
||||
/* PEE mode - 48MHz system clock driven by external crystal. */
|
||||
#define KINETIS_MCG_MODE KINETIS_MCG_MODE_PEE
|
||||
#define KINETIS_PLLCLK_FREQUENCY 72000000UL
|
||||
#define KINETIS_SYSCLK_FREQUENCY 72000000UL
|
||||
#define KINETIS_BUSCLK_FREQUENCY 36000000UL
|
||||
#define KINETIS_FLASHCLK_FREQUENCY 24000000UL
|
||||
|
||||
/*
|
||||
* SERIAL driver system settings.
|
||||
*/
|
||||
#define KINETIS_SERIAL_USE_UART0 TRUE
|
||||
|
||||
/*
|
||||
* USB driver settings
|
||||
*/
|
||||
#define KINETIS_USB_USE_USB0 TRUE
|
||||
#define KINETIS_USB_USB0_IRQ_PRIORITY 5
|
||||
|
||||
/*
|
||||
* I2C driver settings
|
||||
*/
|
||||
#define KINETIS_I2C_USE_I2C0 TRUE
|
||||
#define KINETIS_I2C_I2C0_PRIORITY 4
|
||||
|
||||
#endif /* _MCUCONF_H_ */
|
@ -0,0 +1,7 @@
|
||||
WhiteFox keyboard firmware
|
||||
======================
|
||||
|
||||
This is an experimental port which came from the original TMK WhiteFox repo.
|
||||
|
||||
The LED controller was not ported, as the original was a dirty hack and it would
|
||||
be good to have complete support.
|
@ -0,0 +1,68 @@
|
||||
# project specific files
|
||||
SRC = matrix.c \
|
||||
led.c
|
||||
|
||||
## chip/board settings
|
||||
# - the next two should match the directories in
|
||||
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
|
||||
# - For Teensies, FAMILY = KINETIS and SERIES is either
|
||||
# KL2x (LC) or K20x (3.0,3.1,3.2).
|
||||
# - For Infinity KB, SERIES = K20x
|
||||
MCU_FAMILY = KINETIS
|
||||
MCU_SERIES = K20x
|
||||
|
||||
# Linker script to use
|
||||
# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
|
||||
# or <this_dir>/ld/
|
||||
# - NOTE: a custom ld script is needed for EEPROM on Teensy LC
|
||||
# - LDSCRIPT =
|
||||
# - MKL26Z64 for Teensy LC
|
||||
# - MK20DX128 for Teensy 3.0
|
||||
# - MK20DX256 for Teensy 3.1 and 3.2
|
||||
# - MK20DX128BLDR4 for Infinity with Kiibohd bootloader
|
||||
# - MK20DX256BLDR8 for Infinity ErgoDox with Kiibohd bootloader
|
||||
MCU_LDSCRIPT = MK20DX256BLDR8
|
||||
|
||||
# Startup code to use
|
||||
# - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
|
||||
# - STARTUP =
|
||||
# - kl2x for Teensy LC
|
||||
# - k20x5 for Teensy 3.0 and Infinity KB
|
||||
# - k20x7 for Teensy 3.1 and 3.2
|
||||
MCU_STARTUP = k20x7
|
||||
|
||||
# Board: it should exist either in <chibios>/os/hal/boards/
|
||||
# or <this_dir>/boards
|
||||
# - BOARD =
|
||||
# - PJRC_TEENSY_LC for Teensy LC
|
||||
# - PJRC_TEENSY_3 for Teensy 3.0
|
||||
# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2
|
||||
# - MCHCK_K20 for Infinity KB
|
||||
BOARD = PJRC_TEENSY_3_1
|
||||
|
||||
# Cortex version
|
||||
# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
|
||||
MCU = cortex-m4
|
||||
|
||||
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
|
||||
# I.e. 6 for Teensy LC; 7 for Teensy 3.x
|
||||
ARMV = 7
|
||||
|
||||
# Vector table for application
|
||||
# 0x00000000-0x00001000 area is occupied by bootlaoder.*/
|
||||
# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB
|
||||
#OPT_DEFS = -DCORTEX_VTOR_INIT=0x00001000
|
||||
OPT_DEFS =
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration
|
||||
## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control
|
||||
#CONSOLE_ENABLE ?= yes # Console for debug
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
#SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover
|
||||
CUSTOM_MATRIX ?= yes # Custom matrix file
|
@ -0,0 +1,17 @@
|
||||
/*
|
||||
Copyright 2012,2013 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/>.
|
||||
*/
|
||||
#include "whitefox.h"
|
@ -0,0 +1,54 @@
|
||||
/*
|
||||
Copyright 2014 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 WHITEFOX_H
|
||||
#define WHITEFOX_H
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
/* WhiteFox
|
||||
* ,---------------------------------------------------------------.
|
||||
* |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `|Ins|
|
||||
* |---------------------------------------------------------------|
|
||||
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Backs|Del|
|
||||
* |---------------------------------------------------------------|
|
||||
* |CapsL | A| S| D| F| G| H| J| K| L| ;| '|Enter |PgU|
|
||||
* |---------------------------------------------------------------|
|
||||
* |Shif| | Z| X| C| V| B| N| M| ,| .| /|Shift |Up |PgD|
|
||||
* |---------------------------------------------------------------|
|
||||
* |Ctrl|Gui |Alt | Space |App |Alt |Gui | |Lef|Dow|Rig|
|
||||
* `---------------------------------------------------------------'
|
||||
*/
|
||||
|
||||
#define KEYMAP( \
|
||||
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 \
|
||||
) { \
|
||||
{ K00, K01, K02, K03, K04, K05, K06, K07 }, \
|
||||
{ K10, K11, K12, K13, K14, K15, K16, K17 }, \
|
||||
{ K20, K21, K22, K23, K24, K25, K26, K27 }, \
|
||||
{ K30, K31, K32, K33, K34, K35, K36, K37 }, \
|
||||
{ K40, K41, K42, K43, K44, K45, K46, K47 }, \
|
||||
{ K50, K51, K52, K53, K54, K55, K56, K57 }, \
|
||||
{ K60, K61, K62, K63, K64, K65, K66, K67 }, \
|
||||
{ K70, K71, K72, K73, K74, K75, K76, K77 }, \
|
||||
{ K80, K81, K82, K83, K84, K85, K86, KC_NO } \
|
||||
}
|
||||
|
||||
#endif
|
@ -0,0 +1,68 @@
|
||||
/*
|
||||
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 <avr/interrupt.h>
|
||||
#include <avr/io.h>
|
||||
#include <timer.h>
|
||||
#include <fauxclicky.h>
|
||||
#include <stdbool.h>
|
||||
#include <musical_notes.h>
|
||||
|
||||
__attribute__ ((weak))
|
||||
float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_F3, 2);
|
||||
__attribute__ ((weak))
|
||||
float fauxclicky_released_note[2] = MUSICAL_NOTE(_A3, 2);
|
||||
__attribute__ ((weak))
|
||||
float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C3, 2);
|
||||
|
||||
bool fauxclicky_enabled = true;
|
||||
uint16_t note_start = 0;
|
||||
bool note_playing = false;
|
||||
uint16_t note_period = 0;
|
||||
|
||||
void fauxclicky_init()
|
||||
{
|
||||
// Set port PC6 (OC3A and /OC4A) as output
|
||||
DDRC |= _BV(PORTC6);
|
||||
|
||||
// TCCR3A / TCCR3B: Timer/Counter #3 Control Registers
|
||||
TCCR3A = (0 << COM3A1) | (0 << COM3A0) | (1 << WGM31) | (0 << WGM30);
|
||||
TCCR3B = (1 << WGM33) | (1 << WGM32) | (0 << CS32) | (1 << CS31) | (0 << CS30);
|
||||
}
|
||||
|
||||
void fauxclicky_stop()
|
||||
{
|
||||
FAUXCLICKY_DISABLE_OUTPUT;
|
||||
note_playing = false;
|
||||
}
|
||||
|
||||
void fauxclicky_play(float note[2]) {
|
||||
if (!fauxclicky_enabled) return;
|
||||
if (note_playing) fauxclicky_stop();
|
||||
FAUXCLICKY_TIMER_PERIOD = (uint16_t)(((float)F_CPU) / (note[0] * FAUXCLICKY_CPU_PRESCALER));
|
||||
FAUXCLICKY_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (note[0] * FAUXCLICKY_CPU_PRESCALER)) / 2);
|
||||
note_playing = true;
|
||||
note_period = (note[1] / 16) * (60 / (float)FAUXCLICKY_TEMPO) * 100; // check this
|
||||
note_start = timer_read();
|
||||
FAUXCLICKY_ENABLE_OUTPUT;
|
||||
}
|
||||
|
||||
void fauxclicky_check() {
|
||||
if (!note_playing) return;
|
||||
|
||||
if (timer_elapsed(note_start) > note_period) {
|
||||
fauxclicky_stop();
|
||||
}
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
/*
|
||||
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/>.
|
||||
*/
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
#error "AUDIO_ENABLE and FAUXCLICKY_ENABLE cannot be both enabled"
|
||||
#endif
|
||||
|
||||
#include "musical_notes.h"
|
||||
#include "stdbool.h"
|
||||
|
||||
__attribute__ ((weak))
|
||||
float fauxclicky_pressed_note[2];
|
||||
__attribute__ ((weak))
|
||||
float fauxclicky_released_note[2];
|
||||
__attribute__ ((weak))
|
||||
float fauxclicky_beep_note[2];
|
||||
|
||||
bool fauxclicky_enabled;
|
||||
|
||||
//
|
||||
// tempo in BPM
|
||||
//
|
||||
|
||||
#ifndef FAUXCLICKY_TEMPO
|
||||
#define FAUXCLICKY_TEMPO TEMPO_DEFAULT
|
||||
#endif
|
||||
|
||||
// beep on press
|
||||
#define FAUXCLICKY_ACTION_PRESS fauxclicky_play(fauxclicky_pressed_note)
|
||||
|
||||
// beep on release
|
||||
#define FAUXCLICKY_ACTION_RELEASE fauxclicky_play(fauxclicky_released_note)
|
||||
|
||||
// general purpose beep
|
||||
#define FAUXCLICKY_BEEP fauxclicky_play(fauxclicky_beep_note)
|
||||
|
||||
// enable
|
||||
#define FAUXCLICKY_ON fauxclicky_enabled = true
|
||||
|
||||
// disable
|
||||
#define FAUXCLICKY_OFF do { \
|
||||
fauxclicky_enabled = false; \
|
||||
fauxclicky_stop(); \
|
||||
} while (0)
|
||||
|
||||
// toggle
|
||||
#define FAUXCLICKY_TOGGLE do { \
|
||||
if (fauxclicky_enabled) { \
|
||||
FAUXCLICKY_OFF; \
|
||||
} else { \
|
||||
FAUXCLICKY_ON; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
//
|
||||
// pin configuration
|
||||
//
|
||||
|
||||
#ifndef FAUXCLICKY_CPU_PRESCALER
|
||||
#define FAUXCLICKY_CPU_PRESCALER 8
|
||||
#endif
|
||||
|
||||
#ifndef FAUXCLICKY_ENABLE_OUTPUT
|
||||
#define FAUXCLICKY_ENABLE_OUTPUT TCCR3A |= _BV(COM3A1);
|
||||
#endif
|
||||
|
||||
#ifndef FAUXCLICKY_DISABLE_OUTPUT
|
||||
#define FAUXCLICKY_DISABLE_OUTPUT TCCR3A &= ~(_BV(COM3A1) | _BV(COM3A0));
|
||||
#endif
|
||||
|
||||
#ifndef FAUXCLICKY_TIMER_PERIOD
|
||||
#define FAUXCLICKY_TIMER_PERIOD ICR3
|
||||
#endif
|
||||
|
||||
#ifndef FAUXCLICKY_DUTY_CYCLE
|
||||
#define FAUXCLICKY_DUTY_CYCLE OCR3A
|
||||
#endif
|
||||
|
||||
//
|
||||
// definitions
|
||||
//
|
||||
|
||||
void fauxclicky_init(void);
|
||||
void fauxclicky_stop(void);
|
||||
void fauxclicky_play(float note[2]);
|
||||
void fauxclicky_check(void);
|
||||
|
@ -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,351 @@
|
||||
|
||||
#ifndef QUANTUM_KEYCODES_H
|
||||
#define QUANTUM_KEYCODES_H
|
||||
|
||||
enum quantum_keycodes {
|
||||
// Ranges used in shortucuts - not to be used directly
|
||||
QK_TMK = 0x0000,
|
||||
QK_TMK_MAX = 0x00FF,
|
||||
QK_MODS = 0x0100,
|
||||
QK_LCTL = 0x0100,
|
||||
QK_LSFT = 0x0200,
|
||||
QK_LALT = 0x0400,
|
||||
QK_LGUI = 0x0800,
|
||||
QK_RMODS_MIN = 0x1000,
|
||||
QK_RCTL = 0x1100,
|
||||
QK_RSFT = 0x1200,
|
||||
QK_RALT = 0x1400,
|
||||
QK_RGUI = 0x1800,
|
||||
QK_MODS_MAX = 0x1FFF,
|
||||
QK_FUNCTION = 0x2000,
|
||||
QK_FUNCTION_MAX = 0x2FFF,
|
||||
QK_MACRO = 0x3000,
|
||||
QK_MACRO_MAX = 0x3FFF,
|
||||
QK_LAYER_TAP = 0x4000,
|
||||
QK_LAYER_TAP_MAX = 0x4FFF,
|
||||
QK_TO = 0x5000,
|
||||
QK_TO_MAX = 0x50FF,
|
||||
QK_MOMENTARY = 0x5100,
|
||||
QK_MOMENTARY_MAX = 0x51FF,
|
||||
QK_DEF_LAYER = 0x5200,
|
||||
QK_DEF_LAYER_MAX = 0x52FF,
|
||||
QK_TOGGLE_LAYER = 0x5300,
|
||||
QK_TOGGLE_LAYER_MAX = 0x53FF,
|
||||
QK_ONE_SHOT_LAYER = 0x5400,
|
||||
QK_ONE_SHOT_LAYER_MAX = 0x54FF,
|
||||
QK_ONE_SHOT_MOD = 0x5500,
|
||||
QK_ONE_SHOT_MOD_MAX = 0x55FF,
|
||||
#ifndef DISABLE_CHORDING
|
||||
QK_CHORDING = 0x5600,
|
||||
QK_CHORDING_MAX = 0x56FF,
|
||||
#endif
|
||||
QK_TAP_DANCE = 0x5700,
|
||||
QK_TAP_DANCE_MAX = 0x57FF,
|
||||
#ifdef UNICODEMAP_ENABLE
|
||||
QK_UNICODE_MAP = 0x5800,
|
||||
QK_UNICODE_MAP_MAX = 0x5BFF,
|
||||
#endif
|
||||
QK_MOD_TAP = 0x6000,
|
||||
QK_MOD_TAP_MAX = 0x7FFF,
|
||||
#ifdef UNICODE_ENABLE
|
||||
QK_UNICODE = 0x8000,
|
||||
QK_UNICODE_MAX = 0xFFFF,
|
||||
#endif
|
||||
|
||||
// Loose keycodes - to be used directly
|
||||
|
||||
RESET = 0x5C00,
|
||||
DEBUG,
|
||||
MAGIC_SWAP_CONTROL_CAPSLOCK,
|
||||
MAGIC_CAPSLOCK_TO_CONTROL,
|
||||
MAGIC_SWAP_LALT_LGUI,
|
||||
MAGIC_SWAP_RALT_RGUI,
|
||||
MAGIC_NO_GUI,
|
||||
MAGIC_SWAP_GRAVE_ESC,
|
||||
MAGIC_SWAP_BACKSLASH_BACKSPACE,
|
||||
MAGIC_HOST_NKRO,
|
||||
MAGIC_SWAP_ALT_GUI,
|
||||
MAGIC_UNSWAP_CONTROL_CAPSLOCK,
|
||||
MAGIC_UNCAPSLOCK_TO_CONTROL,
|
||||
MAGIC_UNSWAP_LALT_LGUI,
|
||||
MAGIC_UNSWAP_RALT_RGUI,
|
||||
MAGIC_UNNO_GUI,
|
||||
MAGIC_UNSWAP_GRAVE_ESC,
|
||||
MAGIC_UNSWAP_BACKSLASH_BACKSPACE,
|
||||
MAGIC_UNHOST_NKRO,
|
||||
MAGIC_UNSWAP_ALT_GUI,
|
||||
MAGIC_TOGGLE_NKRO,
|
||||
|
||||
// Leader key
|
||||
#ifndef DISABLE_LEADER
|
||||
KC_LEAD,
|
||||
#endif
|
||||
|
||||
// Audio on/off/toggle
|
||||
AU_ON,
|
||||
AU_OFF,
|
||||
AU_TOG,
|
||||
|
||||
#ifdef FAUXCLICKY_ENABLE
|
||||
// Faux clicky
|
||||
FC_ON,
|
||||
FC_OFF,
|
||||
FC_TOG,
|
||||
#endif
|
||||
|
||||
// Music mode on/off/toggle
|
||||
MU_ON,
|
||||
MU_OFF,
|
||||
MU_TOG,
|
||||
|
||||
// Music voice iterate
|
||||
MUV_IN,
|
||||
MUV_DE,
|
||||
|
||||
// Midi mode on/off
|
||||
MIDI_ON,
|
||||
MIDI_OFF,
|
||||
|
||||
// Backlight functionality
|
||||
BL_0,
|
||||
BL_1,
|
||||
BL_2,
|
||||
BL_3,
|
||||
BL_4,
|
||||
BL_5,
|
||||
BL_6,
|
||||
BL_7,
|
||||
BL_8,
|
||||
BL_9,
|
||||
BL_10,
|
||||
BL_11,
|
||||
BL_12,
|
||||
BL_13,
|
||||
BL_14,
|
||||
BL_15,
|
||||
BL_DEC,
|
||||
BL_INC,
|
||||
BL_TOGG,
|
||||
BL_STEP,
|
||||
|
||||
// RGB functionality
|
||||
RGB_TOG,
|
||||
RGB_MOD,
|
||||
RGB_HUI,
|
||||
RGB_HUD,
|
||||
RGB_SAI,
|
||||
RGB_SAD,
|
||||
RGB_VAI,
|
||||
RGB_VAD,
|
||||
|
||||
// Left shift, open paren
|
||||
KC_LSPO,
|
||||
|
||||
// Right shift, close paren
|
||||
KC_RSPC,
|
||||
|
||||
// Printing
|
||||
PRINT_ON,
|
||||
PRINT_OFF,
|
||||
|
||||
// output selection
|
||||
OUT_AUTO,
|
||||
OUT_USB,
|
||||
#ifdef BLUETOOTH_ENABLE
|
||||
OUT_BT,
|
||||
#endif
|
||||
#ifdef ADAFRUIT_BLE_ENABLE
|
||||
OUT_BLE,
|
||||
#endif
|
||||
|
||||
// always leave at the end
|
||||
SAFE_RANGE
|
||||
};
|
||||
|
||||
// Ability to use mods in layouts
|
||||
#define LCTL(kc) (kc | QK_LCTL)
|
||||
#define LSFT(kc) (kc | QK_LSFT)
|
||||
#define LALT(kc) (kc | QK_LALT)
|
||||
#define LGUI(kc) (kc | QK_LGUI)
|
||||
#define RCTL(kc) (kc | QK_RCTL)
|
||||
#define RSFT(kc) (kc | QK_RSFT)
|
||||
#define RALT(kc) (kc | QK_RALT)
|
||||
#define RGUI(kc) (kc | QK_RGUI)
|
||||
|
||||
#define HYPR(kc) (kc | QK_LCTL | QK_LSFT | QK_LALT | QK_LGUI)
|
||||
#define MEH(kc) (kc | QK_LCTL | QK_LSFT | QK_LALT)
|
||||
#define LCAG(kc) (kc | QK_LCTL | QK_LALT | QK_LGUI)
|
||||
#define ALTG(kc) (kc | QK_RCTL | QK_RALT)
|
||||
#define SCMD(kc) (kc | QK_LGUI | QK_LSFT)
|
||||
#define SWIN(kc) SCMD(kc)
|
||||
|
||||
#define MOD_HYPR 0xf
|
||||
#define MOD_MEH 0x7
|
||||
|
||||
|
||||
// Aliases for shifted symbols
|
||||
// Each key has a 4-letter code, and some have longer aliases too.
|
||||
// While the long aliases are descriptive, the 4-letter codes
|
||||
// make for nicer grid layouts (everything lines up), and are
|
||||
// the preferred style for Quantum.
|
||||
#define KC_TILD LSFT(KC_GRV) // ~
|
||||
#define KC_TILDE KC_TILD
|
||||
|
||||
#define KC_EXLM LSFT(KC_1) // !
|
||||
#define KC_EXCLAIM KC_EXLM
|
||||
|
||||
#define KC_AT LSFT(KC_2) // @
|
||||
|
||||
#define KC_HASH LSFT(KC_3) // #
|
||||
|
||||
#define KC_DLR LSFT(KC_4) // $
|
||||
#define KC_DOLLAR KC_DLR
|
||||
|
||||
#define KC_PERC LSFT(KC_5) // %
|
||||
#define KC_PERCENT KC_PERC
|
||||
|
||||
#define KC_CIRC LSFT(KC_6) // ^
|
||||
#define KC_CIRCUMFLEX KC_CIRC
|
||||
|
||||
#define KC_AMPR LSFT(KC_7) // &
|
||||
#define KC_AMPERSAND KC_AMPR
|
||||
|
||||
#define KC_ASTR LSFT(KC_8) // *
|
||||
#define KC_ASTERISK KC_ASTR
|
||||
|
||||
#define KC_LPRN LSFT(KC_9) // (
|
||||
#define KC_LEFT_PAREN KC_LPRN
|
||||
|
||||
#define KC_RPRN LSFT(KC_0) // )
|
||||
#define KC_RIGHT_PAREN KC_RPRN
|
||||
|
||||
#define KC_UNDS LSFT(KC_MINS) // _
|
||||
#define KC_UNDERSCORE KC_UNDS
|
||||
|
||||
#define KC_PLUS LSFT(KC_EQL) // +
|
||||
|
||||
#define KC_LCBR LSFT(KC_LBRC) // {
|
||||
#define KC_LEFT_CURLY_BRACE KC_LCBR
|
||||
|
||||
#define KC_RCBR LSFT(KC_RBRC) // }
|
||||
#define KC_RIGHT_CURLY_BRACE KC_RCBR
|
||||
|
||||
#define KC_LABK LSFT(KC_COMM) // <
|
||||
#define KC_LEFT_ANGLE_BRACKET KC_LABK
|
||||
|
||||
#define KC_RABK LSFT(KC_DOT) // >
|
||||
#define KC_RIGHT_ANGLE_BRACKET KC_RABK
|
||||
|
||||
#define KC_COLN LSFT(KC_SCLN) // :
|
||||
#define KC_COLON KC_COLN
|
||||
|
||||
#define KC_PIPE LSFT(KC_BSLS) // |
|
||||
|
||||
#define KC_LT LSFT(KC_COMM) // <
|
||||
|
||||
#define KC_GT LSFT(KC_DOT) // >
|
||||
|
||||
#define KC_QUES LSFT(KC_SLSH) // ?
|
||||
#define KC_QUESTION KC_QUES
|
||||
|
||||
#define KC_DQT LSFT(KC_QUOT) // "
|
||||
#define KC_DOUBLE_QUOTE KC_DQT
|
||||
#define KC_DQUO KC_DQT
|
||||
|
||||
#define KC_DELT KC_DELETE // Del key (four letter code)
|
||||
|
||||
// Alias for function layers than expand past FN31
|
||||
#define FUNC(kc) (kc | QK_FUNCTION)
|
||||
|
||||
// Aliases
|
||||
#define S(kc) LSFT(kc)
|
||||
#define F(kc) FUNC(kc)
|
||||
|
||||
#define M(kc) (kc | QK_MACRO)
|
||||
|
||||
#define MACROTAP(kc) (kc | QK_MACRO | FUNC_TAP<<8)
|
||||
#define MACRODOWN(...) (record->event.pressed ? MACRO(__VA_ARGS__) : MACRO_NONE)
|
||||
|
||||
|
||||
// L-ayer, T-ap - 256 keycode max, 16 layer max
|
||||
#define LT(layer, kc) (kc | QK_LAYER_TAP | ((layer & 0xF) << 8))
|
||||
|
||||
#define AG_SWAP MAGIC_SWAP_ALT_GUI
|
||||
#define AG_NORM MAGIC_UNSWAP_ALT_GUI
|
||||
|
||||
#define BL_ON BL_9
|
||||
#define BL_OFF BL_0
|
||||
|
||||
#define MI_ON MIDI_ON
|
||||
#define MI_OFF MIDI_OFF
|
||||
|
||||
// GOTO layer - 16 layers max
|
||||
// when:
|
||||
// ON_PRESS = 1
|
||||
// ON_RELEASE = 2
|
||||
// Unless you have a good reason not to do so, prefer ON_PRESS (1) as your default.
|
||||
// In fact, we changed it to assume ON_PRESS for sanity/simplicity. If needed, you can add your own
|
||||
// keycode modeled after the old version, kept below for this.
|
||||
/* #define TO(layer, when) (layer | QK_TO | (when << 0x4)) */
|
||||
#define TO(layer) (layer | QK_TO | (ON_PRESS << 0x4))
|
||||
|
||||
// Momentary switch layer - 256 layer max
|
||||
#define MO(layer) (layer | QK_MOMENTARY)
|
||||
|
||||
// Set default layer - 256 layer max
|
||||
#define DF(layer) (layer | QK_DEF_LAYER)
|
||||
|
||||
// Toggle to layer - 256 layer max
|
||||
#define TG(layer) (layer | QK_TOGGLE_LAYER)
|
||||
|
||||
// One-shot layer - 256 layer max
|
||||
#define OSL(layer) (layer | QK_ONE_SHOT_LAYER)
|
||||
|
||||
// One-shot mod
|
||||
#define OSM(mod) (mod | QK_ONE_SHOT_MOD)
|
||||
|
||||
// M-od, T-ap - 256 keycode max
|
||||
#define MT(mod, kc) (kc | QK_MOD_TAP | ((mod & 0x1F) << 8))
|
||||
|
||||
#define CTL_T(kc) MT(MOD_LCTL, kc)
|
||||
#define LCTL_T(kc) MT(MOD_LCTL, kc)
|
||||
#define RCTL_T(kc) MT(MOD_RCTL, kc)
|
||||
|
||||
#define SFT_T(kc) MT(MOD_LSFT, kc)
|
||||
#define LSFT_T(kc) MT(MOD_LSFT, kc)
|
||||
#define RSFT_T(kc) MT(MOD_RSFT, kc)
|
||||
|
||||
#define ALT_T(kc) MT(MOD_LALT, kc)
|
||||
#define LALT_T(kc) MT(MOD_LALT, kc)
|
||||
#define RALT_T(kc) MT(MOD_RALT, kc)
|
||||
#define ALGR_T(kc) MT(MOD_RALT, kc) // dual-function AltGR
|
||||
|
||||
#define GUI_T(kc) MT(MOD_LGUI, kc)
|
||||
#define LGUI_T(kc) MT(MOD_LGUI, kc)
|
||||
#define RGUI_T(kc) MT(MOD_RGUI, kc)
|
||||
|
||||
#define C_S_T(kc) MT((MOD_LCTL | MOD_LSFT), kc) // Control + Shift e.g. for gnome-terminal
|
||||
#define MEH_T(kc) MT((MOD_LCTL | MOD_LSFT | MOD_LALT), kc) // Meh is a less hyper version of the Hyper key -- doesn't include Win or Cmd, so just alt+shift+ctrl
|
||||
#define LCAG_T(kc) MT((MOD_LCTL | MOD_LALT | MOD_LGUI), kc) // Left control alt and gui
|
||||
#define RCAG_T(kc) MT((MOD_RCTL | MOD_RALT | MOD_RGUI), kc) // Right control alt and gui
|
||||
#define ALL_T(kc) MT((MOD_LCTL | MOD_LSFT | MOD_LALT | MOD_LGUI), kc) // see http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/
|
||||
#define SCMD_T(kc) MT((MOD_LGUI | MOD_LSFT), kc)
|
||||
#define SWIN_T(kc) SCMD_T(kc)
|
||||
|
||||
// Dedicated keycode versions for Hyper and Meh, if you want to use them as standalone keys rather than mod-tap
|
||||
#define KC_HYPR HYPR(KC_NO)
|
||||
#define KC_MEH MEH(KC_NO)
|
||||
|
||||
#ifdef UNICODE_ENABLE
|
||||
// For sending unicode codes.
|
||||
// You may not send codes over 7FFF -- this supports most of UTF8.
|
||||
// To have a key that sends out Œ, go UC(0x0152)
|
||||
#define UNICODE(n) (n | QK_UNICODE)
|
||||
#define UC(n) UNICODE(n)
|
||||
#endif
|
||||
|
||||
#ifdef UNICODEMAP_ENABLE
|
||||
#define X(n) (n | QK_UNICODE_MAP)
|
||||
#endif
|
||||
|
||||
#endif // QUANTUM_KEYCODES_H
|
@ -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,41 @@
|
||||
/*
|
||||
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/>.
|
||||
*/
|
||||
|
||||
enum outputs {
|
||||
OUTPUT_AUTO,
|
||||
|
||||
OUTPUT_NONE,
|
||||
OUTPUT_USB,
|
||||
OUTPUT_BLUETOOTH,
|
||||
OUTPUT_ADAFRUIT_BLE,
|
||||
|
||||
// backward compatibility
|
||||
OUTPUT_USB_AND_BT
|
||||
};
|
||||
|
||||
/**
|
||||
* backward compatibility for BLUETOOTH_ENABLE, send to BT and USB by default
|
||||
*/
|
||||
#ifndef OUTPUT_DEFAULT
|
||||
#ifdef BLUETOOTH_ENABLE
|
||||
#define OUTPUT_DEFAULT OUTPUT_USB_AND_BT
|
||||
#else
|
||||
#define OUTPUT_DEFAULT OUTPUT_AUTO
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void set_output(uint8_t output);
|
||||
void set_output_user(uint8_t output);
|
||||
uint8_t auto_detect_output(void);
|
||||
uint8_t where_to_send(void);
|
@ -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
|