Merge remote-tracking branch 'upstream/master' into user_led_configuration
@ -0,0 +1,5 @@
|
||||
#include "M10A.h"
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
matrix_init_user();
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
#ifndef M10A_H
|
||||
#define M10A_H
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
#define M10A( \
|
||||
k00, k01, k02, \
|
||||
k10, k11, k12, \
|
||||
k20, k21, k22, \
|
||||
k30, k31, k32 \
|
||||
) \
|
||||
{ \
|
||||
{ k00, k01, k02 }, \
|
||||
{ k10, k11, k12 }, \
|
||||
{ k20, k21, k22 }, \
|
||||
{ k30, k31, k32 } \
|
||||
}
|
||||
|
||||
#endif
|
@ -0,0 +1,82 @@
|
||||
/*
|
||||
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 0x0007
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER Machine Industries
|
||||
#define PRODUCT M10-A
|
||||
#define DESCRIPTION RAMA x Machine Industries M10-A
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 4
|
||||
#define MATRIX_COLS 3
|
||||
|
||||
/* Planck PCB default pin-out */
|
||||
#define MATRIX_ROW_PINS { B6, F7, F6, D6 }
|
||||
#define MATRIX_COL_PINS { F5, F1, F0 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
#define BACKLIGHT_PIN B7
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION ROW2COL
|
||||
|
||||
/* define if matrix has ghost */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* number of backlight levels */
|
||||
#define BACKLIGHT_LEVELS 6
|
||||
|
||||
/* Set 0 if debouncing isn't needed */
|
||||
#define DEBOUNCING_DELAY 5
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/* key combination for command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
*/
|
||||
|
||||
/* disable debug print */
|
||||
//#define NO_DEBUG
|
||||
|
||||
/* disable print */
|
||||
//#define NO_PRINT
|
||||
|
||||
/* disable action features */
|
||||
//#define NO_ACTION_LAYER
|
||||
//#define NO_ACTION_TAPPING
|
||||
//#define NO_ACTION_ONESHOT
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
|
||||
#endif
|
@ -0,0 +1,3 @@
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
@ -0,0 +1,49 @@
|
||||
// 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 "M10A.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.
|
||||
|
||||
enum layers {
|
||||
_LAYER0,
|
||||
_LAYER1,
|
||||
_LAYER2,
|
||||
_LAYER3,
|
||||
_LAYER4,
|
||||
_LAYER5,
|
||||
_LAYER6,
|
||||
_LAYER7,
|
||||
_LAYER8,
|
||||
_LAYER9
|
||||
};
|
||||
|
||||
// // Fillers to make layering more clear
|
||||
// #define _______ KC_TRNS
|
||||
// #define XXXXXXX KC_NO
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[_LAYER0] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
|
||||
[_LAYER1] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
|
||||
[_LAYER2] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
|
||||
[_LAYER3] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
|
||||
[_LAYER4] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
|
||||
[_LAYER5] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
|
||||
[_LAYER6] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
|
||||
[_LAYER7] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
|
||||
[_LAYER8] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}},
|
||||
[_LAYER9] = {{KC_A, KC_B, KC_C}, {KC_D, KC_E, KC_F}, {KC_G, KC_H, KC_I}, {KC_NO, KC_NO, KC_J}}
|
||||
};
|
||||
|
||||
void matrix_init_user(void) {
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
backlight_level(0);
|
||||
#endif
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
# 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
|
||||
# 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.
|
||||
API_SYSEX_ENABLE = yes
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
@ -0,0 +1,61 @@
|
||||
// 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 "amj60.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 _DEF 0
|
||||
#define _SPC 1
|
||||
|
||||
// dual-role shortcuts
|
||||
#define SPACEDUAL LT(_SPC, KC_SPACE)
|
||||
|
||||
|
||||
// increase readability
|
||||
#define _______ KC_TRNS
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap _DEF: Default Layer
|
||||
* ,-----------------------------------------------------------.
|
||||
* |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \ | ~ |
|
||||
* |-----------------------------------------------------------|
|
||||
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| bspc|
|
||||
* |-----------------------------------------------------------|
|
||||
* |Caps | A| S| D| F| G| H| J| K| L| ;| '| Return |
|
||||
* |-----------------------------------------------------------|
|
||||
* |Sft | Fn0| Z| X| C| V| B| N| M| ,| .| /| Sft |Fn2|
|
||||
* |-----------------------------------------------------------|
|
||||
* |Ctrl|Win |Alt | Space/Fn0 |Alt |Win |Menu|RCtl|
|
||||
* `-----------------------------------------------------------'
|
||||
*/
|
||||
[_DEF] = KEYMAP_MAX(
|
||||
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_CAPS, 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, F(0), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, F(1), \
|
||||
KC_LCTL, KC_LALT, KC_LGUI, SPACEDUAL, KC_RGUI, KC_RALT, KC_RCTL, F(2)),
|
||||
|
||||
/* Keymap 1: F-and-vim Layer, modified with Space (by holding space)
|
||||
* ,-----------------------------------------------------------.
|
||||
* |PrSc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | |
|
||||
* |-----------------------------------------------------------|
|
||||
* | |Paus| Up| [ | ] | | | | ( | ) | | | | Del |
|
||||
* |-----------------------------------------------------------|
|
||||
* | |Lft|Dwn|Rgt| | |Left|Down|Right|Up| | | PLAY |
|
||||
* |-----------------------------------------------------------|
|
||||
* | | | | | < | > | |M0 | | | | | Vol+ | |
|
||||
* |-----------------------------------------------------------|
|
||||
* | | | | |Alt |Prev|Vol-|Next|
|
||||
* `-----------------------------------------------------------'
|
||||
*/
|
||||
[_SPC] = KEYMAP_MAX(
|
||||
KC_PSCR, 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_PAUS, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \
|
||||
_______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, KC_MPLY, \
|
||||
_______, _______, _______, _______, _______, _______, KC_SPACE, M(0), _______, _______, _______, _______, KC_VOLU, _______, \
|
||||
_______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT),
|
||||
|
||||
};
|
@ -0,0 +1,102 @@
|
||||
#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 |Setp| - | = |
|
||||
* |----|----|----|----|
|
||||
* | F1 | F2 | F3 | F4 |
|
||||
* |----|----|----|----|
|
||||
* | 7 | 8 | 9 | - |
|
||||
* |----|----|----|----|
|
||||
* | 4 | 5 | 6 | LF |
|
||||
* |----|----|----|----|
|
||||
* | 1 | 2 | 3 | \ |
|
||||
* |----|----|----|----|
|
||||
* |Left|Down| Up |Rght|
|
||||
* `-------------------'
|
||||
*/
|
||||
|
||||
[_BL] = MAXKEYMAP(
|
||||
|
||||
KC_ESC, KC_TAB, KC_MINS,KC_EQL, \
|
||||
KC_F1, KC_F2, KC_F3, KC_F4, \
|
||||
KC_P7, KC_P8, KC_P9, KC_PMNS, \
|
||||
KC_P4, KC_P5, KC_P6, KC_PENT, \
|
||||
KC_P1, KC_P2, KC_P3, KC_BSLS, \
|
||||
KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT),
|
||||
|
||||
/* Keymap _FL: Function Layer
|
||||
* ,-------------------.
|
||||
* |Esc |TAB |BS | = |
|
||||
* |----|----|----|----|
|
||||
* | NL | / | * | - |
|
||||
* |----|----|----|----|
|
||||
* | 7 | 8 | 9 | |
|
||||
* |----|----|----|RST |
|
||||
* | 4 | 5 | 6 | |
|
||||
* |----|----|----|----|
|
||||
* | 1 | 2 | 3 | |
|
||||
* |----|----|----| En |
|
||||
* | 0 |./FN| |
|
||||
* `-------------------'
|
||||
*/
|
||||
[_FL] = MAXKEYMAP(
|
||||
|
||||
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_PENT, \
|
||||
KC_P1, KC_P2, KC_P3, KC_PENT, \
|
||||
KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT),
|
||||
};
|
||||
|
||||
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,65 @@
|
||||
#include "amjpad.h"
|
||||
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
#include "rgblight.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 _BL 0
|
||||
#define _FL 1
|
||||
|
||||
#define _______ KC_TRNS
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap _BL: (Base Layer) Default Layer
|
||||
* ,-------------------.
|
||||
* | T | G | B |Spac|
|
||||
* |----|----|----|----|
|
||||
* | R | F | V | Fn |
|
||||
* |----|----|----|----|
|
||||
* | E | D | C | OS |
|
||||
* |----|----|----|----|
|
||||
* | W | S | X | Alt|
|
||||
* |----|----|----|----|
|
||||
* | Q | A | Z | Ctl|
|
||||
* |----|----|----|----|
|
||||
* | Esc| Tab|Shft| Fn2|
|
||||
* `-------------------'
|
||||
*/
|
||||
|
||||
[_BL] = MAXKEYMAP(
|
||||
|
||||
KC_T, KC_G, KC_B, KC_SPACE,\
|
||||
KC_R, KC_F, KC_V, MO(1), \
|
||||
KC_E, KC_D, KC_C, KC_LGUI, \
|
||||
KC_W, KC_S, KC_X, KC_LALT, \
|
||||
KC_Q, KC_A, KC_Z, KC_LCTL, \
|
||||
KC_TAB, KC_ESC, KC_LSHIFT, MO(1)),
|
||||
|
||||
/* Keymap _FL: Function Layer
|
||||
* ,-------------------.
|
||||
* | 5 | F5 | F11|Spac|
|
||||
* |----|----|----|----|
|
||||
* | 4 | F4 | F10| |
|
||||
* |----|----|----|----|
|
||||
* | 3 | F3 | F9 | OS |
|
||||
* |----|----|----|----|
|
||||
* | 2 | F2 | F8 | Alt|
|
||||
* |----|----|----|----|
|
||||
* | 1 | F1 | F7 | Ctl|
|
||||
* |----|----|----|----|
|
||||
* | ` | Del|Shft| |
|
||||
* `-------------------'
|
||||
*/
|
||||
[_FL] = MAXKEYMAP(
|
||||
|
||||
KC_5, KC_F5, KC_F11, _______, \
|
||||
KC_4, KC_F4, KC_F10, _______, \
|
||||
KC_3, KC_F3, KC_F9, _______, \
|
||||
KC_2, KC_F2, KC_F8, _______, \
|
||||
KC_1, KC_F1, KC_F7, _______, \
|
||||
KC_GRV,KC_DEL, _______, _______),
|
||||
};
|
@ -0,0 +1,65 @@
|
||||
#include "amjpad.h"
|
||||
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
#include "rgblight.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 _BL 0
|
||||
#define _FL 1
|
||||
|
||||
#define _______ KC_TRNS
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap _BL: (Base Layer) Default Layer
|
||||
* ,-------------------.
|
||||
* |Spac| N | H | Y |
|
||||
* |----|----|----|----|
|
||||
* | Fn | M | J | U |
|
||||
* |----|----|----|----|
|
||||
* |Left| , | K | I |
|
||||
* |----|----|----|----|
|
||||
* |Down| . | L | O |
|
||||
* |----|----|----|----|
|
||||
* | Up | / | ; | P |
|
||||
* |----|----|----|----|
|
||||
* |Rght| Ret| " |Bspc|
|
||||
* `-------------------'
|
||||
*/
|
||||
|
||||
[_BL] = MAXKEYMAP(
|
||||
|
||||
KC_SPACE, KC_N, KC_H, KC_Y, \
|
||||
MO(1), KC_M, KC_J, KC_U, \
|
||||
KC_LEFT, KC_COMM, KC_K, KC_I, \
|
||||
KC_DOWN, KC_DOT, KC_L, KC_O, \
|
||||
KC_UP, KC_SLASH, KC_SCLN, KC_P, \
|
||||
KC_RIGHT, KC_ENT, KC_QUOT, KC_BSPC),
|
||||
|
||||
/* Keymap _FL: Function Layer
|
||||
* ,-------------------.
|
||||
* |Esc | F12| F6 | 6 |
|
||||
* |----|----|----|----|
|
||||
* | NL | M | - | 7 |
|
||||
* |----|----|----|----|
|
||||
* |Left| , | = | 8 |
|
||||
* |----|----|----|----|
|
||||
* |Down| . | [ | 9 |
|
||||
* |----|----|----|----|
|
||||
* | Up | / | ] | 0 |
|
||||
* |----|----|----|----|
|
||||
* |Rght| Ret| \ | Del|
|
||||
* `-------------------'
|
||||
*/
|
||||
[_FL] = MAXKEYMAP(
|
||||
|
||||
_______, KC_F12, KC_F6, KC_6, \
|
||||
_______, _______, KC_MINS, KC_7, \
|
||||
_______, _______, KC_EQL, KC_8, \
|
||||
_______, _______, KC_LBRC, KC_9, \
|
||||
_______, _______, KC_RBRC, KC_0, \
|
||||
_______, _______, KC_BSLS, KC_DEL),
|
||||
};
|
@ -0,0 +1,107 @@
|
||||
# Xyverz's Atreus Keymap
|
||||
|
||||
## About this keymap:
|
||||
|
||||
This is the second iteration of my Atreus keymap. The first one was as close to the planck as I could get at the
|
||||
time, but still very much like the original Atreus keymap. I've managed to get things working better now and have
|
||||
implemented (more like copied) the RAISE/LOWER/ADJUST layers. This is a work in progress, but I think I'm closer
|
||||
to a final go with this.
|
||||
|
||||
I'm using MOD_TAP quite a bit in this keymap. On all layers, R4 pinky keys use mod-tap and are SHIFT when held
|
||||
and their normal keys when tapped. In addition, ESC and TAB are also set as Ctrl and ALT respectively when held,
|
||||
and Enter/ALT on the right thumb key for all layers.
|
||||
|
||||
I've enabled persistent keymaps for Qwerty, Dvorak and Colemak layers, similar to the default Planck layouts.
|
||||
|
||||
Recently added: Documentation, Formatting, and another Dvorak layer that has Command on the left thumb, instead of
|
||||
Control.
|
||||
|
||||
## Still to do:
|
||||
|
||||
* Enjoy this revision; figure out new things later.
|
||||
|
||||
### Layer 0: Dvorak layer
|
||||
|
||||
,----------------------------------. ,----------------------------------.
|
||||
| ' | , | . | P | Y | | F | G | C | R | L |
|
||||
|------+------+------+------+------| |------+------+------+------+------|
|
||||
| A | O | E | U | I | | D | H | T | N | S |
|
||||
|------+------+------+------+------|------.,------|------+------+------+------+------|
|
||||
|Shft ;| Q | J | K | X | CTRL ||Alt / | B | M | W | V |Shft Z|
|
||||
|------+------+------+------+------| ||Enter |------+------+------+------+------|
|
||||
| Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | / | \ |
|
||||
`----------------------------------' `----------------------------------'
|
||||
|
||||
### Layer 1: QWERTY layer
|
||||
|
||||
,----------------------------------. ,----------------------------------.
|
||||
| Q | W | E | R | T | | Y | U | I | O | P |
|
||||
|------+------+------+------+------| |------+------+------+------+------|
|
||||
| A | S | D | F | G | | H | J | K | L | ; |
|
||||
|------+------+------+------+------|------.,------|------+------+------+------+------|
|
||||
|Shft Z| X | C | V | B | CTRL ||Alt / | N | M | , | . |Shft /|
|
||||
|------+------+------+------+------| ||Enter |------+------+------+------+------|
|
||||
| Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | ' | \ |
|
||||
`----------------------------------' `----------------------------------'
|
||||
|
||||
### Keymap 2: Colemak layer
|
||||
|
||||
,----------------------------------. ,----------------------------------.
|
||||
| Q | W | F | P | G | | J | L | U | Y | L |
|
||||
|------+------+------+------+------| |------+------+------+------+------|
|
||||
| A | R | S | T | D | | H | N | E | I | S |
|
||||
|------+------+------+------+------|------.,------|------+------+------+------+------|
|
||||
|Shft Z| X | C | V | B | CTRL ||Alt / | K | M | , | . |Shft /|
|
||||
|------+------+------+------+------| ||Enter |------+------+------+------+------|
|
||||
| Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | ' | \ |
|
||||
`----------------------------------' `----------------------------------'
|
||||
|
||||
### Keymap 3: Dvorak for Mac layout
|
||||
|
||||
,----------------------------------. ,----------------------------------.
|
||||
| ' | , | . | P | Y | | F | G | C | R | L |
|
||||
|------+------+------+------+------| |------+------+------+------+------|
|
||||
| A | O | E | U | I | | D | H | T | N | S |
|
||||
|------+------+------+------+------|------.,------|------+------+------+------+------|
|
||||
|SFT/ ;| Q | J | K | X | CMD ||Alt / | B | M | W | V |SFT/ Z|
|
||||
|------+------+------+------+------| ||Enter |------+------+------+------+------|
|
||||
| Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | / | \ |
|
||||
`----------------------------------' `----------------------------------'
|
||||
|
||||
### Keymap 4: LOWER layer
|
||||
|
||||
,----------------------------------. ,----------------------------------.
|
||||
| ! | @ | # | $ | % | | ^ | & | * | ( | ) |
|
||||
|------+------+------+------+------| |------+------+------+------+------|
|
||||
| CAPS | | UP | | Home | | PgDn | | + | { | } |
|
||||
|------+------+------+------+------|------.,------|------+------+------+------+------|
|
||||
| | Left | Down | Right| End | || | PgUp | Mute | Vol- | Vol+ | |
|
||||
|------+------+------+------+------| || |------+------+------+------+------|
|
||||
| ~ | | | | Del |------'`------| Ins | | | | |
|
||||
`----------------------------------' `----------------------------------'
|
||||
|
||||
|
||||
### Keymap 5: RAISE layer
|
||||
|
||||
,----------------------------------. ,----------------------------------.
|
||||
| 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 |
|
||||
|------+------+------+------+------| |------+------+------+------+------|
|
||||
| CAPS | | UP | | Home | | PgDn | | = | [ | ] |
|
||||
|------+------+------+------+------|------.,------|------+------+------+------+------|
|
||||
| | Left | Down | Right| End | || | PgUp | Prev | Play | Next | |
|
||||
|------+------+------+------+------| || |------+------+------+------+------|
|
||||
| ` | | | | Del |------'`------| Ins | | | | |
|
||||
`----------------------------------' `----------------------------------'
|
||||
|
||||
### Keymap 6: ADJUST layer
|
||||
|
||||
,----------------------------------. ,----------------------------------.
|
||||
| F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 |
|
||||
|------+------+------+------+------| |------+------+------+------+------|
|
||||
| F11 | | | | | | | PScr | SLck | Paus | F12 |
|
||||
|------+------+------+------+------|------.,------|------+------+------+------+------|
|
||||
| |QWERTY|COLEMK|DVORAK|DVORMC| || | | | | | |
|
||||
|------+------+------+------+------| || |------+------+------+------+------|
|
||||
| | | | | |------'`------| | | | | RESET|
|
||||
`----------------------------------' `----------------------------------'
|
||||
|
@ -0,0 +1,4 @@
|
||||
|
||||
MOUSEKEY_ENABLE = yes
|
||||
EXTRAKEY_ENABLE = yes
|
||||
|
@ -0,0 +1,103 @@
|
||||
#include "clueboard.h"
|
||||
|
||||
// Helpful defines
|
||||
#define GRAVE_MODS (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)|MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
|
||||
#define _______ KC_TRNS
|
||||
|
||||
// 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 _ME 2
|
||||
#define _CL 3
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap _BL: Base Layer (Default Layer)
|
||||
*/
|
||||
[_BL] = KEYMAP(
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_PGUP, \
|
||||
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_PGDN, \
|
||||
F(1), 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_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, KC_UP, \
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_MHEN, KC_SPC,KC_SPC, KC_HENK, KC_RGUI, MO(_FL), MO(_ME), KC_LEFT, KC_DOWN, KC_RGHT),
|
||||
|
||||
/* Keymap _FL: Function Layer
|
||||
*/
|
||||
[_FL] = KEYMAP(
|
||||
KC_ESC, 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, KC_HOME, \
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK, KC_PAUS, _______, _______, KC_PSCR, KC_END, \
|
||||
_______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_PGUP, \
|
||||
_______, _______, _______, _______, _______,_______, _______, _______, MO(_FL), MO(_ME), KC_HOME, KC_PGDN, KC_END),
|
||||
|
||||
/* Keymap _FL: Function Layer
|
||||
*/
|
||||
[_ME] = KEYMAP(
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_MUTE, KC_VOLU, \
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK, KC_PAUS, _______, _______, _______, KC_VOLD, \
|
||||
_______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______ , _______, _______, \
|
||||
_______, _______, _______, _______, _______,_______, _______, _______, MO(_FL), MO(_ME), KC_MPRV, KC_MPLY, KC_MNXT),
|
||||
|
||||
|
||||
/* Keymap _CL: Control layer
|
||||
*/
|
||||
[_CL] = KEYMAP(
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, RGB_TOG, RGB_VAI, \
|
||||
_______, _______, _______,_______,RESET, _______,_______,_______,_______,_______, _______, _______, _______, _______, RGB_VAD, \
|
||||
_______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
|
||||
MO(_FL), _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, MO(_FL), _______, RGB_SAI, \
|
||||
_______, _______, _______,_______, RGB_MOD, RGB_MOD, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_HUI),
|
||||
};
|
||||
|
||||
/* This is a list of user defined functions. F(N) corresponds to item N
|
||||
of this list.
|
||||
*/
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[0] = ACTION_FUNCTION(0), // Calls action_function()
|
||||
[1] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ESC),
|
||||
};
|
||||
|
||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
static uint8_t mods_pressed;
|
||||
static bool mod_flag;
|
||||
|
||||
switch (id) {
|
||||
case 0:
|
||||
/* Handle the combined Grave/Esc key
|
||||
*/
|
||||
mods_pressed = get_mods()&GRAVE_MODS; // Check to see what mods are pressed
|
||||
|
||||
if (record->event.pressed) {
|
||||
/* The key is being pressed.
|
||||
*/
|
||||
if (mods_pressed) {
|
||||
mod_flag = true;
|
||||
add_key(KC_GRV);
|
||||
send_keyboard_report();
|
||||
} else {
|
||||
add_key(KC_ESC);
|
||||
send_keyboard_report();
|
||||
}
|
||||
} else {
|
||||
/* The key is being released.
|
||||
*/
|
||||
if (mod_flag) {
|
||||
mod_flag = false;
|
||||
del_key(KC_GRV);
|
||||
send_keyboard_report();
|
||||
} else {
|
||||
del_key(KC_ESC);
|
||||
send_keyboard_report();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if(record->event.pressed) {
|
||||
del_key(KC_ESC);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 28 KiB |
@ -0,0 +1,23 @@
|
||||
```
|
||||
___ _____ _ _ _ __ __ _ __
|
||||
|__ \ / ____| | | | | | / / / /(_) / /
|
||||
||) | | | | |_ _ ___| |__ ___ __ _ _ __ __| | / /_ / /_ / /
|
||||
|/ / | | | | | | |/ _ \ '_ \ / _ \ / _` | '__/ _` | | '_ \| '_ \ / /
|
||||
|_| | |____| | |_| | __/ |_) | (_) | (_| | | | (_| | | (_) | (_) / / _
|
||||
(_) \_____|_|\__,_|\___|_.__/ \___/ \__,_|_| \__,_| \___/ \___/_/ (_)
|
||||
```
|
||||
|
||||
# Serubin's Clueboard Layout
|
||||
|
||||
This is the layout based on the clueboard default, modified for development on Mac, PC, and Windows. This layout also handles media and volume keys on all the previously listed platforms. Most importantly, Capslock has been replaced by a dual function Esc/Ctrl key. This is particularly handy for use in Vim.
|
||||
|
||||
#### Base Layer
|
||||
![Base Layout Image](layout-base.png)
|
||||
|
||||
#### Fn Layer
|
||||
![Fn Layout Image](layout-fn.png)
|
||||
|
||||
#### Media Layer
|
||||
![Media Layer Image](layout-media.png)
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../../Makefile
|
||||
endif
|
||||
endif
|
||||
|
@ -0,0 +1,107 @@
|
||||
/* Copyright 2017 Fred Sundvik
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#if defined(VISUALIZER_ENABLE)
|
||||
|
||||
#include "animations.h"
|
||||
#include "visualizer.h"
|
||||
#ifdef LCD_ENABLE
|
||||
#include "lcd_keyframes.h"
|
||||
#endif
|
||||
#ifdef LCD_BACKLIGHT_ENABLE
|
||||
#include "lcd_backlight_keyframes.h"
|
||||
#endif
|
||||
|
||||
#ifdef LED_ENABLE
|
||||
#include "led_keyframes.h"
|
||||
#endif
|
||||
|
||||
#include "visualizer_keyframes.h"
|
||||
|
||||
|
||||
#if defined(LCD_ENABLE) && defined(LCD_BACKLIGHT_ENABLE)
|
||||
|
||||
// Don't worry, if the startup animation is long, you can use the keyboard like normal
|
||||
// during that time
|
||||
keyframe_animation_t default_startup_animation = {
|
||||
.num_frames = 4,
|
||||
.loop = false,
|
||||
.frame_lengths = {0, 0, 0, gfxMillisecondsToTicks(5000), 0},
|
||||
.frame_functions = {
|
||||
lcd_keyframe_enable,
|
||||
backlight_keyframe_enable,
|
||||
lcd_keyframe_draw_logo,
|
||||
backlight_keyframe_animate_color,
|
||||
},
|
||||
};
|
||||
|
||||
keyframe_animation_t default_suspend_animation = {
|
||||
.num_frames = 4,
|
||||
.loop = false,
|
||||
.frame_lengths = {0, gfxMillisecondsToTicks(1000), 0, 0},
|
||||
.frame_functions = {
|
||||
lcd_keyframe_display_layer_text,
|
||||
backlight_keyframe_animate_color,
|
||||
lcd_keyframe_disable,
|
||||
backlight_keyframe_disable,
|
||||
},
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(LED_ENABLE)
|
||||
#define CROSSFADE_TIME 1000
|
||||
#define GRADIENT_TIME 3000
|
||||
|
||||
keyframe_animation_t led_test_animation = {
|
||||
.num_frames = 14,
|
||||
.loop = true,
|
||||
.frame_lengths = {
|
||||
gfxMillisecondsToTicks(1000), // fade in
|
||||
gfxMillisecondsToTicks(1000), // no op (leds on)
|
||||
gfxMillisecondsToTicks(1000), // fade out
|
||||
gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
|
||||
gfxMillisecondsToTicks(GRADIENT_TIME), // left to rigt (outside in)
|
||||
gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
|
||||
gfxMillisecondsToTicks(GRADIENT_TIME), // top_to_bottom
|
||||
0, // mirror leds
|
||||
gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
|
||||
gfxMillisecondsToTicks(GRADIENT_TIME), // left_to_right (mirrored, so inside out)
|
||||
gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
|
||||
gfxMillisecondsToTicks(GRADIENT_TIME), // top_to_bottom
|
||||
0, // normal leds
|
||||
gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
|
||||
|
||||
},
|
||||
.frame_functions = {
|
||||
led_keyframe_fade_in_all,
|
||||
keyframe_no_operation,
|
||||
led_keyframe_fade_out_all,
|
||||
led_keyframe_crossfade,
|
||||
led_keyframe_left_to_right_gradient,
|
||||
led_keyframe_crossfade,
|
||||
led_keyframe_top_to_bottom_gradient,
|
||||
led_keyframe_mirror_orientation,
|
||||
led_keyframe_crossfade,
|
||||
led_keyframe_left_to_right_gradient,
|
||||
led_keyframe_crossfade,
|
||||
led_keyframe_top_to_bottom_gradient,
|
||||
led_keyframe_normal_orientation,
|
||||
led_keyframe_crossfade,
|
||||
},
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
@ -0,0 +1,30 @@
|
||||
/* Copyright 2017 Fred Sundvik
|
||||
*
|
||||
* 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_INFINITY_ANIMATIONS_H_
|
||||
#define KEYBOARDS_ERGODOX_INFINITY_ANIMATIONS_H_
|
||||
|
||||
#include "visualizer.h"
|
||||
|
||||
// You can use these default animations, but of course you can also write your own custom ones instead
|
||||
extern keyframe_animation_t default_startup_animation;
|
||||
extern keyframe_animation_t default_suspend_animation;
|
||||
|
||||
// An animation for testing and demonstrating the led support, should probably not be used for real world
|
||||
// cases
|
||||
extern keyframe_animation_t led_test_animation;
|
||||
|
||||
#endif /* KEYBOARDS_ERGODOX_INFINITY_ANIMATIONS_H_ */
|
@ -0,0 +1,123 @@
|
||||
/* Copyright 2017 Fred Sundvik
|
||||
*
|
||||
* 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_INFINITY_SIMPLE_VISUALIZER_H_
|
||||
#define KEYBOARDS_ERGODOX_INFINITY_SIMPLE_VISUALIZER_H_
|
||||
|
||||
// Currently we are assuming that both the backlight and LCD are enabled
|
||||
// But it's entirely possible to write a custom visualizer that use only
|
||||
// one of them
|
||||
#ifndef LCD_BACKLIGHT_ENABLE
|
||||
#error This visualizer needs that LCD backlight is enabled
|
||||
#endif
|
||||
|
||||
#ifndef LCD_ENABLE
|
||||
#error This visualizer needs that LCD is enabled
|
||||
#endif
|
||||
|
||||
#include "visualizer.h"
|
||||
#include "visualizer_keyframes.h"
|
||||
#include "lcd_keyframes.h"
|
||||
#include "lcd_backlight_keyframes.h"
|
||||
#include "system/serial_link.h"
|
||||
#include "led.h"
|
||||
#include "animations.h"
|
||||
|
||||
static const uint32_t logo_background_color = LCD_COLOR(0x00, 0x00, 0xFF);
|
||||
static const uint32_t initial_color = LCD_COLOR(0, 0, 0);
|
||||
|
||||
static bool initial_update = true;
|
||||
|
||||
// Feel free to modify the animations below, or even add new ones if needed
|
||||
|
||||
static keyframe_animation_t lcd_layer_display = {
|
||||
.num_frames = 1,
|
||||
.loop = false,
|
||||
.frame_lengths = {gfxMillisecondsToTicks(0)},
|
||||
.frame_functions = {lcd_keyframe_display_layer_and_led_states}
|
||||
};
|
||||
|
||||
// The color animation animates the LCD color when you change layers
|
||||
static keyframe_animation_t color_animation = {
|
||||
.num_frames = 2,
|
||||
.loop = false,
|
||||
// Note that there's a 200 ms no-operation frame,
|
||||
// this prevents the color from changing when activating the layer
|
||||
// momentarily
|
||||
.frame_lengths = {gfxMillisecondsToTicks(200), gfxMillisecondsToTicks(500)},
|
||||
.frame_functions = {keyframe_no_operation, backlight_keyframe_animate_color},
|
||||
};
|
||||
|
||||
void initialize_user_visualizer(visualizer_state_t* state) {
|
||||
// The brightness will be dynamically adjustable in the future
|
||||
// But for now, change it here.
|
||||
lcd_backlight_brightness(130);
|
||||
state->current_lcd_color = initial_color;
|
||||
state->target_lcd_color = logo_background_color;
|
||||
initial_update = true;
|
||||
start_keyframe_animation(&default_startup_animation);
|
||||
}
|
||||
|
||||
|
||||
// This function should be implemented by the keymap visualizer
|
||||
// Don't change anything else than state->target_lcd_color and state->layer_text as that's the only thing
|
||||
// that the simple_visualizer assumes that you are updating
|
||||
// Also make sure that the buffer passed to state->layer_text remains valid until the previous animation is
|
||||
// stopped. This can be done by either double buffering it or by using constant strings
|
||||
static void get_visualizer_layer_and_color(visualizer_state_t* state);
|
||||
|
||||
void update_user_visualizer_state(visualizer_state_t* state, visualizer_keyboard_status_t* prev_status) {
|
||||
// Add more tests, change the colors and layer texts here
|
||||
// Usually you want to check the high bits (higher layers first)
|
||||
// because that's the order layers are processed for keypresses
|
||||
// You can for check for example:
|
||||
// state->status.layer
|
||||
// state->status.default_layer
|
||||
// state->status.leds (see led.h for available statuses)
|
||||
|
||||
uint32_t prev_color = state->target_lcd_color;
|
||||
const char* prev_layer_text = state->layer_text;
|
||||
|
||||
get_visualizer_layer_and_color(state);
|
||||
|
||||
if (initial_update || prev_color != state->target_lcd_color) {
|
||||
start_keyframe_animation(&color_animation);
|
||||
}
|
||||
|
||||
if (initial_update || prev_layer_text != state->layer_text) {
|
||||
start_keyframe_animation(&lcd_layer_display);
|
||||
}
|
||||
// You can also stop existing animations, and start your custom ones here
|
||||
// remember that you should normally have only one animation for the LCD
|
||||
// and one for the background. But you can also combine them if you want.
|
||||
}
|
||||
|
||||
void user_visualizer_suspend(visualizer_state_t* state) {
|
||||
state->layer_text = "Suspending...";
|
||||
uint8_t hue = LCD_HUE(state->current_lcd_color);
|
||||
uint8_t sat = LCD_SAT(state->current_lcd_color);
|
||||
state->target_lcd_color = LCD_COLOR(hue, sat, 0);
|
||||
start_keyframe_animation(&default_suspend_animation);
|
||||
}
|
||||
|
||||
void user_visualizer_resume(visualizer_state_t* state) {
|
||||
state->current_lcd_color = initial_color;
|
||||
state->target_lcd_color = logo_background_color;
|
||||
initial_update = true;
|
||||
start_keyframe_animation(&default_startup_animation);
|
||||
}
|
||||
|
||||
#endif /* KEYBOARDS_ERGODOX_INFINITY_SIMPLE_VISUALIZER_H_ */
|
@ -0,0 +1,329 @@
|
||||
/*
|
||||
Copyright 2016 Fred Sundvik <fsundvik@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/>.
|
||||
*/
|
||||
|
||||
// Currently we are assuming that both the backlight and LCD are enabled
|
||||
// But it's entirely possible to write a custom visualizer that use only
|
||||
// one of them
|
||||
#ifndef LCD_BACKLIGHT_ENABLE
|
||||
#error This visualizer needs that LCD backlight is enabled
|
||||
#endif
|
||||
|
||||
#ifndef LCD_ENABLE
|
||||
#error This visualizer needs that LCD is enabled
|
||||
#endif
|
||||
|
||||
#include "visualizer.h"
|
||||
#include "visualizer_keyframes.h"
|
||||
#include "lcd_keyframes.h"
|
||||
#include "lcd_backlight_keyframes.h"
|
||||
#include "system/serial_link.h"
|
||||
#include "animations.h"
|
||||
|
||||
static const uint32_t logo_background_color = LCD_COLOR(0x00, 0x00, 0xFF);
|
||||
static const uint32_t initial_color = LCD_COLOR(0, 0, 0);
|
||||
|
||||
static const uint32_t led_emulation_colors[4] = {
|
||||
LCD_COLOR(0, 0, 0),
|
||||
LCD_COLOR(255, 255, 255),
|
||||
LCD_COLOR(84, 255, 255),
|
||||
LCD_COLOR(168, 255, 255),
|
||||
};
|
||||
|
||||
static uint32_t next_led_target_color = 0;
|
||||
|
||||
typedef enum {
|
||||
LCD_STATE_INITIAL,
|
||||
LCD_STATE_LAYER_BITMAP,
|
||||
LCD_STATE_BITMAP_AND_LEDS,
|
||||
} lcd_state_t;
|
||||
|
||||
static lcd_state_t lcd_state = LCD_STATE_INITIAL;
|
||||
|
||||
typedef struct {
|
||||
uint8_t led_on;
|
||||
uint8_t led1;
|
||||
uint8_t led2;
|
||||
uint8_t led3;
|
||||
} visualizer_user_data_t;
|
||||
|
||||
// Don't access from visualization function, use the visualizer state instead
|
||||
static visualizer_user_data_t user_data_keyboard = {
|
||||
.led_on = 0,
|
||||
.led1 = LED_BRIGHTNESS_HI,
|
||||
.led2 = LED_BRIGHTNESS_HI,
|
||||
.led3 = LED_BRIGHTNESS_HI,
|
||||
};
|
||||
|
||||
_Static_assert(sizeof(visualizer_user_data_t) <= VISUALIZER_USER_DATA_SIZE,
|
||||
"Please increase the VISUALIZER_USER_DATA_SIZE");
|
||||
|
||||
// Feel free to modify the animations below, or even add new ones if needed
|
||||
|
||||
|
||||
// The color animation animates the LCD color when you change layers
|
||||
static keyframe_animation_t one_led_color = {
|
||||
.num_frames = 1,
|
||||
.loop = false,
|
||||
.frame_lengths = {gfxMillisecondsToTicks(0)},
|
||||
.frame_functions = {backlight_keyframe_set_color},
|
||||
};
|
||||
|
||||
bool swap_led_target_color(keyframe_animation_t* animation, visualizer_state_t* state) {
|
||||
uint32_t temp = next_led_target_color;
|
||||
next_led_target_color = state->target_lcd_color;
|
||||
state->target_lcd_color = temp;
|
||||
return false;
|
||||
}
|
||||
|
||||
// The color animation animates the LCD color when you change layers
|
||||
static keyframe_animation_t two_led_colors = {
|
||||
.num_frames = 2,
|
||||
.loop = true,
|
||||
.frame_lengths = {gfxMillisecondsToTicks(1000), gfxMillisecondsToTicks(0)},
|
||||
.frame_functions = {backlight_keyframe_set_color, swap_led_target_color},
|
||||
};
|
||||
|
||||
// The LCD animation alternates between the layer name display and a
|
||||
// bitmap that displays all active layers
|
||||
static keyframe_animation_t lcd_bitmap_animation = {
|
||||
.num_frames = 1,
|
||||
.loop = false,
|
||||
.frame_lengths = {gfxMillisecondsToTicks(0)},
|
||||
.frame_functions = {lcd_keyframe_display_layer_bitmap},
|
||||
};
|
||||
|
||||
static keyframe_animation_t lcd_bitmap_leds_animation = {
|
||||
.num_frames = 2,
|
||||
.loop = true,
|
||||
.frame_lengths = {gfxMillisecondsToTicks(2000), gfxMillisecondsToTicks(2000)},
|
||||
.frame_functions = {lcd_keyframe_display_layer_bitmap, lcd_keyframe_display_led_states},
|
||||
};
|
||||
|
||||
void initialize_user_visualizer(visualizer_state_t* state) {
|
||||
// The brightness will be dynamically adjustable in the future
|
||||
// But for now, change it here.
|
||||
lcd_backlight_brightness(130);
|
||||
state->current_lcd_color = initial_color;
|
||||
state->target_lcd_color = logo_background_color;
|
||||
lcd_state = LCD_STATE_INITIAL;
|
||||
start_keyframe_animation(&default_startup_animation);
|
||||
}
|
||||
|
||||
inline bool is_led_on(visualizer_user_data_t* user_data, uint8_t num) {
|
||||
return user_data->led_on & (1u << num);
|
||||
}
|
||||
|
||||
static uint8_t get_led_index_master(visualizer_user_data_t* user_data) {
|
||||
for (int i=0; i < 3; i++) {
|
||||
if (is_led_on(user_data, i)) {
|
||||
return i + 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static uint8_t get_led_index_slave(visualizer_user_data_t* user_data) {
|
||||
uint8_t master_index = get_led_index_master(user_data);
|
||||
if (master_index!=0) {
|
||||
for (int i=master_index; i < 3; i++) {
|
||||
if (is_led_on(user_data, i)) {
|
||||
return i + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static uint8_t get_secondary_led_index(visualizer_user_data_t* user_data) {
|
||||
if (is_led_on(user_data, 0) &&
|
||||
is_led_on(user_data, 1) &&
|
||||
is_led_on(user_data, 2)) {
|
||||
return 3;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static uint8_t get_brightness(visualizer_user_data_t* user_data, uint8_t index) {
|
||||
switch (index) {
|
||||
case 1:
|
||||
return user_data->led1;
|
||||
case 2:
|
||||
return user_data->led2;
|
||||
case 3:
|
||||
return user_data->led3;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void update_emulated_leds(visualizer_state_t* state, visualizer_keyboard_status_t* prev_status) {
|
||||
visualizer_user_data_t* user_data_new = (visualizer_user_data_t*)state->status.user_data;
|
||||
visualizer_user_data_t* user_data_old = (visualizer_user_data_t*)prev_status->user_data;
|
||||
|
||||
uint8_t new_index;
|
||||
uint8_t old_index;
|
||||
|
||||
if (is_serial_link_master()) {
|
||||
new_index = get_led_index_master(user_data_new);
|
||||
old_index = get_led_index_master(user_data_old);
|
||||
}
|
||||
else {
|
||||
new_index = get_led_index_slave(user_data_new);
|
||||
old_index = get_led_index_slave(user_data_old);
|
||||
}
|
||||
uint8_t new_secondary_index = get_secondary_led_index(user_data_new);
|
||||
uint8_t old_secondary_index = get_secondary_led_index(user_data_old);
|
||||
|
||||
uint8_t old_brightness = get_brightness(user_data_old, old_index);
|
||||
uint8_t new_brightness = get_brightness(user_data_new, new_index);
|
||||
|
||||
uint8_t old_secondary_brightness = get_brightness(user_data_old, old_secondary_index);
|
||||
uint8_t new_secondary_brightness = get_brightness(user_data_new, new_secondary_index);
|
||||
|
||||
if (lcd_state == LCD_STATE_INITIAL ||
|
||||
new_index != old_index ||
|
||||
new_secondary_index != old_secondary_index ||
|
||||
new_brightness != old_brightness ||
|
||||
new_secondary_brightness != old_secondary_brightness) {
|
||||
|
||||
if (new_secondary_index != 0) {
|
||||
state->target_lcd_color = change_lcd_color_intensity(
|
||||
led_emulation_colors[new_index], new_brightness);
|
||||
next_led_target_color = change_lcd_color_intensity(
|
||||
led_emulation_colors[new_secondary_index], new_secondary_brightness);
|
||||
|
||||
stop_keyframe_animation(&one_led_color);
|
||||
start_keyframe_animation(&two_led_colors);
|
||||
} else {
|
||||
state->target_lcd_color = change_lcd_color_intensity(
|
||||
led_emulation_colors[new_index], new_brightness);
|
||||
stop_keyframe_animation(&two_led_colors);
|
||||
start_keyframe_animation(&one_led_color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void update_lcd_text(visualizer_state_t* state, visualizer_keyboard_status_t* prev_status) {
|
||||
if (state->status.leds) {
|
||||
if (lcd_state != LCD_STATE_BITMAP_AND_LEDS ||
|
||||
state->status.leds != prev_status->leds ||
|
||||
state->status.layer != prev_status->layer ||
|
||||
state->status.default_layer != prev_status->default_layer) {
|
||||
|
||||
// NOTE: that it doesn't matter if the animation isn't playing, stop will do nothing in that case
|
||||
stop_keyframe_animation(&lcd_bitmap_animation);
|
||||
|
||||
lcd_state = LCD_STATE_BITMAP_AND_LEDS;
|
||||
// For information:
|
||||
// The logic in this function makes sure that this doesn't happen, but if you call start on an
|
||||
// animation that is already playing it will be restarted.
|
||||
start_keyframe_animation(&lcd_bitmap_leds_animation);
|
||||
}
|
||||
} else {
|
||||
if (lcd_state != LCD_STATE_LAYER_BITMAP ||
|
||||
state->status.layer != prev_status->layer ||
|
||||
state->status.default_layer != prev_status->default_layer) {
|
||||
|
||||
stop_keyframe_animation(&lcd_bitmap_leds_animation);
|
||||
|
||||
lcd_state = LCD_STATE_LAYER_BITMAP;
|
||||
start_keyframe_animation(&lcd_bitmap_animation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void update_user_visualizer_state(visualizer_state_t* state, visualizer_keyboard_status_t* prev_status) {
|
||||
// Check the status here to start and stop animations
|
||||
// You might have to save some state, like the current animation here so that you can start the right
|
||||
// This function is called every time the status changes
|
||||
|
||||
// NOTE that this is called from the visualizer thread, so don't access anything else outside the status
|
||||
// This is also important because the slave won't have access to the active layer for example outside the
|
||||
// status.
|
||||
|
||||
update_emulated_leds(state, prev_status);
|
||||
update_lcd_text(state, prev_status);
|
||||
|
||||
}
|
||||
|
||||
void user_visualizer_suspend(visualizer_state_t* state) {
|
||||
state->layer_text = "Suspending...";
|
||||
uint8_t hue = LCD_HUE(state->current_lcd_color);
|
||||
uint8_t sat = LCD_SAT(state->current_lcd_color);
|
||||
state->target_lcd_color = LCD_COLOR(hue, sat, 0);
|
||||
start_keyframe_animation(&default_suspend_animation);
|
||||
}
|
||||
|
||||
void user_visualizer_resume(visualizer_state_t* state) {
|
||||
state->current_lcd_color = initial_color;
|
||||
state->target_lcd_color = logo_background_color;
|
||||
lcd_state = LCD_STATE_INITIAL;
|
||||
start_keyframe_animation(&default_startup_animation);
|
||||
}
|
||||
|
||||
void ergodox_board_led_on(void){
|
||||
// No board led support
|
||||
}
|
||||
|
||||
void ergodox_right_led_1_on(void){
|
||||
user_data_keyboard.led_on |= (1u << 0);
|
||||
visualizer_set_user_data(&user_data_keyboard);
|
||||
}
|
||||
|
||||
void ergodox_right_led_2_on(void){
|
||||
user_data_keyboard.led_on |= (1u << 1);
|
||||
visualizer_set_user_data(&user_data_keyboard);
|
||||
}
|
||||
|
||||
void ergodox_right_led_3_on(void){
|
||||
user_data_keyboard.led_on |= (1u << 2);
|
||||
visualizer_set_user_data(&user_data_keyboard);
|
||||
}
|
||||
|
||||
void ergodox_board_led_off(void){
|
||||
// No board led support
|
||||
}
|
||||
|
||||
void ergodox_right_led_1_off(void){
|
||||
user_data_keyboard.led_on &= ~(1u << 0);
|
||||
visualizer_set_user_data(&user_data_keyboard);
|
||||
}
|
||||
|
||||
void ergodox_right_led_2_off(void){
|
||||
user_data_keyboard.led_on &= ~(1u << 1);
|
||||
visualizer_set_user_data(&user_data_keyboard);
|
||||
}
|
||||
|
||||
void ergodox_right_led_3_off(void){
|
||||
user_data_keyboard.led_on &= ~(1u << 2);
|
||||
visualizer_set_user_data(&user_data_keyboard);
|
||||
}
|
||||
|
||||
void ergodox_right_led_1_set(uint8_t n) {
|
||||
user_data_keyboard.led1 = n;
|
||||
visualizer_set_user_data(&user_data_keyboard);
|
||||
}
|
||||
|
||||
void ergodox_right_led_2_set(uint8_t n) {
|
||||
user_data_keyboard.led2 = n;
|
||||
visualizer_set_user_data(&user_data_keyboard);
|
||||
}
|
||||
|
||||
void ergodox_right_led_3_set(uint8_t n) {
|
||||
user_data_keyboard.led3 = n;
|
||||
visualizer_set_user_data(&user_data_keyboard);
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
/*
|
||||
Copyright 2017 Fred Sundvik
|
||||
|
||||
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 "simple_visualizer.h"
|
||||
|
||||
// This function should be implemented by the keymap visualizer
|
||||
// Don't change anything else than state->target_lcd_color and state->layer_text as that's the only thing
|
||||
// that the simple_visualizer assumes that you are updating
|
||||
// Also make sure that the buffer passed to state->layer_text remains valid until the previous animation is
|
||||
// stopped. This can be done by either double buffering it or by using constant strings
|
||||
static void get_visualizer_layer_and_color(visualizer_state_t* state) {
|
||||
uint8_t saturation = 60;
|
||||
if (state->status.leds & (1u << USB_LED_CAPS_LOCK)) {
|
||||
saturation = 255;
|
||||
}
|
||||
if (state->status.layer & 0x4) {
|
||||
state->target_lcd_color = LCD_COLOR(0, saturation, 0xFF);
|
||||
state->layer_text = "Media & Mouse";
|
||||
}
|
||||
else if (state->status.layer & 0x2) {
|
||||
state->target_lcd_color = LCD_COLOR(168, saturation, 0xFF);
|
||||
state->layer_text = "Symbol";
|
||||
}
|
||||
else {
|
||||
state->target_lcd_color = LCD_COLOR(84, saturation, 0xFF);
|
||||
state->layer_text = "Default";
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
# ErgoDox Familiar Layout
|
||||
Familiar layout for those who regularly switch back and forth from ErgoDox to regular QWERTY.
|
||||
|
||||
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](../../../../license_GPLv3.md../../../../license_GPLv3.md) [![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg)](https://github.com/RichardLitt/standard-readme)
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Background](#background)
|
||||
- [Install](#install)
|
||||
- [Usage](#usage)
|
||||
- [Layers](#layers)
|
||||
- [Contribute](#contribute)
|
||||
- [Issues](#issues)
|
||||
- [License](#license)
|
||||
|
||||
## Background
|
||||
|
||||
This layout is built to be as familiar as possible for users coming directly from a default (QWERTY US) keyboard, while gaining as much advantage as possible from the ErgoDox and QMK featureset. I use an ErgoDoxEZ at home, but I don't have a regular office (CS grad student) so I regularly use either my laptop or a default-setup lab computer; I context switch daily so this layout is meant to reduce the mental overhead as much as possible.
|
||||
|
||||
The default ErgoDoxEZ layout is probably more optimized as a solo daily driver - as are a lot of the others available keymaps. The focus of this layout is to get as much from the 'Dox as possible without overly disrupting long-established muscle memory.
|
||||
|
||||
Key features of the familiar layout:
|
||||
1. QWERTY default layout.
|
||||
1. International symbols layer, mapped in the US-International layout default positions, through [UCIS](https://github.com/qmk/qmk_firmware/wiki/Unicode-and-additional-language-support#ucis_enable).
|
||||
1. Numpad layer on right hand.
|
||||
1. Thumb cluster holds spacebar, ALT, and access to secondary layers.
|
||||
1. Function-layer arrow keys in both the first-person-shooter (actually ESDF instead of WASD) and vim (HJKL) locations.
|
||||
|
||||
## Install
|
||||
|
||||
If you are on Windows or Mac, choose the proper line in [`keymap.c`](keymap.c) for [unicode/international character support](https://github.com/qmk/qmk_firmware/wiki/Unicode-and-additional-language-support#ucis_enable) (starts at line 235).
|
||||
```c
|
||||
void matrix_init_user(void) {
|
||||
set_unicode_input_mode(UC_LNX); // Linux
|
||||
//set_unicode_input_mode(UC_OSX); // Mac OSX
|
||||
//set_unicode_input_mode(UC_WIN); // Windows (with registry key, see wiki)
|
||||
//set_unicode_input_mode(UC_WINC); // Windows (with WinCompose, see wiki)
|
||||
};
|
||||
```
|
||||
|
||||
For instructions on building and installing this keymap, [go to the wiki](https://github.com/qmk/qmk_firmware/tree/master/keyboards/ergodox#build-dependencies). Below is the command for me; it may be different for you.
|
||||
```sh
|
||||
$ make ergodox-ez-familiar-teensy
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
[![Familiar Layout](familiar.png)](http://www.keyboard-layout-editor.com/#/gists/13508a9f99cff381d58b7be6f7dcc644)
|
||||
|
||||
### Layers
|
||||
1. Base Layer: QWERTY, with arrow keys at bottom right.
|
||||
1. UCIS Layer: US-International symbols layer, plus —. Accessed by toggling the `INTL` layer using the UCIS key (bottom of left thumb cluster).
|
||||
1. UCIS-Shifted Layer: Making shift work for UCIS characters. An ugly workaround. Any ideas? Accessed through holding shift while the UCIS layer is active (toggles the `INSF` layer).
|
||||
1. Numpad Layer: Right hand number pad. Accessed by toggling the `NUMP` layer using the NPAD key (bottom of right thumb cluster).
|
||||
1. Function Layer: F1-F12, arrows on ESDF and HJKL, media player controls. Accessed by holding either FN key (center key of each thumb cluster), which toggles the `ARRW` layer. I know, I need to work on my naming conventions.
|
||||
|
||||
## Contribute
|
||||
|
||||
[Contributor Covenant](http://contributor-covenant.org/)
|
||||
|
||||
I'm terrible at this; I have no background in human-computer interaction, kinesiology, or keyboard-ology. Please send comments/issues/pull requests/angry tweets/etc. If you think there is a better way to take advantage of the ErgoDox/QMK comination without straying far from 84/101-key QWERTY, I want to know it.
|
||||
|
||||
### Issues
|
||||
1. The top two keys of the right thumb cluster are currently unused. I wanted them for screen brightness, but I haven't found a solution I like.
|
||||
1. The `'`, `"`, `[`, and `]` keys are terrible to access; I want to put them somewhere else but I haven't figured out where.
|
||||
1. The `INSF` layer is an ugly workaround. I should write a function for doing different things in the `INTL` layer depending on whether SHIFT is being held. Or something. Ideas?
|
||||
|
||||
## License
|
||||
QMK is licensed ([mostly](https://github.com/qmk/qmk_firmware/issues/1038)) under the [GPLv2](blob/master/license_GPLv2.md). Accordingly, to whatever extent applicable, this keymap is licensed under the [GPLv3](../../../../license_GPLv3.md).
|
After Width: | Height: | Size: 146 KiB |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 252 KiB |
After Width: | Height: | Size: 1.4 MiB |
@ -0,0 +1,187 @@
|
||||
// Netable differences vs. the default firmware for the ErgoDox EZ:
|
||||
// 1. The Cmd key is now on the right side, making Cmd+Space easier.
|
||||
// 2. The media keys work on OSX (But not on Windows).
|
||||
#include "ergodox.h"
|
||||
#include "debug.h"
|
||||
#include "action_layer.h"
|
||||
|
||||
#define BASE 0 // default layer
|
||||
#define SYMB 1 // symbols
|
||||
#define MDIA 2 // media keys
|
||||
|
||||
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 | - |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | Tab | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | LCtl | A | S | D | F | G |------| |------| H | J | K | L |; / L2| LGui |
|
||||
* |--------+------+------+------+------+------| BkSp | | Meh |------+------+------+------+------+--------|
|
||||
* | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,---------------.
|
||||
* | BkSp | LGui | | Alt |Ctrl/Esc|
|
||||
* ,------|------|------| |------+--------+------.
|
||||
* | | | Home | | PgUp | | |
|
||||
* | Space|LANG1 |------| |------|LANG2 |Enter |
|
||||
* | /LGui| | 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_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB),
|
||||
KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G,
|
||||
KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_BSPC,
|
||||
LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT,
|
||||
KC_BSPC, KC_LGUI,
|
||||
KC_HOME,
|
||||
MT(MOD_LGUI, KC_SPC),KC_LANG1,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_BSLS,
|
||||
KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_LGUI,
|
||||
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,
|
||||
KC_LALT, CTL_T(KC_ESC),
|
||||
KC_PGUP,
|
||||
KC_PGDN,KC_LANG2, 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, KC_AMPR, 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
|
||||
),
|
||||
/* 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) {
|
||||
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);
|
||||
|
||||
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,15 @@
|
||||
# ErgoDox EZ Default Configuration
|
||||
|
||||
## Changelog
|
||||
|
||||
* Dec 2016:
|
||||
* Added LED keys
|
||||
* Refreshed layout graphic, comes from http://configure.ergodox-ez.com now.
|
||||
* Sep 22, 2016:
|
||||
* Created a new key in layer 1 (bottom-corner key) that resets the EEPROM.
|
||||
* Feb 2, 2016 (V1.1):
|
||||
* Made the right-hand quote key double as Cmd/Win on hold. So you get ' when you tap it, " when you tap it with Shift, and Cmd or Win when you hold it. You can then use it as a modifier, or just press and hold it for a moment (and then let go) to send a single Cmd or Win keystroke (handy for opening the Start menu on Windows).
|
||||
|
||||
This is what we ship with out of the factory. :) The image says it all:
|
||||
|
||||
![Default](default_firmware_v1.2-2.png)
|
@ -1 +0,0 @@
|
||||
#include "MS-sculpt-mobile.h"
|
@ -0,0 +1 @@
|
||||
#include "MS_sculpt_mobile.h"
|
@ -0,0 +1,8 @@
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "../../../MS_sculpt_mobile/config.h"
|
||||
|
||||
// place overrides here
|
||||
|
||||
#endif
|
@ -1,4 +1,4 @@
|
||||
#include "MS-sculpt-mobile.h"
|
||||
#include "../../MS_sculpt_mobile.h"
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/*
|
@ -1,7 +1,7 @@
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "../../config.h"
|
||||
#include "../../../MS_sculpt_mobile/config.h"
|
||||
|
||||
#define USE_BABLPASTE
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "MS-sculpt-mobile.h"
|
||||
#include "../../../MS_sculpt_mobile/babblePaste.h"
|
||||
#include "../../MS_sculpt_mobile.h"
|
||||
#include "action_layer.h"
|
||||
#include "action_util.h"
|
||||
#include "babblePaste.h"
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
#include "audio.h"
|
@ -0,0 +1,15 @@
|
||||
#define COLOR_BLANK 0, 0, 0
|
||||
|
||||
#define COLOR_BLACK 0, 0, 0
|
||||
#define COLOR_WHITE 15,15,15
|
||||
#define COLOR_GRAY 7, 7, 7
|
||||
|
||||
#define COLOR_RED 15, 0, 0
|
||||
#define COLOR_GREEN 0,15, 0
|
||||
#define COLOR_BLUE 0, 0,15
|
||||
|
||||
#define COLOR_YELLOW 15,15, 0
|
||||
#define COLOR_MAGENTA 15, 0,15
|
||||
#define COLOR_CYAN 0,15,15
|
||||
|
||||
#define COLOR_ORANGE 15, 5, 0
|
@ -0,0 +1 @@
|
||||
#include "rgbtheme_default.h"
|
@ -0,0 +1,36 @@
|
||||
#include "color.h"
|
||||
|
||||
#define THEME_COLOR_LINUX COLOR_WHITE
|
||||
#define THEME_COLOR_APPLE COLOR_WHITE
|
||||
#define THEME_COLOR_WINDOWS COLOR_WHITE
|
||||
|
||||
#define THEME_COLOR_QWERTY COLOR_RED
|
||||
#define THEME_COLOR_ALT COLOR_RED
|
||||
|
||||
#define THEME_COLOR_AUDIO COLOR_GREEN
|
||||
|
||||
#define THEME_COLOR_BLUETOOTH 7,7,15
|
||||
#define THEME_COLOR_USB COLOR_WHITE
|
||||
|
||||
#define THEME_COLOR_CAPSLOCK COLOR_RED
|
||||
|
||||
#define THEME_COLOR_GUI COLOR_MAGENTA
|
||||
#define THEME_COLOR_FUN COLOR_RED
|
||||
#define THEME_COLOR_NUM 7,7,15
|
||||
#define THEME_COLOR_PUNC COLOR_GREEN
|
||||
#define THEME_COLOR_GREEK COLOR_CYAN
|
||||
#define THEME_COLOR_EMOJI COLOR_YELLOW
|
||||
#define THEME_COLOR_OTHERLAYER COLOR_GRAY
|
||||
|
||||
#define THEME_COLOR_GLOW1_HOME COLOR_ORANGE
|
||||
#define THEME_COLOR_GLOW1_HOMING COLOR_RED
|
||||
|
||||
#define THEME_COLOR_GLOW2_ALPHA COLOR_ORANGE
|
||||
#define THEME_COLOR_GLOW2_MODS COLOR_ORANGE
|
||||
#define THEME_COLOR_GLOW2_FN COLOR_ORANGE
|
||||
#define THEME_COLOR_GLOW2_HOME COLOR_ORANGE
|
||||
#define THEME_COLOR_GLOW2_HOMING COLOR_RED
|
||||
|
||||
#define THEME_COLOR_TP1 COLOR_ORANGE
|
||||
#define THEME_COLOR_TP2 COLOR_RED
|
||||
#define THEME_COLOR_TP3 COLOR_ORANGE
|
@ -0,0 +1,36 @@
|
||||
#include "color.h"
|
||||
|
||||
#define THEME_COLOR_LINUX COLOR_WHITE
|
||||
#define THEME_COLOR_APPLE COLOR_WHITE
|
||||
#define THEME_COLOR_WINDOWS COLOR_WHITE
|
||||
|
||||
#define THEME_COLOR_QWERTY COLOR_RED
|
||||
#define THEME_COLOR_ALT COLOR_RED
|
||||
|
||||
#define THEME_COLOR_AUDIO COLOR_GREEN
|
||||
|
||||
#define THEME_COLOR_BLUETOOTH COLOR_BLUE
|
||||
#define THEME_COLOR_USB COLOR_WHITE
|
||||
|
||||
#define THEME_COLOR_CAPSLOCK COLOR_RED
|
||||
|
||||
#define THEME_COLOR_GUI COLOR_MAGENTA
|
||||
#define THEME_COLOR_FUN COLOR_RED
|
||||
#define THEME_COLOR_NUM COLOR_BLUE
|
||||
#define THEME_COLOR_PUNC COLOR_GREEN
|
||||
#define THEME_COLOR_GREEK COLOR_CYAN
|
||||
#define THEME_COLOR_EMOJI COLOR_YELLOW
|
||||
#define THEME_COLOR_OTHERLAYER COLOR_GRAY
|
||||
|
||||
#define THEME_COLOR_GLOW1_HOME COLOR_GRAY
|
||||
#define THEME_COLOR_GLOW1_HOMING COLOR_RED
|
||||
|
||||
#define THEME_COLOR_GLOW2_ALPHA COLOR_GRAY
|
||||
#define THEME_COLOR_GLOW2_MODS COLOR_GREEN
|
||||
#define THEME_COLOR_GLOW2_FN COLOR_BLUE
|
||||
#define THEME_COLOR_GLOW2_HOME COLOR_RED
|
||||
#define THEME_COLOR_GLOW2_HOMING COLOR_YELLOW
|
||||
|
||||
#define THEME_COLOR_TP1 COLOR_RED
|
||||
#define THEME_COLOR_TP2 COLOR_BLUE
|
||||
#define THEME_COLOR_TP3 COLOR_RED
|
@ -0,0 +1,306 @@
|
||||
/*
|
||||
Copyright 2012 Jun Wako
|
||||
Copyright 2014 Jack Humbert
|
||||
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 <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#if defined(__AVR__)
|
||||
#include <avr/io.h>
|
||||
#endif
|
||||
#include "wait.h"
|
||||
#include "print.h"
|
||||
#include "debug.h"
|
||||
#include "util.h"
|
||||
#include "matrix.h"
|
||||
#include "timer.h"
|
||||
|
||||
|
||||
/* Set 0 if debouncing isn't needed */
|
||||
|
||||
#ifndef DEBOUNCING_DELAY
|
||||
# define DEBOUNCING_DELAY 5
|
||||
#endif
|
||||
|
||||
#if (DEBOUNCING_DELAY > 0)
|
||||
static uint16_t debouncing_time;
|
||||
static bool debouncing = false;
|
||||
#endif
|
||||
|
||||
#if (MATRIX_COLS <= 8)
|
||||
# define print_matrix_header() print("\nr/c 01234567\n")
|
||||
# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
|
||||
# define matrix_bitpop(i) bitpop(matrix[i])
|
||||
# define ROW_SHIFTER ((uint8_t)1)
|
||||
#elif (MATRIX_COLS <= 16)
|
||||
# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
|
||||
# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
|
||||
# define matrix_bitpop(i) bitpop16(matrix[i])
|
||||
# define ROW_SHIFTER ((uint16_t)1)
|
||||
#elif (MATRIX_COLS <= 32)
|
||||
# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
|
||||
# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
|
||||
# define matrix_bitpop(i) bitpop32(matrix[i])
|
||||
# define ROW_SHIFTER ((uint32_t)1)
|
||||
#endif
|
||||
|
||||
#ifdef MATRIX_MASKED
|
||||
extern const matrix_row_t matrix_mask[];
|
||||
#endif
|
||||
|
||||
static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
|
||||
static const uint8_t tp_pins[3] = TRACKPOINT_PINS;
|
||||
|
||||
/* matrix state(1:on, 0:off) */
|
||||
static matrix_row_t matrix[MATRIX_ROWS];
|
||||
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
||||
|
||||
static void init_cols(void);
|
||||
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row);
|
||||
static void unselect_rows(void);
|
||||
static void select_row(uint8_t row);
|
||||
static void unselect_row(uint8_t row);
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_quantum(void) {
|
||||
matrix_init_kb();
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_quantum(void) {
|
||||
matrix_scan_kb();
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_kb(void) {
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_kb(void) {
|
||||
matrix_scan_user();
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_user(void) {
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_user(void) {
|
||||
}
|
||||
|
||||
inline
|
||||
uint8_t matrix_rows(void) {
|
||||
return MATRIX_ROWS;
|
||||
}
|
||||
|
||||
inline
|
||||
uint8_t matrix_cols(void) {
|
||||
return MATRIX_COLS;
|
||||
}
|
||||
|
||||
void matrix_init(void) {
|
||||
|
||||
// To use PORTF disable JTAG with writing JTD bit twice within four cycles.
|
||||
#if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega32U4__))
|
||||
MCUCR |= _BV(JTD);
|
||||
MCUCR |= _BV(JTD);
|
||||
#endif
|
||||
|
||||
// initialize row and col
|
||||
unselect_rows();
|
||||
init_cols();
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||
matrix[i] = 0;
|
||||
matrix_debouncing[i] = 0;
|
||||
}
|
||||
|
||||
matrix_init_quantum();
|
||||
}
|
||||
|
||||
uint8_t matrix_scan(void)
|
||||
{
|
||||
// Set row, read cols
|
||||
for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
|
||||
# if (DEBOUNCING_DELAY > 0)
|
||||
bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row);
|
||||
|
||||
if (matrix_changed) {
|
||||
debouncing = true;
|
||||
debouncing_time = timer_read();
|
||||
}
|
||||
|
||||
# else
|
||||
read_cols_on_row(matrix, current_row);
|
||||
# endif
|
||||
|
||||
}
|
||||
|
||||
# if (DEBOUNCING_DELAY > 0)
|
||||
if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) {
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
matrix[i] = matrix_debouncing[i];
|
||||
}
|
||||
debouncing = false;
|
||||
}
|
||||
# endif
|
||||
|
||||
matrix_scan_quantum();
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool matrix_is_modified(void)
|
||||
{
|
||||
#if (DEBOUNCING_DELAY > 0)
|
||||
if (debouncing) return false;
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
inline
|
||||
bool matrix_is_on(uint8_t row, uint8_t col)
|
||||
|
||||
{
|
||||
return (matrix[row] & ((matrix_row_t)1<col));
|
||||
}
|
||||
|
||||
inline
|
||||
matrix_row_t matrix_get_row(uint8_t row)
|
||||
{
|
||||
// Matrix mask lets you disable switches in the returned matrix data. For example, if you have a
|
||||
// switch blocker installed and the switch is always pressed.
|
||||
#ifdef MATRIX_MASKED
|
||||
return matrix[row] & matrix_mask[row];
|
||||
#else
|
||||
return matrix[row];
|
||||
#endif
|
||||
}
|
||||
|
||||
void matrix_print(void)
|
||||
{
|
||||
print_matrix_header();
|
||||
|
||||
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||
phex(row); print(": ");
|
||||
print_matrix_row(row);
|
||||
print("\n");
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t matrix_key_count(void)
|
||||
{
|
||||
uint8_t count = 0;
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
count += matrix_bitpop(i);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
#define ROW_MASK 0b11100000
|
||||
|
||||
static const uint8_t row_bit[MATRIX_ROWS] = {
|
||||
// 76543210
|
||||
0b00000000,
|
||||
0b00100000,
|
||||
0b01000000,
|
||||
0b01100000,
|
||||
0b10000000,
|
||||
0b10100000,
|
||||
0b11000000,
|
||||
0b11100000,
|
||||
};
|
||||
|
||||
static void init_cols(void)
|
||||
{
|
||||
// columns
|
||||
for(uint8_t x = 0; x < MATRIX_COLS; x++) {
|
||||
uint8_t pin = col_pins[x];
|
||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||
}
|
||||
|
||||
// rows
|
||||
DDRF |= ROW_MASK;
|
||||
PORTF &= ~ROW_MASK;
|
||||
|
||||
// trackpoint
|
||||
for(uint8_t x = 0; x < 3; x++) {
|
||||
uint8_t pin = tp_pins[x];
|
||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||
}
|
||||
}
|
||||
|
||||
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
|
||||
{
|
||||
// Store last value of row prior to reading
|
||||
matrix_row_t last_row_value = current_matrix[current_row];
|
||||
|
||||
// Clear data in matrix row
|
||||
current_matrix[current_row] = 0;
|
||||
|
||||
// special case for trackpoint
|
||||
if (current_row == 8) {
|
||||
for(uint8_t tp_index = 0; tp_index < 3; tp_index++) {
|
||||
|
||||
// Select the TP pin to read (active low)
|
||||
uint8_t pin = tp_pins[tp_index];
|
||||
uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF));
|
||||
|
||||
// Populate the matrix row with the state of the col pin
|
||||
current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << tp_index);
|
||||
}
|
||||
return (last_row_value != current_matrix[current_row]);
|
||||
}
|
||||
|
||||
// Select row and wait for row selecton to stabilize
|
||||
select_row(current_row);
|
||||
_delay_us(5); // without this wait it won't read stable value.
|
||||
// wait_us(50);
|
||||
|
||||
// For each col...
|
||||
for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
|
||||
|
||||
// Select the col pin to read (active low)
|
||||
uint8_t pin = col_pins[col_index];
|
||||
uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF));
|
||||
|
||||
// Populate the matrix row with the state of the col pin
|
||||
current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index);
|
||||
}
|
||||
|
||||
// Unselect row
|
||||
unselect_row(current_row);
|
||||
|
||||
return (last_row_value != current_matrix[current_row]);
|
||||
}
|
||||
|
||||
static void select_row(uint8_t row)
|
||||
{
|
||||
PORTF = row_bit[row] | (PORTF & ~ROW_MASK);
|
||||
}
|
||||
|
||||
static void unselect_row(uint8_t row)
|
||||
{
|
||||
}
|
||||
|
||||
static void unselect_rows(void)
|
||||
{
|
||||
}
|
||||
|
@ -0,0 +1,23 @@
|
||||
# cinaeco's HHKB firmware
|
||||
|
||||
# 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 = 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,23 @@
|
||||
# QMK Keyboard Firmware for HHKB
|
||||
|
||||
## Modifications
|
||||
|
||||
### HHKB Fn Layer
|
||||
|
||||
Added some Media keys.
|
||||
|
||||
### Utility Layer (SpaceFN)
|
||||
|
||||
Hold `Space` for:
|
||||
|
||||
- Vi-style direction keys.
|
||||
- WASD-style mouse keys.
|
||||
- Dynamic macro playback on `1` and `2`.
|
||||
- Qwerty/Colemak/Dvorak layout selection on `-`, `=` and `\ `
|
||||
|
||||
### Dynamic Macros
|
||||
|
||||
Hold `q` and press:
|
||||
|
||||
- `1` or `2` to record macro 1 or 2.
|
||||
- `s` to stop recording.
|
@ -0,0 +1,20 @@
|
||||
#ifndef CONFIG_CINAECO_H
|
||||
#define CONFIG_CINAECO_H
|
||||
|
||||
#include "../../config.h"
|
||||
|
||||
#undef MANUFACTURER
|
||||
#undef PRODUCT
|
||||
#undef DESCRIPTION
|
||||
#define MANUFACTURER QMK
|
||||
#define PRODUCT HHKB QMK cinaeco
|
||||
#define DESCRIPTION HHKB on QMK Firmware with cinaeco keymap
|
||||
|
||||
// Increase "Tap" detection window. Avoid missing 'q' or 'z' when typing slowly.
|
||||
#undef TAPPING_TERM
|
||||
#define TAPPING_TERM 230
|
||||
|
||||
// Uncomment to enable NKRO by default. May cause issues with KVM switches.
|
||||
//#define FORCE_NKRO
|
||||
|
||||
#endif
|
@ -0,0 +1,186 @@
|
||||
/* -*- eval: (turn-on-orgtbl); -*-
|
||||
* cinaeco's HHKB Layout
|
||||
*/
|
||||
#include "hhkb.h"
|
||||
|
||||
// Layers.
|
||||
#define QWER 0
|
||||
#define COLE 1
|
||||
#define DVOR 2
|
||||
#define HHKB 3
|
||||
#define UTIL 4
|
||||
#define MREC 5
|
||||
|
||||
// Easier-to-read Layer Arrays.
|
||||
#define ____ KC_TRNS
|
||||
|
||||
enum hhkb_keycodes {
|
||||
DYNAMIC_MACRO_RANGE = SAFE_RANGE,
|
||||
};
|
||||
|
||||
#include "dynamic_macro.h"
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
|
||||
/* QWER Layer: Qwerty Default
|
||||
*
|
||||
* ,--------------------------------------------------------------.
|
||||
* |Esc| 1 | 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `|
|
||||
* |--------------------------------------------------------------|
|
||||
* |Tab |Q/MREC| W| E| R| T| Y| U| I| O| P| [| ]|Backs|
|
||||
* |--------------------------------------------------------------|
|
||||
* |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Ent/Ctrl|
|
||||
* |--------------------------------------------------------------|
|
||||
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn0|
|
||||
* `--------------------------------------------------------------'
|
||||
* |Alt|Gui | Space/UTIL |Gui |Alt|
|
||||
* `-------------------------------------------'
|
||||
*
|
||||
*/
|
||||
|
||||
[QWER] = 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_TAB, LT(MREC, 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, CTL_T(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(HHKB), \
|
||||
KC_LALT, KC_LGUI, LT(UTIL, KC_SPC), KC_RGUI, KC_RALT),
|
||||
|
||||
|
||||
/* COLE Layer: Colemak
|
||||
*
|
||||
* ,--------------------------------------------------------------.
|
||||
* |Esc| 1 | 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `|
|
||||
* |--------------------------------------------------------------|
|
||||
* |Tab |Q/MREC| W| F| P| G| J| L| U| Y| ;| [| ]|Backs|
|
||||
* |--------------------------------------------------------------|
|
||||
* |Ctrl | A| R| S| T| D| H| N| E| I| O| '|Ent/Ctrl|
|
||||
* |--------------------------------------------------------------|
|
||||
* |Shift | Z| X| C| V| K| B| M| ,| .| /|Shift |Fn0|
|
||||
* `--------------------------------------------------------------'
|
||||
* |Alt|Gui | Space/UTIL |Gui |Alt|
|
||||
* `-------------------------------------------'
|
||||
*
|
||||
*/
|
||||
|
||||
[COLE] = 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_TAB, LT(MREC, KC_Q), KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSPC, \
|
||||
KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, CTL_T(KC_ENT), \
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_K, KC_B, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(HHKB), \
|
||||
KC_LALT, KC_LGUI, LT(UTIL, KC_SPC), KC_RGUI, KC_RALT),
|
||||
|
||||
|
||||
/* DVOR Layer: Dvorak
|
||||
*
|
||||
* ,--------------------------------------------------------------.
|
||||
* |Esc| 1 | 2| 3| 4| 5| 6| 7| 8| 9| 0| [| ]| \| `|
|
||||
* |--------------------------------------------------------------|
|
||||
* |Tab |'/MREC| ,| .| P| Y| F| G| C| R| L| /| =|Backs|
|
||||
* |--------------------------------------------------------------|
|
||||
* |Ctrl | A| O| E| U| I| D| H| T| N| S| -|Ent/Ctrl|
|
||||
* |--------------------------------------------------------------|
|
||||
* |Shift | ;| Q| J| K| X| B| M| W| V| Z|Shift |Fn0|
|
||||
* `--------------------------------------------------------------'
|
||||
* |Alt|Gui | Space/UTIL |Gui |Alt|
|
||||
* `-------------------------------------------'
|
||||
*
|
||||
*/
|
||||
|
||||
[DVOR] = KEYMAP(
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSLS, KC_GRV, \
|
||||
KC_TAB, LT(MREC, KC_QUOT), KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSPC, \
|
||||
KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, CTL_T(KC_ENT), \
|
||||
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, MO(HHKB), \
|
||||
KC_LALT, KC_LGUI, LT(UTIL, KC_SPC), KC_RGUI, KC_RALT),
|
||||
|
||||
|
||||
/* HHKB Layer: HHKB mode (HHKB Fn)
|
||||
*
|
||||
* ,-----------------------------------------------------------.
|
||||
* |Pwr| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
|
||||
* |-----------------------------------------------------------|
|
||||
* |Caps |PLA|PRV|NXT| | | | |Psc|Slk|Pus|Up | |Backs|
|
||||
* |-----------------------------------------------------------|
|
||||
* | |VoD|VoU|Mut|Ejc| | *| /|Hom|PgU|Lef|Rig|Enter |
|
||||
* |-----------------------------------------------------------|
|
||||
* | | | | | | | +| -|End|PgD|Dow| | |
|
||||
* `-----------------------------------------------------------'
|
||||
* | | | |STOP | |
|
||||
* `-------------------------------------------'
|
||||
*/
|
||||
|
||||
[HHKB] = KEYMAP(
|
||||
KC_PWR, 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_MPLY, KC_MPRV, KC_MNXT, ____, ____, ____, ____, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, ____, KC_BSPC, \
|
||||
____, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, ____, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \
|
||||
____, ____, ____, ____, ____, ____, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, ____, ____, \
|
||||
____, ____, ____, KC_MSTP, ____),
|
||||
|
||||
|
||||
/* UTIL Layer: Extra utilities
|
||||
*
|
||||
* ,-------------------------------------------------------------.
|
||||
* |DFU|PLY1|PLY2| | | | | | | | |QWE|COL|DVO|DBG|
|
||||
* |-------------------------------------------------------------|
|
||||
* | |MLB |M-Up|MRB|MwU| |Hom|PgD|PgU|End| | | | |
|
||||
* |-------------------------------------------------------------|
|
||||
* | |M-Lt|M-Dn|M-R|MwD| |LEF|DOW|UP |RIG| | | |
|
||||
* |-------------------------------------------------------------|
|
||||
* | | | | | |SPC| | | | | | | |
|
||||
* `-------------------------------------------------------------'
|
||||
* | | | | | |
|
||||
* `-------------------------------------------'
|
||||
*
|
||||
*/
|
||||
|
||||
[UTIL] = KEYMAP(
|
||||
RESET, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, ____, ____, ____, ____, ____, ____, ____, ____, DF(QWER), DF(COLE), DF(DVOR), DEBUG, \
|
||||
____, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, ____, KC_HOME, KC_PGDN, KC_PGUP, KC_END, ____, ____, ____, ____, \
|
||||
____, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, ____, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, ____, ____, ____, \
|
||||
____, ____, ____, ____, ____, KC_SPC, ____, ____, ____, ____, ____, ____, ____, \
|
||||
____, ____, ____, ____, ____),
|
||||
|
||||
|
||||
/* MREC Layer: Record macros with `q`
|
||||
*
|
||||
* ,-------------------------------------------------------------.
|
||||
* | |REC1|REC2| | | | | | | | | | | | |
|
||||
* |-------------------------------------------------------------|
|
||||
* | | | | | | | | | | | | | | |
|
||||
* |-------------------------------------------------------------|
|
||||
* | | |RSTP| | | | | | | | | | |
|
||||
* |-------------------------------------------------------------|
|
||||
* | | | | | | | | | | | | | |
|
||||
* `-------------------------------------------------------------'
|
||||
* | | | | | |
|
||||
* `-------------------------------------------'
|
||||
*
|
||||
*/
|
||||
|
||||
[MREC] = KEYMAP(
|
||||
____, DYN_REC_START1, DYN_REC_START2, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \
|
||||
____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \
|
||||
____, ____, DYN_REC_STOP, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \
|
||||
____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \
|
||||
____, ____, ____, ____, ____)
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
// For Dynamic Macros.
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_dynamic_macro(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
@ -0,0 +1,176 @@
|
||||
/* -*- eval: (turn-on-orgtbl); -*-
|
||||
* default HHKB Layout
|
||||
*/
|
||||
#include "hhkb.h"
|
||||
|
||||
#define _QWERTY 0
|
||||
#define _COLEMAK 1
|
||||
#define _DVORAK 2
|
||||
#define _HHKB 3
|
||||
|
||||
enum planck_keycodes {
|
||||
QWERTY = SAFE_RANGE,
|
||||
COLEMAK,
|
||||
DVORAK,
|
||||
HHKB
|
||||
};
|
||||
|
||||
// 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 (Super+Ctrl+Alt+Shift)
|
||||
#define MEH_GRV MEH_T(KC_GRV) // Tap for Backtick, hold for Meh (Ctrl+Alt+Shift)
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* Layer QWERTY: Qwerty Layer
|
||||
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
|
||||
| Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |
|
||||
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
|
||||
| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Backs | |
|
||||
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
|
||||
| Cont | A | S | D | F | G | H | J | K | L | ; | ' | Ent | | |
|
||||
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
|
||||
| Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Fn | | |
|
||||
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
|
||||
|
||||
|------+------+-----------------------+------+------|
|
||||
| LAlt | LGUI | ******* Space ******* | RGUI | RAlt |
|
||||
|------+------+-----------------------+------+------|
|
||||
*/
|
||||
|
||||
[_QWERTY] = KEYMAP( // Qwerty layer
|
||||
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, MEH_GRV, \
|
||||
HPR_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, \
|
||||
CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, SFT_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(_HHKB), \
|
||||
KC_LALT, KC_LGUI, /* */ KC_SPC, KC_RGUI, KC_RALT),
|
||||
|
||||
|
||||
|
||||
/* Layer COLEMAK: Colemak Layer
|
||||
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
|
||||
| Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |
|
||||
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
|
||||
| Tab | Q | W | F | P | G | J | L | U | Y | ; | [ | ] | Backs | |
|
||||
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
|
||||
| Cont | A | R | S | T | D | H | N | E | I | O | ' | Ent | | |
|
||||
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
|
||||
| Shift | Z | X | C | V | B | K | M | , | . | / | Shift | Fn | | |
|
||||
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
|
||||
|
||||
|------+------+-----------------------+------+------|
|
||||
| LAlt | LGUI | ******* Space ******* | RGUI | RAlt |
|
||||
|------+------+-----------------------+------+------|
|
||||
*/
|
||||
|
||||
[_COLEMAK] = KEYMAP( // Colemak layer
|
||||
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, MEH_GRV, \
|
||||
HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, 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, SFT_ENT, \
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_HHKB), \
|
||||
KC_LALT, KC_LGUI, /* */ KC_SPC, KC_RGUI, KC_RALT),
|
||||
|
||||
|
||||
|
||||
/* Layer DVORAK: Dvorak Layer
|
||||
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
|
||||
| Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | [ | ] | \ | ` |
|
||||
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
|
||||
| Tab | ' | , | . | P | Y | F | G | C | R | L | / | = | Backs | |
|
||||
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
|
||||
| Cont | A | O | E | U | I | D | H | T | N | S | - | Ent | | |
|
||||
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
|
||||
| Shift | ; | Q | J | K | X | B | M | W | V | Z | Shift | Fn | | |
|
||||
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
|
||||
|
||||
|------+------+-----------------------+------+------|
|
||||
| LAlt | LGUI | ******* Space ******* | RGUI | RAlt |
|
||||
|------+------+-----------------------+------+------|
|
||||
*/
|
||||
|
||||
[_DVORAK] = KEYMAP( // Dvorak layer
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSLS, MEH_GRV, \
|
||||
HPR_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, 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, SFT_ENT, \
|
||||
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, MO(_HHKB), \
|
||||
KC_LALT, KC_LGUI, /* */ KC_SPC, KC_RGUI, KC_RALT),
|
||||
|
||||
|
||||
|
||||
/* Layer HHKB: HHKB mode (HHKB Fn)
|
||||
|------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-------+-------+-----|
|
||||
| Pwr | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del |
|
||||
|------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-------+-------+-----|
|
||||
| Caps | | | | | | | | Psc | Slk | Pus | Up | | Backs | |
|
||||
|------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-------+-------+-----|
|
||||
| | VoD | VoU | Mut | | | * | / | Hom | PgU | Lef | Rig | Enter | | |
|
||||
|------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-------+-------+-----|
|
||||
| | | Qwt | Cmk | Dvk | | + | - | End | PgD | Dow | | | | |
|
||||
|------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-------+-------+-----|
|
||||
|
||||
|------+------+----------------------+------+------+
|
||||
| **** | **** | ******************** | **** | **** |
|
||||
|------+------+----------------------+------+------+
|
||||
|
||||
*/
|
||||
|
||||
[_HHKB] = KEYMAP(
|
||||
KC_PWR, 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_BSPC, \
|
||||
_______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \
|
||||
_______, _______, QWERTY, COLEMAK, DVORAK, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, \
|
||||
_______, _______, _______, _______, _______)};
|
||||
|
||||
|
||||
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 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;
|
||||
}
|
||||
return true;
|
||||
}
|