Merge remote-tracking branch 'upstream/master' into user_led_configuration

example_keyboards
jpetermans 8 years ago
commit 967cf0f6d4

@ -1,8 +1,7 @@
FROM debian:jessie FROM debian:jessie
MAINTAINER Erik Dasque <erik@frenchguys.com> MAINTAINER Erik Dasque <erik@frenchguys.com>
RUN apt-get update RUN apt-get update && apt-get install --no-install-recommends -y build-essential \
RUN apt-get install --no-install-recommends -y build-essential \
gcc \ gcc \
unzip \ unzip \
wget \ wget \
@ -15,10 +14,8 @@ RUN apt-get install --no-install-recommends -y build-essential \
gcc-arm-none-eabi \ gcc-arm-none-eabi \
binutils-arm-none-eabi \ binutils-arm-none-eabi \
libnewlib-arm-none-eabi \ libnewlib-arm-none-eabi \
git git \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/*
ENV keyboard=ergodox ENV keyboard=ergodox
ENV subproject=ez ENV subproject=ez

@ -21,6 +21,8 @@ override SILENT := false
ON_ERROR := error_occurred=1 ON_ERROR := error_occurred=1
BREAK_ON_ERRORS = no
STARTING_MAKEFILE := $(firstword $(MAKEFILE_LIST)) STARTING_MAKEFILE := $(firstword $(MAKEFILE_LIST))
ROOT_MAKEFILE := $(lastword $(MAKEFILE_LIST)) ROOT_MAKEFILE := $(lastword $(MAKEFILE_LIST))
ROOT_DIR := $(dir $(ROOT_MAKEFILE)) ROOT_DIR := $(dir $(ROOT_MAKEFILE))
@ -462,20 +464,25 @@ endef
include $(ROOT_DIR)/message.mk include $(ROOT_DIR)/message.mk
ifeq ($(strip $(BREAK_ON_ERRORS)), yes)
HANDLE_ERROR = exit 1
else
HANDLE_ERROR = echo $$error_occurred > $(ERROR_FILE)
endif
# The empty line is important here, as it will force a new shell to be created for each command # The empty line is important here, as it will force a new shell to be created for each command
# Otherwise the command line will become too long with a lot of keyboards and keymaps # Otherwise the command line will become too long with a lot of keyboards and keymaps
define RUN_COMMAND define RUN_COMMAND
+error_occurred=0;\ +error_occurred=0;\
$(COMMAND_$(SILENT_MODE)_$(COMMAND))\ $(COMMAND_$(SILENT_MODE)_$(COMMAND))\
if [ $$error_occurred -gt 0 ]; then echo $$error_occurred > $(ERROR_FILE); fi; if [ $$error_occurred -gt 0 ]; then $(HANDLE_ERROR); fi;
endef endef
define RUN_TEST define RUN_TEST
+error_occurred=0;\ +error_occurred=0;\
$($(TEST)_COMMAND)\ $($(TEST)_COMMAND)\
if [ $$error_occurred -gt 0 ]; then echo $$error_occurred > $(ERROR_FILE); fi; if [ $$error_occurred -gt 0 ]; then $(HANDLE_ERROR); fi;
endef endef
# Allow specifying just the subproject, in the keyboard directory, which will compile all keymaps # Allow specifying just the subproject, in the keyboard directory, which will compile all keymaps
@ -527,14 +534,22 @@ test: test-all
.PHONY: test-clean .PHONY: test-clean
test-clean: test-all-clean test-clean: test-all-clean
ifdef SKIP_VERSION
SKIP_GIT := yes
endif
# Generate the version.h file # Generate the version.h file
ifndef SKIP_GIT ifndef SKIP_GIT
GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S") GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S")
else else
GIT_VERSION := NA GIT_VERSION := NA
endif endif
ifndef SKIP_VERSION
BUILD_DATE := $(shell date +"%Y-%m-%d-%H:%M:%S") BUILD_DATE := $(shell date +"%Y-%m-%d-%H:%M:%S")
$(shell echo '#define QMK_VERSION "$(GIT_VERSION)"' > $(ROOT_DIR)/quantum/version.h) $(shell echo '#define QMK_VERSION "$(GIT_VERSION)"' > $(ROOT_DIR)/quantum/version.h)
$(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(ROOT_DIR)/quantum/version.h) $(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(ROOT_DIR)/quantum/version.h)
else
BUILD_DATE := NA
endif
include $(ROOT_DIR)/testlist.mk include $(ROOT_DIR)/testlist.mk

@ -176,26 +176,32 @@ endif
ifeq ($(strip $(UCIS_ENABLE)), yes) ifeq ($(strip $(UCIS_ENABLE)), yes)
OPT_DEFS += -DUCIS_ENABLE OPT_DEFS += -DUCIS_ENABLE
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c UNICODE_COMMON = yes
SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c
endif endif
ifeq ($(strip $(UNICODEMAP_ENABLE)), yes) ifeq ($(strip $(UNICODEMAP_ENABLE)), yes)
OPT_DEFS += -DUNICODEMAP_ENABLE OPT_DEFS += -DUNICODEMAP_ENABLE
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c UNICODE_COMMON = yes
SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c
endif endif
ifeq ($(strip $(UNICODE_ENABLE)), yes) ifeq ($(strip $(UNICODE_ENABLE)), yes)
OPT_DEFS += -DUNICODE_ENABLE OPT_DEFS += -DUNICODE_ENABLE
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c UNICODE_COMMON = yes
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c
endif endif
ifeq ($(strip $(UNICODE_COMMON)), yes)
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
endif
ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
OPT_DEFS += -DRGBLIGHT_ENABLE OPT_DEFS += -DRGBLIGHT_ENABLE
SRC += $(QUANTUM_DIR)/light_ws2812.c SRC += $(QUANTUM_DIR)/light_ws2812.c
SRC += $(QUANTUM_DIR)/rgblight.c SRC += $(QUANTUM_DIR)/rgblight.c
CIE1931_CURVE = yes
LED_BREATHING_TABLE = yes
endif endif
ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
@ -223,6 +229,28 @@ ifneq ($(strip $(MAX_VARIABLE_TRACE_SIZE)),)
endif endif
endif endif
ifeq ($(strip $(LCD_ENABLE)), yes)
CIE1931_CURVE = yes
endif
ifeq ($(strip $(LED_ENABLE)), yes)
CIE1931_CURVE = yes
endif
ifeq ($(strip $(CIE1931_CURVE)), yes)
OPT_DEFS += -DUSE_CIE1931_CURVE
LED_TABLES = yes
endif
ifeq ($(strip $(LED_BREATHING_TABLE)), yes)
OPT_DEFS += -DUSE_LED_BREATHING_TABLE
LED_TABLES = yes
endif
ifeq ($(strip $(LED_TABLES)), yes)
SRC += $(QUANTUM_DIR)/led_tables.c
endif
# Optimize size but this may cause error "relocation truncated to fit" # Optimize size but this may cause error "relocation truncated to fit"
#EXTRALDFLAGS = -Wl,--relax #EXTRALDFLAGS = -Wl,--relax
@ -258,12 +286,12 @@ endif
OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT) OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT)
$(KEYMAP_OUTPUT)_SRC := $(SRC) $(KEYMAP_OUTPUT)_SRC := $(SRC)
$(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYMAP=\"$(KEYMAP)\" $(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) $(GFXDEFS) -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYMAP=\"$(KEYMAP)\"
$(KEYMAP_OUTPUT)_INC := $(VPATH) $(EXTRAINCDIRS) $(KEYMAP_OUTPUT)_INC := $(VPATH) $(EXTRAINCDIRS)
$(KEYMAP_OUTPUT)_CONFIG := $(CONFIG_H) $(KEYMAP_OUTPUT)_CONFIG := $(CONFIG_H)
$(KEYBOARD_OUTPUT)_SRC := $(CHIBISRC) $(KEYBOARD_OUTPUT)_SRC := $(CHIBISRC) $(GFXSRC)
$(KEYBOARD_OUTPUT)_DEFS := $(PROJECT_DEFS) $(KEYBOARD_OUTPUT)_DEFS := $(PROJECT_DEFS) $(GFXDEFS)
$(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC) $(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC) $(GFXINC)
$(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG) $(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG)
# Default target. # Default target.

@ -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

@ -147,6 +147,21 @@
{k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, XXX, k4a, k4b, k4c, k4d} \ {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, XXX, k4a, k4b, k4c, k4d} \
} }
#define KEYMAP_MAX( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k49,\
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3c, \
k40, k41, k42, k45, k4a, k4b, k4c, k4d \
) \
{ \
{k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \
{k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \
{k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, XXX, k2d}, \
{k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d}, \
{k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, k49, k4a, k4b, k4c, k4d} \
}
void matrix_init_user(void); void matrix_init_user(void);
void matrix_scan_user(void); void matrix_scan_user(void);

@ -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),
};

@ -39,7 +39,22 @@
{k40, k41, k42, k43}, \ {k40, k41, k42, k43}, \
{k50, XXX, k52, XXX} \ {k50, XXX, k52, XXX} \
} }
#define MAXKEYMAP( \
k00, k01, k02, k03, \
k10, k11, k12, k13, \
k20, k21, k22, k23, \
k30, k31, k32, k33, \
k40, k41, k42, k43, \
k50, k51, k52, k53\
) \
{ \
{k00, k01, k02, k03}, \
{k10, k11, k12, k13}, \
{k20, k21, k22, k23}, \
{k30, k31, k32, k33}, \
{k40, k41, k42, k43}, \
{k50, k51, k52, k53} \
}
void matrix_init_user(void); void matrix_init_user(void);
void matrix_scan_user(void); void matrix_scan_user(void);

@ -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),
};

@ -39,8 +39,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_LW] = { /* [> LOWER <] */ [_LW] = { /* [> LOWER <] */
{KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_TRNS, KC_UP, KC_F7, KC_F8, KC_F9, KC_F10}, {KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_TRNS, KC_UP, KC_F7, KC_F8, KC_F9, KC_F10},
{KC_DELT, KC_LEFT, KC_DOWN, KC_RGHT, KC_DOWN, KC_TRNS, KC_DOWN, KC_F4, KC_F5, KC_F6, KC_F11}, {KC_DELT, KC_LEFT, KC_DOWN, KC_RGHT, KC_DOWN, KC_TRNS, KC_DOWN, KC_F4, KC_F5, KC_F6, KC_F11},
{KC_TRNS, KC_VOLU, KC_TRNS, KC_TRNS, RESET, KC_LCTL, KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F12}, {KC_NO, KC_VOLU, KC_NO, KC_NO, RESET, KC_LCTL, KC_NO, KC_F1, KC_F2, KC_F3, KC_F12},
{KC_TRNS, KC_VOLD, KC_LGUI, KC_LSFT, KC_BSPC, KC_LALT, KC_SPC, DF(_QW), KC_PSCR, KC_SLCK, KC_PAUS} {KC_NO, KC_VOLD, KC_LGUI, KC_LSFT, KC_BSPC, KC_LALT, KC_SPC, TO(_QW), KC_PSCR, KC_SLCK, KC_PAUS}
}}; }};
const uint16_t PROGMEM fn_actions[] = { const uint16_t PROGMEM fn_actions[] = {

@ -12,49 +12,156 @@ extern keymap_config_t keymap_config;
// The underscores don't mean anything - you can have a layer called STUFF or any other name. // 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 // Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers. // entirely and just use numbers.
#define _DV 0 #define _DVORAK 0
#define _QW 1 #define _QWERTY 1
#define _CM 2 #define _COLEMAK 2
#define _L1 3 #define _DVORMAC 3
#define _L2 4 #define _LOWER 4
#define _RAISE 5
#define _ADJUST 16
// Macro name shortcuts enum planck_keycodes {
#define DVORAK M(_DV) DVORAK = SAFE_RANGE,
#define QWERTY M(_QW) QWERTY,
#define COLEMAK M(_CM) COLEMAK,
DVORMAC,
LOWER,
RAISE,
BACKLIT
};
// Adding macros to make the keymaps below much easier to read.
#define SFTSCLN SFT_T(KC_SCLN)
#define SFTSLSH SFT_T(KC_SLSH)
#define SFTZED SFT_T(KC_Z)
#define ALTENT ALT_T(KC_ENT)
#define ESCTRL CTL_T(KC_ESC)
#define TABALT ALT_T(KC_TAB)
// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_DV] = { /* Dvorak */ /* Dvorak Layer
{KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_NO, KC_F, KC_G, KC_C, KC_R, KC_L }, ,----------------------------------. ,----------------------------------.
{KC_A, KC_O, KC_E, KC_U, KC_I, KC_NO, KC_D, KC_H, KC_T, KC_N, KC_S }, | ' | , | . | P | Y | | F | G | C | R | L |
{SFT_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, CTL_T(KC_DEL), KC_B, KC_M, KC_W, KC_V, SFT_T(KC_Z) }, |------+------+------+------+------| |------+------+------+------+------|
{KC_ESC, KC_TAB, KC_LGUI, MO(_L2), KC_BSPC, ALT_T(KC_ENT), KC_SPC, MO(_L1), KC_MINS, KC_SLSH, KC_EQL} | A | O | E | U | I | | D | H | T | N | S |
|------+------+------+------+------|------.,------|------+------+------+------+------|
|SFT/ ;| Q | J | K | X | CTRL ||Alt / | B | M | W | V |SFT/ Z|
|------+------+------+------+------| ||Enter |------+------+------+------+------|
| Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | / | \ |
`----------------------------------' `----------------------------------' */
[_DVORAK] = {
{KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, XXXXXXX, KC_F, KC_G, KC_C, KC_R, KC_L },
{KC_A, KC_O, KC_E, KC_U, KC_I, XXXXXXX, KC_D, KC_H, KC_T, KC_N, KC_S },
{SFTSCLN, KC_Q, KC_J, KC_K, KC_X, KC_LCTL, KC_B, KC_M, KC_W, KC_V, SFTZED },
{ESCTRL, TABALT, KC_LGUI, LOWER, KC_BSPC, ALTENT, KC_SPC, RAISE, KC_MINS, KC_SLSH, KC_BSLS}
},
/* QWERTY Layer
,----------------------------------. ,----------------------------------.
| Q | W | E | R | T | | Y | U | I | O | P |
|------+------+------+------+------| |------+------+------+------+------|
| A | S | D | F | G | | H | J | K | L | ; |
|------+------+------+------+------|------.,------|------+------+------+------+------|
|SFT/ Z| X | C | V | B | CTRL ||Alt / | N | M | , | . |SFT/ /|
|------+------+------+------+------| ||Enter |------+------+------+------+------|
| Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | ' | \ |
`----------------------------------' `----------------------------------' */
[_QWERTY] = {
{KC_Q, KC_W, KC_E, KC_R, KC_T, XXXXXXX, KC_Y, KC_U, KC_I, KC_O, KC_P },
{KC_A, KC_S, KC_D, KC_F, KC_G, XXXXXXX, KC_H, KC_J, KC_K, KC_L, KC_SCLN},
{SFTZED, KC_X, KC_C, KC_V, KC_B, KC_LCTL, KC_N, KC_M, KC_COMM, KC_DOT, SFTSLSH},
{ESCTRL, TABALT, KC_LGUI, LOWER, KC_BSPC, ALTENT, KC_SPC, RAISE, KC_MINS, KC_QUOT, KC_BSLS}
},
/* Colemak Layer
,----------------------------------. ,----------------------------------.
| Q | W | F | P | G | | J | L | U | Y | L |
|------+------+------+------+------| |------+------+------+------+------|
| A | R | S | T | D | | H | N | E | I | S |
|------+------+------+------+------|------.,------|------+------+------+------+------|
|SFT/ Z| X | C | V | B | CTRL ||Alt / | K | M | , | . |SFT/ /|
|------+------+------+------+------| ||Enter |------+------+------+------+------|
| Esc | Tab | GUI | LOWER| BkSp |------'`------| Spc | RAISE| - | ' | \ |
`----------------------------------' `----------------------------------'*/
[_COLEMAK] = {
{KC_Q, KC_W, KC_F, KC_P, KC_G, XXXXXXX, KC_J, KC_L, KC_U, KC_Y, KC_SCLN},
{KC_A, KC_R, KC_S, KC_T, KC_D, XXXXXXX, KC_H, KC_N, KC_E, KC_I, KC_O },
{SFTZED, KC_X, KC_C, KC_V, KC_B, KC_LCTL, KC_K, KC_M, KC_COMM, KC_DOT, SFTSLSH},
{ESCTRL, TABALT, KC_LGUI, LOWER, KC_BSPC, ALTENT, KC_SPC, RAISE, KC_MINS, KC_QUOT, KC_BSLS}
}, },
[_QW] = { /* Qwerty */
{KC_Q, KC_W, KC_E, KC_R, KC_T, KC_NO, KC_Y, KC_U, KC_I, KC_O, KC_P }, /* Dvorak Layer with Command key on left thumb instead of Control
{KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN}, ,----------------------------------. ,----------------------------------.
{SFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, CTL_T(KC_DEL), KC_N, KC_M, KC_COMM, KC_DOT, SFT_T(KC_SLSH) }, | ' | , | . | P | Y | | F | G | C | R | L |
{KC_ESC, KC_TAB, KC_LGUI, MO(_L2), KC_BSPC, ALT_T(KC_ENT), KC_SPC, MO(_L1), KC_MINS, KC_QUOT, KC_EQL} |------+------+------+------+------| |------+------+------+------+------|
| 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| - | / | \ |
`----------------------------------' `----------------------------------' */
[_DVORMAC] = {
{KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, XXXXXXX, KC_F, KC_G, KC_C, KC_R, KC_L },
{KC_A, KC_O, KC_E, KC_U, KC_I, XXXXXXX, KC_D, KC_H, KC_T, KC_N, KC_S },
{SFTSCLN, KC_Q, KC_J, KC_K, KC_X, KC_LGUI, KC_B, KC_M, KC_W, KC_V, SFTZED },
{ESCTRL, TABALT, KC_LGUI, LOWER, KC_BSPC, ALTENT, KC_SPC, RAISE, KC_MINS, KC_SLSH, KC_BSLS}
}, },
[_CM] = { /* Colemak */
{KC_Q, KC_W, KC_F, KC_P, KC_G, KC_NO, KC_J, KC_L, KC_U, KC_Y, KC_SCLN}, /* LOWER Layer
{KC_A, KC_R, KC_S, KC_T, KC_D, KC_NO, KC_H, KC_N, KC_E, KC_I, KC_O }, ,----------------------------------. ,----------------------------------.
{SFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, CTL_T(KC_DEL), KC_K, KC_M, KC_COMM, KC_DOT, SFT_T(KC_SLSH) }, | ! | @ | # | $ | % | | ^ | & | * | ( | ) |
{KC_ESC, KC_TAB, KC_LGUI, MO(_L2), KC_BSPC, ALT_T(KC_ENT), KC_SPC, MO(_L1), KC_MINS, KC_QUOT, KC_EQL} |------+------+------+------+------| |------+------+------+------+------|
| CAPS | | UP | | Home | | PgDn | | + | { | } |
|------+------+------+------+------|------.,------|------+------+------+------+------|
| | Left | Down | Right| End | || | PgUp | Mute | Vol- | Vol+ | |
|------+------+------+------+------| || |------+------+------+------+------|
| ~ | | | | Del |------'`------| Ins | | | | |
`----------------------------------' `----------------------------------'*/
[_LOWER] = {
{KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, XXXXXXX, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN},
{KC_CAPS, _______, KC_UP, _______, KC_HOME, XXXXXXX, KC_PGUP, _______, KC_PLUS, KC_LCBR, KC_RCBR},
{_______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, _______, KC_PGDN, KC_MUTE, KC_VOLD, KC_VOLU, _______},
{KC_TILD, _______, _______, _______, KC_DEL, _______, KC_INS, _______, _______, _______, _______}
}, },
[_L1] = { /* LAYER 1 */
{KC_1, KC_2, KC_3, KC_4, KC_5, KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0 }, /* RAISE Layer
{KC_TAB, KC_INS, KC_UP, KC_DEL, KC_HOME, KC_NO, KC_PGUP, KC_MUTE, KC_VOLD, KC_VOLU, KC_BSLS}, ,----------------------------------. ,----------------------------------.
{KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_LCTL, KC_PGDN, KC_MPRV, KC_MPLY, KC_MNXT, KC_BSLS}, | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 |
{KC_TRNS, KC_GRV, KC_LGUI, KC_TRNS, KC_DEL, KC_LALT, KC_SPC, KC_TRNS, KC_LBRC, KC_RBRC, KC_ENT } |------+------+------+------+------| |------+------+------+------+------|
| CAPS | | UP | | Home | | PgDn | | = | [ | ] |
|------+------+------+------+------|------.,------|------+------+------+------+------|
| | Left | Down | Right| End | || | PgUp | Prev | Play | Next | |
|------+------+------+------+------| || |------+------+------+------+------|
| ` | | | | Del |------'`------| Ins | | | | |
`----------------------------------' `----------------------------------'*/
[_RAISE] = {
{KC_1, KC_2, KC_3, KC_4, KC_5, XXXXXXX, KC_6, KC_7, KC_8, KC_9, KC_0 },
{KC_CAPS, _______, KC_UP, _______, KC_HOME, XXXXXXX, KC_PGUP, _______, KC_EQL, KC_LBRC, KC_RBRC},
{_______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, _______, KC_PGDN, KC_MPRV, KC_MPLY, KC_MNXT, _______},
{KC_GRV, _______, _______, _______, KC_DEL, _______, KC_INS, _______, _______, _______, _______}
}, },
[_L2] = { /* LAYER 2 */
{KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_NO, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN}, /* ADJUST Layer
{KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_NO, KC_TRNS, KC_F6, KC_F7, KC_F8, KC_PIPE}, ,----------------------------------. ,----------------------------------.
{KC_TRNS, KC_TRNS, DVORAK, QWERTY, COLEMAK, KC_LCTL, KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12 }, | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 |
{KC_TRNS, KC_TRNS, KC_LGUI, KC_TRNS, KC_BSPC, KC_LALT, KC_SPC, KC_TRNS, LSFT(KC_LBRC), LSFT(KC_RBRC), RESET} |------+------+------+------+------| |------+------+------+------+------|
| F11 | | | | | | | PrSc | ScLk | Paus | F12 |
|------+------+------+------+------|------.,------|------+------+------+------+------|
| |QWERTY|COLEMK|DVORAK|DVORMC| || | | | | | |
|------+------+------+------+------| || |------+------+------+------+------|
| | | | | |------'`------| | | | | RESET|
`----------------------------------' `----------------------------------'*/
[_ADJUST] = {
{KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, XXXXXXX, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 },
{KC_F11, _______, _______, _______, _______, XXXXXXX, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_F12 },
{_______, QWERTY, COLEMAK, DVORAK, DVORMAC, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET }
} }
}; };
const uint16_t PROGMEM fn_actions[] = { const uint16_t PROGMEM fn_actions[] = {
@ -66,24 +173,52 @@ void persistant_default_layer_set(uint16_t default_layer) {
default_layer_set(default_layer); default_layer_set(default_layer);
} }
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) bool process_record_user(uint16_t keycode, keyrecord_t *record) {
{ switch (keycode) {
switch(id) { case QWERTY:
case _DV: if (record->event.pressed) {
persistant_default_layer_set(1UL<<_QWERTY);
}
return false;
break;
case COLEMAK:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_COLEMAK);
}
return false;
break;
case DVORAK:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_DVORAK);
}
return false;
break;
case DVORMAC:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_DV); persistant_default_layer_set(1UL<<_DVORMAC);
} }
return false;
break; break;
case _QW: case LOWER:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_QW); layer_on(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} }
return false;
break; break;
case _CM: case RAISE:
if (record->event.pressed) { if (record->event.pressed) {
persistant_default_layer_set(1UL<<_CM); layer_on(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} }
return false;
break; break;
} }
return MACRO_NONE; return true;
}; };

@ -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;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

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)

@ -19,8 +19,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_PGUP, \ F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_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, \ 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, \
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \
KC_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, \ MO(_FL), 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_RALT, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT), KC_LCTL, KC_LGUI, KC_LALT,KC_MHEN, KC_SPC, KC_SPC, KC_HENK, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
/* Keymap _FL: Function Layer /* Keymap _FL: Function Layer
*/ */
@ -29,7 +29,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
S(KC_TAB), S(KC_Q), S(KC_W),S(KC_E),S(KC_R),S(KC_T), S(KC_Y), S(KC_U),S(KC_I),S(KC_O), S(KC_P), S(KC_LBRC),S(KC_RBRC),S(KC_BSLS), S(KC_PGDN), \ S(KC_TAB), S(KC_Q), S(KC_W),S(KC_E),S(KC_R),S(KC_T), S(KC_Y), S(KC_U),S(KC_I),S(KC_O), S(KC_P), S(KC_LBRC),S(KC_RBRC),S(KC_BSLS), S(KC_PGDN), \
S(KC_LCTL),S(KC_A), MO(_CL),S(KC_D),S(KC_F),S(KC_G), S(KC_H), S(KC_J),S(KC_K),S(KC_L), S(KC_SCLN),S(KC_QUOT),S(KC_NUHS),S(KC_ENT), \ S(KC_LCTL),S(KC_A), MO(_CL),S(KC_D),S(KC_F),S(KC_G), S(KC_H), S(KC_J),S(KC_K),S(KC_L), S(KC_SCLN),S(KC_QUOT),S(KC_NUHS),S(KC_ENT), \
MO(_FL), S(KC_NUBS),S(KC_Z),S(KC_X),S(KC_C),S(KC_V), S(KC_B), S(KC_N),S(KC_M),S(KC_COMM),S(KC_DOT), S(KC_SLSH),S(KC_RO), KC_RSFT, KC_PGUP, \ MO(_FL), S(KC_NUBS),S(KC_Z),S(KC_X),S(KC_C),S(KC_V), S(KC_B), S(KC_N),S(KC_M),S(KC_COMM),S(KC_DOT), S(KC_SLSH),S(KC_RO), KC_RSFT, KC_PGUP, \
KC_LCTL, KC_LALT, KC_LGUI,MO(_FL), S(KC_SPC),S(KC_SPC), MO(_FL), KC_RGUI, KC_RALT, KC_RCTL, KC_HOME, KC_PGDN, KC_END), KC_LCTL, KC_LALT, KC_LGUI,KC_MHEN, S(KC_SPC),S(KC_SPC), KC_HENK, KC_RGUI, KC_RALT, KC_RCTL, KC_HOME, KC_PGDN, KC_END),
/* Keymap _CL: Control layer /* Keymap _CL: Control layer
*/ */

@ -19,30 +19,33 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, KC_PGUP, \ F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_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, \ 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, \
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \ KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_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, \ MO(_FL), 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_LALT,KC_LGUI,MO(_FL), KC_SPC, KC_SPC, MO(_FL), KC_RGUI, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT), KC_LCTL, KC_LALT, KC_LGUI,KC_MHEN, KC_SPC, KC_SPC, KC_HENK, KC_RGUI, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
/* Keymap _FL: Function Layer /* Keymap _FL: Function Layer
*/ */
[_FL] = KEYMAP( [_FL] = KEYMAP(
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,KC_DEL, BL_STEP, \ S(KC_GRV), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_GRV), KC_DEL, BL_STEP, \
_______,_______,_______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK,KC_PAUS,_______,_______,_______, _______, \ S(KC_TAB), S(KC_Q), S(KC_W),S(KC_E),S(KC_R),S(KC_T), S(KC_Y), S(KC_U),S(KC_I),S(KC_O), S(KC_P), S(KC_LBRC),S(KC_RBRC),S(KC_BSLS), S(KC_PGDN), \
_______,_______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ S(KC_LCTL),S(KC_A), MO(_CL),S(KC_D),S(KC_F),S(KC_G), S(KC_H), S(KC_J),S(KC_K),S(KC_L), S(KC_SCLN),S(KC_QUOT),S(KC_NUHS),S(KC_ENT), \
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_PGUP, \ MO(_FL), S(KC_NUBS),S(KC_Z),S(KC_X),S(KC_C),S(KC_V), S(KC_B), S(KC_N),S(KC_M),S(KC_COMM),S(KC_DOT), S(KC_SLSH),S(KC_RO), KC_RSFT, KC_PGUP, \
_______,_______,_______,MO(_FL), _______,_______, MO(_FL),_______,_______,MO(_FL),KC_HOME,KC_PGDN,KC_END), KC_LCTL, KC_LALT, KC_LGUI,KC_MHEN, S(KC_SPC),S(KC_SPC), KC_HENK, KC_RGUI, KC_RALT, KC_RCTL, KC_HOME, KC_PGDN, KC_END),
/* Keymap _CL: Control layer /* Keymap _CL: Control layer
*/ */
[_CL] = KEYMAP( [_CL] = KEYMAP(
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, RGB_TOG, RGB_VAI, \
_______,_______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ _______, _______, _______,_______,RESET, _______,_______,_______,_______,_______, _______, _______, _______, _______, RGB_VAD, \
_______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \ _______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ MO(_FL), _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, MO(_FL), RGB_SAI, \
_______,_______,_______,_______, _______,_______, _______,_______,_______,MO(_FL),_______, _______, _______), _______, _______, _______,_______, 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[] = { const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_FUNCTION(0), [0] = ACTION_FUNCTION(0), // Calls action_function()
}; };
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {

@ -58,7 +58,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define RGBW 1 #define RGBW 1
/* Set 0 if debouncing isn't needed */ /* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5 #define DEBOUNCE 15
#define USB_MAX_POWER_CONSUMPTION 500 #define USB_MAX_POWER_CONSUMPTION 500

@ -53,11 +53,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef DEBOUNCE #ifndef DEBOUNCE
# define DEBOUNCE 5 # define DEBOUNCE 5
#endif #endif
static uint8_t debouncing = DEBOUNCE;
/* matrix state(1:on, 0:off) */ /* matrix state(1:on, 0:off) */
static matrix_row_t matrix[MATRIX_ROWS]; static matrix_row_t matrix[MATRIX_ROWS];
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
// Debouncing: store for each key the number of scans until it's eligible to
// change. When scanning the matrix, ignore any changes in keys that have
// already changed in the last DEBOUNCE scans.
static uint8_t debounce_matrix[MATRIX_ROWS * MATRIX_COLS];
static matrix_row_t read_cols(uint8_t row); static matrix_row_t read_cols(uint8_t row);
static void init_cols(void); static void init_cols(void);
@ -113,7 +116,9 @@ void matrix_init(void)
// initialize matrix state: all keys off // initialize matrix state: all keys off
for (uint8_t i=0; i < MATRIX_ROWS; i++) { for (uint8_t i=0; i < MATRIX_ROWS; i++) {
matrix[i] = 0; matrix[i] = 0;
matrix_debouncing[i] = 0; for (uint8_t j=0; j < MATRIX_COLS; ++j) {
debounce_matrix[i * MATRIX_COLS + j] = 0;
}
} }
#ifdef DEBUG_MATRIX_SCAN_RATE #ifdef DEBUG_MATRIX_SCAN_RATE
@ -134,14 +139,36 @@ void matrix_power_up(void) {
// initialize matrix state: all keys off // initialize matrix state: all keys off
for (uint8_t i=0; i < MATRIX_ROWS; i++) { for (uint8_t i=0; i < MATRIX_ROWS; i++) {
matrix[i] = 0; matrix[i] = 0;
matrix_debouncing[i] = 0;
} }
#ifdef DEBUG_MATRIX_SCAN_RATE #ifdef DEBUG_MATRIX_SCAN_RATE
matrix_timer = timer_read32(); matrix_timer = timer_read32();
matrix_scan_count = 0; matrix_scan_count = 0;
#endif #endif
}
// Returns a matrix_row_t whose bits are set if the corresponding key should be
// eligible to change in this scan.
matrix_row_t debounce_mask(uint8_t row) {
matrix_row_t result = 0;
for (uint8_t j=0; j < MATRIX_COLS; ++j) {
if (debounce_matrix[row * MATRIX_COLS + j]) {
--debounce_matrix[row * MATRIX_COLS + j];
} else {
result |= (1 << j);
}
}
return result;
}
// Report changed keys in the given row. Resets the debounce countdowns
// corresponding to each set bit in 'change' to DEBOUNCE.
void debounce_report(matrix_row_t change, uint8_t row) {
for (uint8_t i = 0; i < MATRIX_COLS; ++i) {
if (change & (1 << i)) {
debounce_matrix[row * MATRIX_COLS + i] = DEBOUNCE;
}
}
} }
uint8_t matrix_scan(void) uint8_t matrix_scan(void)
@ -178,26 +205,12 @@ uint8_t matrix_scan(void)
for (uint8_t i = 0; i < MATRIX_ROWS; i++) { for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
select_row(i); select_row(i);
wait_us(30); // without this wait read unstable value. wait_us(30); // without this wait read unstable value.
matrix_row_t cols = read_cols(i); matrix_row_t mask = debounce_mask(i);
if (matrix_debouncing[i] != cols) { matrix_row_t cols = (read_cols(i) & mask) | (matrix[i] & ~mask);
matrix_debouncing[i] = cols; debounce_report(cols ^ matrix[i], i);
if (debouncing) { matrix[i] = cols;
debug("bounce!: "); debug_hex(debouncing); debug("\n");
}
debouncing = DEBOUNCE;
}
unselect_rows();
}
if (debouncing) { unselect_rows();
if (--debouncing) {
wait_us(1);
// this should be wait_ms(1) but has been left as-is at EZ's request
} else {
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
matrix[i] = matrix_debouncing[i];
}
}
} }
matrix_scan_quantum(); matrix_scan_quantum();
@ -205,9 +218,8 @@ uint8_t matrix_scan(void)
return 1; return 1;
} }
bool matrix_is_modified(void) bool matrix_is_modified(void) // deprecated and evidently not called.
{ {
if (debouncing) return false;
return true; return true;
} }

@ -74,7 +74,3 @@ OPT_DEFS += -DBOOTLOADER_SIZE=512
SLEEP_LED_ENABLE = no SLEEP_LED_ENABLE = no
API_SYSEX_ENABLE ?= no API_SYSEX_ENABLE ?= no
RGBLIGHT_ENABLE ?= yes RGBLIGHT_ENABLE ?= yes
ifndef QUANTUM_DIR
include ../../../Makefile
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_ */

@ -40,7 +40,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* number of backlight levels */ /* number of backlight levels */
#define BACKLIGHT_LEVELS 3 #define BACKLIGHT_LEVELS 3
#define LED_BRIGHTNESS_LO 15 #define LED_BRIGHTNESS_LO 100
#define LED_BRIGHTNESS_HI 255 #define LED_BRIGHTNESS_HI 255
/* define if matrix has ghost */ /* define if matrix has ghost */
@ -54,6 +54,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// The visualizer needs gfx thread priorities // The visualizer needs gfx thread priorities
#define VISUALIZER_THREAD_PRIORITY (NORMAL_PRIORITY - 2) #define VISUALIZER_THREAD_PRIORITY (NORMAL_PRIORITY - 2)
#define VISUALIZER_USER_DATA_SIZE 16
/* /*
* Feature disable options * Feature disable options
* These options are also useful to firmware size reduction. * These options are also useful to firmware size reduction.

@ -25,6 +25,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "board_IS31FL3731C.h" #include "board_IS31FL3731C.h"
// Can't include led_tables from here
extern const uint8_t CIE1931_CURVE[];
/*===========================================================================*/ /*===========================================================================*/
/* Driver local definitions. */ /* Driver local definitions. */
/*===========================================================================*/ /*===========================================================================*/
@ -100,37 +104,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define IS31 #define IS31
//Generated by http://jared.geek.nz/2013/feb/linear-led-pwm
const unsigned char cie[256] = {
0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
1, 1, 1, 1, 2, 2, 2, 2, 2, 2,
2, 2, 2, 3, 3, 3, 3, 3, 3, 3,
3, 4, 4, 4, 4, 4, 4, 5, 5, 5,
5, 5, 6, 6, 6, 6, 6, 7, 7, 7,
7, 8, 8, 8, 8, 9, 9, 9, 10, 10,
10, 10, 11, 11, 11, 12, 12, 12, 13, 13,
13, 14, 14, 15, 15, 15, 16, 16, 17, 17,
17, 18, 18, 19, 19, 20, 20, 21, 21, 22,
22, 23, 23, 24, 24, 25, 25, 26, 26, 27,
28, 28, 29, 29, 30, 31, 31, 32, 32, 33,
34, 34, 35, 36, 37, 37, 38, 39, 39, 40,
41, 42, 43, 43, 44, 45, 46, 47, 47, 48,
49, 50, 51, 52, 53, 54, 54, 55, 56, 57,
58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
68, 70, 71, 72, 73, 74, 75, 76, 77, 79,
80, 81, 82, 83, 85, 86, 87, 88, 90, 91,
92, 94, 95, 96, 98, 99, 100, 102, 103, 105,
106, 108, 109, 110, 112, 113, 115, 116, 118, 120,
121, 123, 124, 126, 128, 129, 131, 132, 134, 136,
138, 139, 141, 143, 145, 146, 148, 150, 152, 154,
155, 157, 159, 161, 163, 165, 167, 169, 171, 173,
175, 177, 179, 181, 183, 185, 187, 189, 191, 193,
196, 198, 200, 202, 204, 207, 209, 211, 214, 216,
218, 220, 223, 225, 228, 230, 232, 235, 237, 240,
242, 245, 247, 250, 252, 255,
};
/*===========================================================================*/ /*===========================================================================*/
/* Driver local functions. */ /* Driver local functions. */
/*===========================================================================*/ /*===========================================================================*/
@ -231,7 +204,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
uint8_t* src = PRIV(g)->frame_buffer; uint8_t* src = PRIV(g)->frame_buffer;
for (int y=0;y<GDISP_SCREEN_HEIGHT;y++) { for (int y=0;y<GDISP_SCREEN_HEIGHT;y++) {
for (int x=0;x<GDISP_SCREEN_WIDTH;x++) { for (int x=0;x<GDISP_SCREEN_WIDTH;x++) {
PRIV(g)->write_buffer[get_led_address(g, x, y)]=cie[*src]; PRIV(g)->write_buffer[get_led_address(g, x, y)]=CIE1931_CURVE[*src];
++src; ++src;
} }
} }

@ -8,8 +8,6 @@
#ifndef _GDISP_LLD_BOARD_H #ifndef _GDISP_LLD_BOARD_H
#define _GDISP_LLD_BOARD_H #define _GDISP_LLD_BOARD_H
#include "print.h"
#define ST7565_LCD_BIAS ST7565_LCD_BIAS_9 // actually 6 #define ST7565_LCD_BIAS ST7565_LCD_BIAS_9 // actually 6
#define ST7565_ADC ST7565_ADC_NORMAL #define ST7565_ADC ST7565_ADC_NORMAL
#define ST7565_COM_SCAN ST7565_COM_SCAN_DEC #define ST7565_COM_SCAN ST7565_COM_SCAN_DEC
@ -39,35 +37,49 @@
// MSB First // MSB First
// CLK Low by default // CLK Low by default
static const SPIConfig spi1config = { static const SPIConfig spi1config = {
NULL, // Operation complete callback or @p NULL.
/* HW dependent part.*/ .end_cb = NULL,
ST7565_GPIOPORT, //The chip select line port - when not using pcs.
ST7565_SS_PIN, .ssport = ST7565_GPIOPORT,
SPIx_CTARn_FMSZ(7) // brief The chip select line pad number - when not using pcs.
| SPIx_CTARn_ASC(7) .sspad=ST7565_SS_PIN,
| SPIx_CTARn_DT(7) // SPI initialization data.
| SPIx_CTARn_CSSCK(7) .tar0 =
| SPIx_CTARn_PBR(0) SPIx_CTARn_FMSZ(7) // Frame size = 8 bytes
| SPIx_CTARn_BR(7) | SPIx_CTARn_ASC(1) // After SCK Delay Scaler (min 50 ns) = 55.56ns
//SPI_CR1_BR_0 | SPIx_CTARn_DT(0) // Delay After Transfer Scaler (no minimum)= 27.78ns
| SPIx_CTARn_CSSCK(0) // PCS to SCK Delay Scaler (min 20 ns) = 27.78ns
| SPIx_CTARn_PBR(0) // Baud Rate Prescaler = 2
| SPIx_CTARn_BR(0) // Baud rate (min 50ns) = 55.56ns
}; };
static bool_t st7565_is_data_mode = 1; static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
// Only the LCD is using the SPI bus, so no need to acquire
// spiAcquireBus(&SPID1);
spiSelect(&SPID1);
}
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
// Only the LCD is using the SPI bus, so no need to release
//spiReleaseBus(&SPID1);
spiUnselect(&SPID1);
}
static GFXINLINE void init_board(GDisplay *g) { static GFXINLINE void init_board(GDisplay *g) {
(void) g; (void) g;
palSetPadModeNamed(A0, PAL_MODE_OUTPUT_PUSHPULL); palSetPadModeNamed(A0, PAL_MODE_OUTPUT_PUSHPULL);
palSetPad(ST7565_GPIOPORT, ST7565_A0_PIN); palSetPad(ST7565_GPIOPORT, ST7565_A0_PIN);
st7565_is_data_mode = 1;
palSetPadModeNamed(RST, PAL_MODE_OUTPUT_PUSHPULL); palSetPadModeNamed(RST, PAL_MODE_OUTPUT_PUSHPULL);
palSetPad(ST7565_GPIOPORT, ST7565_RST_PIN); palSetPad(ST7565_GPIOPORT, ST7565_RST_PIN);
palSetPadModeRaw(MOSI, ST7565_SPI_MODE); palSetPadModeRaw(MOSI, ST7565_SPI_MODE);
palSetPadModeRaw(SLCK, ST7565_SPI_MODE); palSetPadModeRaw(SLCK, ST7565_SPI_MODE);
palSetPadModeRaw(SS, ST7565_SPI_MODE); palSetPadModeNamed(SS, PAL_MODE_OUTPUT_PUSHPULL);
spiInit(); spiInit();
spiStart(&SPID1, &spi1config); spiStart(&SPID1, &spi1config);
spiSelect(&SPID1); release_bus(g);
} }
static GFXINLINE void post_init_board(GDisplay *g) { static GFXINLINE void post_init_board(GDisplay *g) {
@ -84,43 +96,17 @@ static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
} }
} }
static GFXINLINE void acquire_bus(GDisplay *g) { static GFXINLINE void enter_data_mode(GDisplay *g) {
(void) g; palSetPad(ST7565_GPIOPORT, ST7565_A0_PIN);
// Only the LCD is using the SPI bus, so no need to acquire
// spiAcquireBus(&SPID1);
}
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
// Only the LCD is using the SPI bus, so no need to release
//spiReleaseBus(&SPID1);
} }
static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { static GFXINLINE void enter_cmd_mode(GDisplay *g) {
(void) g;
if (st7565_is_data_mode) {
// The sleeps need to be at lest 10 vs 25 ns respectively
// So let's sleep two ticks, one tick might not be enough
// if we are at the end of the tick
chThdSleep(2);
palClearPad(ST7565_GPIOPORT, ST7565_A0_PIN); palClearPad(ST7565_GPIOPORT, ST7565_A0_PIN);
chThdSleep(2);
st7565_is_data_mode = 0;
}
spiSend(&SPID1, 1, &cmd);
} }
static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
(void) g; (void) g;
if (!st7565_is_data_mode) {
// The sleeps need to be at lest 10 vs 25 ns respectively
// So let's sleep two ticks, one tick might not be enough
// if we are at the end of the tick
chThdSleep(2);
palSetPad(ST7565_GPIOPORT, ST7565_A0_PIN);
chThdSleep(2);
st7565_is_data_mode = 1;
}
spiSend(&SPID1, length, data); spiSend(&SPID1, length, data);
} }

@ -26,7 +26,7 @@
#define GDISP_SCREEN_WIDTH 128 #define GDISP_SCREEN_WIDTH 128
#endif #endif
#ifndef GDISP_INITIAL_CONTRAST #ifndef GDISP_INITIAL_CONTRAST
#define GDISP_INITIAL_CONTRAST 0 #define GDISP_INITIAL_CONTRAST 35
#endif #endif
#ifndef GDISP_INITIAL_BACKLIGHT #ifndef GDISP_INITIAL_BACKLIGHT
#define GDISP_INITIAL_BACKLIGHT 100 #define GDISP_INITIAL_BACKLIGHT 100
@ -58,12 +58,24 @@
typedef struct{ typedef struct{
bool_t buffer2; bool_t buffer2;
uint8_t data_pos;
uint8_t data[16];
uint8_t ram[GDISP_SCREEN_HEIGHT * GDISP_SCREEN_WIDTH / 8]; uint8_t ram[GDISP_SCREEN_HEIGHT * GDISP_SCREEN_WIDTH / 8];
}PrivData; }PrivData;
// Some common routines and macros // Some common routines and macros
#define PRIV(g) ((PrivData*)g->priv) #define PRIV(g) ((PrivData*)g->priv)
#define RAM(g) (PRIV(g)->ram) #define RAM(g) (PRIV(g)->ram)
static GFXINLINE void write_cmd(GDisplay* g, uint8_t cmd) {
PRIV(g)->data[PRIV(g)->data_pos++] = cmd;
}
static GFXINLINE void flush_cmd(GDisplay* g) {
write_data(g, PRIV(g)->data, PRIV(g)->data_pos);
PRIV(g)->data_pos = 0;
}
#define write_cmd2(g, cmd1, cmd2) { write_cmd(g, cmd1); write_cmd(g, cmd2); } #define write_cmd2(g, cmd1, cmd2) { write_cmd(g, cmd1); write_cmd(g, cmd2); }
#define write_cmd3(g, cmd1, cmd2, cmd3) { write_cmd(g, cmd1); write_cmd(g, cmd2); write_cmd(g, cmd3); } #define write_cmd3(g, cmd1, cmd2, cmd3) { write_cmd(g, cmd1); write_cmd(g, cmd2); write_cmd(g, cmd3); }
@ -89,6 +101,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
// The private area is the display surface. // The private area is the display surface.
g->priv = gfxAlloc(sizeof(PrivData)); g->priv = gfxAlloc(sizeof(PrivData));
PRIV(g)->buffer2 = false; PRIV(g)->buffer2 = false;
PRIV(g)->data_pos = 0;
// Initialise the board interface // Initialise the board interface
init_board(g); init_board(g);
@ -98,38 +111,26 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
gfxSleepMilliseconds(20); gfxSleepMilliseconds(20);
setpin_reset(g, FALSE); setpin_reset(g, FALSE);
gfxSleepMilliseconds(20); gfxSleepMilliseconds(20);
acquire_bus(g); acquire_bus(g);
write_cmd(g, ST7565_DISPLAY_OFF); enter_cmd_mode(g);
write_cmd(g, ST7565_RESET);
write_cmd(g, ST7565_LCD_BIAS); write_cmd(g, ST7565_LCD_BIAS);
write_cmd(g, ST7565_ADC); write_cmd(g, ST7565_ADC);
write_cmd(g, ST7565_COM_SCAN); write_cmd(g, ST7565_COM_SCAN);
write_cmd(g, ST7565_START_LINE | 0); write_cmd(g, ST7565_RESISTOR_RATIO | 0x1);
write_cmd2(g, ST7565_CONTRAST, GDISP_INITIAL_CONTRAST);
write_cmd(g, ST7565_RESISTOR_RATIO | 0x6);
// turn on voltage converter (VC=1, VR=0, VF=0)
write_cmd(g, ST7565_POWER_CONTROL | 0x04);
delay_ms(50);
// turn on voltage regulator (VC=1, VR=1, VF=0)
write_cmd(g, ST7565_POWER_CONTROL | 0x06);
delay_ms(50);
// turn on voltage follower (VC=1, VR=1, VF=1) // turn on internal power supply (VC=1, VR=1, VF=1)
write_cmd(g, ST7565_POWER_CONTROL | 0x07); write_cmd(g, ST7565_POWER_CONTROL | 0x07);
delay_ms(50);
write_cmd(g, 0xE2);
write_cmd(g, ST7565_COM_SCAN);
write_cmd2(g, ST7565_CONTRAST, GDISP_INITIAL_CONTRAST*64/101);
//write_cmd2(g, ST7565_CONTRAST, 0);
write_cmd(g, ST7565_DISPLAY_ON);
write_cmd(g, ST7565_ALLON_NORMAL);
write_cmd(g, ST7565_INVERT_DISPLAY); write_cmd(g, ST7565_INVERT_DISPLAY);
write_cmd(g, ST7565_ALLON_NORMAL);
write_cmd(g, ST7565_START_LINE | 0);
write_cmd(g, ST7565_RMW); write_cmd(g, ST7565_RMW);
flush_cmd(g);
// Finish Init // Finish Init
post_init_board(g); post_init_board(g);
@ -141,7 +142,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
g->g.Width = GDISP_SCREEN_WIDTH; g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Height = GDISP_SCREEN_HEIGHT;
g->g.Orientation = GDISP_ROTATE_0; g->g.Orientation = GDISP_ROTATE_0;
g->g.Powermode = powerOn; g->g.Powermode = powerOff;
g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
g->g.Contrast = GDISP_INITIAL_CONTRAST; g->g.Contrast = GDISP_INITIAL_CONTRAST;
return TRUE; return TRUE;
@ -156,16 +157,21 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
return; return;
acquire_bus(g); acquire_bus(g);
enter_cmd_mode(g);
unsigned dstOffset = (PRIV(g)->buffer2 ? 4 : 0); unsigned dstOffset = (PRIV(g)->buffer2 ? 4 : 0);
for (p = 0; p < 4; p++) { for (p = 0; p < 4; p++) {
write_cmd(g, ST7565_PAGE | (p + dstOffset)); write_cmd(g, ST7565_PAGE | (p + dstOffset));
write_cmd(g, ST7565_COLUMN_MSB | 0); write_cmd(g, ST7565_COLUMN_MSB | 0);
write_cmd(g, ST7565_COLUMN_LSB | 0); write_cmd(g, ST7565_COLUMN_LSB | 0);
write_cmd(g, ST7565_RMW); write_cmd(g, ST7565_RMW);
flush_cmd(g);
enter_data_mode(g);
write_data(g, RAM(g) + (p*GDISP_SCREEN_WIDTH), GDISP_SCREEN_WIDTH); write_data(g, RAM(g) + (p*GDISP_SCREEN_WIDTH), GDISP_SCREEN_WIDTH);
enter_cmd_mode(g);
} }
unsigned line = (PRIV(g)->buffer2 ? 32 : 0); unsigned line = (PRIV(g)->buffer2 ? 32 : 0);
write_cmd(g, ST7565_START_LINE | line); write_cmd(g, ST7565_START_LINE | line);
flush_cmd(g);
PRIV(g)->buffer2 = !PRIV(g)->buffer2; PRIV(g)->buffer2 = !PRIV(g)->buffer2;
release_bus(g); release_bus(g);
@ -231,6 +237,33 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
} }
#endif #endif
LLDSPEC void gdisp_lld_blit_area(GDisplay *g) {
uint8_t* buffer = (uint8_t*)g->p.ptr;
int linelength = g->p.cx;
for (int i = 0; i < g->p.cy; i++) {
unsigned dstx = g->p.x;
unsigned dsty = g->p.y + i;
unsigned srcx = g->p.x1;
unsigned srcy = g->p.y1 + i;
unsigned srcbit = srcy * g->p.x2 + srcx;
for(int j=0; j < linelength; j++) {
uint8_t src = buffer[srcbit / 8];
uint8_t bit = 7-(srcbit % 8);
uint8_t bitset = (src >> bit) & 1;
uint8_t* dst = &(RAM(g)[xyaddr(dstx, dsty)]);
if (bitset) {
*dst |= xybit(dsty);
}
else {
*dst &= ~xybit(dsty);
}
dstx++;
srcbit++;
}
}
g->flags |= GDISP_FLG_NEEDFLUSH;
}
#if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL #if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL
LLDSPEC void gdisp_lld_control(GDisplay *g) { LLDSPEC void gdisp_lld_control(GDisplay *g) {
switch(g->p.x) { switch(g->p.x) {
@ -242,12 +275,16 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
case powerSleep: case powerSleep:
case powerDeepSleep: case powerDeepSleep:
acquire_bus(g); acquire_bus(g);
enter_cmd_mode(g);
write_cmd(g, ST7565_DISPLAY_OFF); write_cmd(g, ST7565_DISPLAY_OFF);
flush_cmd(g);
release_bus(g); release_bus(g);
break; break;
case powerOn: case powerOn:
acquire_bus(g); acquire_bus(g);
enter_cmd_mode(g);
write_cmd(g, ST7565_DISPLAY_ON); write_cmd(g, ST7565_DISPLAY_ON);
flush_cmd(g);
release_bus(g); release_bus(g);
break; break;
default: default:
@ -278,12 +315,12 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
return; return;
case GDISP_CONTROL_CONTRAST: case GDISP_CONTROL_CONTRAST:
if ((unsigned)g->p.ptr > 100) g->g.Contrast = (unsigned)g->p.ptr & 63;
g->p.ptr = (void *)100;
acquire_bus(g); acquire_bus(g);
write_cmd2(g, ST7565_CONTRAST, ((((unsigned)g->p.ptr)<<6)/101) & 0x3F); enter_cmd_mode(g);
write_cmd2(g, ST7565_CONTRAST, g->g.Contrast);
flush_cmd(g);
release_bus(g); release_bus(g);
g->g.Contrast = (unsigned)g->p.ptr;
return; return;
} }
} }

@ -18,6 +18,7 @@
#define GDISP_HARDWARE_DRAWPIXEL TRUE #define GDISP_HARDWARE_DRAWPIXEL TRUE
#define GDISP_HARDWARE_PIXELREAD TRUE #define GDISP_HARDWARE_PIXELREAD TRUE
#define GDISP_HARDWARE_CONTROL TRUE #define GDISP_HARDWARE_CONTROL TRUE
#define GDISP_HARDWARE_BITFILLS TRUE
#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO #define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO

@ -34,4 +34,6 @@
#define ST7565_RESISTOR_RATIO 0x20 #define ST7565_RESISTOR_RATIO 0x20
#define ST7565_POWER_CONTROL 0x28 #define ST7565_POWER_CONTROL 0x28
#define ST7565_RESET 0xE2
#endif /* _ST7565_H */ #endif /* _ST7565_H */

@ -143,7 +143,7 @@
#define GDISP_HARDWARE_DRAWPIXEL TRUE #define GDISP_HARDWARE_DRAWPIXEL TRUE
#define GDISP_HARDWARE_CLEARS FALSE #define GDISP_HARDWARE_CLEARS FALSE
#define GDISP_HARDWARE_FILLS FALSE #define GDISP_HARDWARE_FILLS FALSE
#define GDISP_HARDWARE_BITFILLS FALSE //#define GDISP_HARDWARE_BITFILLS FALSE
#define GDISP_HARDWARE_SCROLL FALSE #define GDISP_HARDWARE_SCROLL FALSE
#define GDISP_HARDWARE_PIXELREAD TRUE #define GDISP_HARDWARE_PIXELREAD TRUE
#define GDISP_HARDWARE_CONTROL TRUE #define GDISP_HARDWARE_CONTROL TRUE

@ -70,10 +70,33 @@ void lcd_backlight_hal_init(void) {
RGB_PORT->PCR[BLUE_PIN] = RGB_MODE; RGB_PORT->PCR[BLUE_PIN] = RGB_MODE;
} }
static uint16_t cie_lightness(uint16_t v) {
// The CIE 1931 formula for lightness
// Y = luminance (output) 0-1
// L = lightness input 0 - 100
// Y = (L* / 902.3) if L* <= 8
// Y = ((L* + 16) / 116)^3 if L* > 8
float l = 100.0f * (v / 65535.0f);
float y = 0.0f;
if (l <= 8.0f) {
y = l / 902.3;
}
else {
y = ((l + 16.0f) / 116.0f);
y = y * y * y;
if (y > 1.0f) {
y = 1.0f;
}
}
return y * 65535.0f;
}
void lcd_backlight_hal_color(uint16_t r, uint16_t g, uint16_t b) { void lcd_backlight_hal_color(uint16_t r, uint16_t g, uint16_t b) {
CHANNEL_RED.CnV = r; CHANNEL_RED.CnV = cie_lightness(r);
CHANNEL_GREEN.CnV = g; CHANNEL_GREEN.CnV = cie_lightness(g);
CHANNEL_BLUE.CnV = b; CHANNEL_BLUE.CnV = cie_lightness(b);
} }
__attribute__ ((weak)) __attribute__ ((weak))
@ -103,34 +126,48 @@ void matrix_scan_kb(void) {
matrix_scan_user(); matrix_scan_user();
} }
__attribute__ ((weak))
void ergodox_board_led_on(void){ void ergodox_board_led_on(void){
} }
__attribute__ ((weak))
void ergodox_right_led_1_on(void){ void ergodox_right_led_1_on(void){
} }
__attribute__ ((weak))
void ergodox_right_led_2_on(void){ void ergodox_right_led_2_on(void){
} }
__attribute__ ((weak))
void ergodox_right_led_3_on(void){ void ergodox_right_led_3_on(void){
} }
void ergodox_right_led_on(uint8_t led){ __attribute__ ((weak))
}
void ergodox_board_led_off(void){ void ergodox_board_led_off(void){
} }
__attribute__ ((weak))
void ergodox_right_led_1_off(void){ void ergodox_right_led_1_off(void){
} }
__attribute__ ((weak))
void ergodox_right_led_2_off(void){ void ergodox_right_led_2_off(void){
} }
__attribute__ ((weak))
void ergodox_right_led_3_off(void){ void ergodox_right_led_3_off(void){
} }
void ergodox_right_led_off(uint8_t led){ __attribute__ ((weak))
void ergodox_right_led_1_set(uint8_t n) {
}
__attribute__ ((weak))
void ergodox_right_led_2_set(uint8_t n) {
}
__attribute__ ((weak))
void ergodox_right_led_3_set(uint8_t n) {
} }
#ifdef ONEHAND_ENABLE #ifdef ONEHAND_ENABLE

@ -7,13 +7,38 @@ void ergodox_board_led_on(void);
void ergodox_right_led_1_on(void); void ergodox_right_led_1_on(void);
void ergodox_right_led_2_on(void); void ergodox_right_led_2_on(void);
void ergodox_right_led_3_on(void); void ergodox_right_led_3_on(void);
void ergodox_right_led_on(uint8_t led);
inline void ergodox_right_led_on(uint8_t led) {
switch (led) {
case 0:
ergodox_right_led_1_on();
break;
case 1:
ergodox_right_led_2_on();
break;
case 2:
ergodox_right_led_3_on();
break;
}
}
void ergodox_board_led_off(void); void ergodox_board_led_off(void);
void ergodox_right_led_1_off(void); void ergodox_right_led_1_off(void);
void ergodox_right_led_2_off(void); void ergodox_right_led_2_off(void);
void ergodox_right_led_3_off(void); void ergodox_right_led_3_off(void);
void ergodox_right_led_off(uint8_t led); inline void ergodox_right_led_off(uint8_t led) {
switch (led) {
case 0:
ergodox_right_led_1_off();
break;
case 1:
ergodox_right_led_2_off();
break;
case 2:
ergodox_right_led_3_off();
break;
}
}
inline void ergodox_led_all_on(void) inline void ergodox_led_all_on(void)
{ {
@ -31,35 +56,21 @@ inline void ergodox_led_all_off(void)
ergodox_right_led_3_off(); ergodox_right_led_3_off();
} }
inline void ergodox_right_led_1_set(uint8_t n){ void ergodox_right_led_1_set(uint8_t n);
if (n) { void ergodox_right_led_2_set(uint8_t n);
ergodox_right_led_1_on(); void ergodox_right_led_3_set(uint8_t n);
} else {
ergodox_right_led_1_off();
}
}
inline void ergodox_right_led_2_set(uint8_t n){
if (n) {
ergodox_right_led_2_on();
} else {
ergodox_right_led_2_off();
}
}
inline void ergodox_right_led_3_set(uint8_t n){
if (n) {
ergodox_right_led_3_on();
} else {
ergodox_right_led_3_off();
}
}
inline void ergodox_right_led_set(uint8_t led, uint8_t n){ inline void ergodox_right_led_set(uint8_t led, uint8_t n){
if (n) { switch (led) {
ergodox_right_led_on(led); case 0:
} else { ergodox_right_led_1_set(n);
ergodox_right_led_off(led); break;
case 1:
ergodox_right_led_2_set(n);
break;
case 2:
ergodox_right_led_3_set(n);
break;
} }
} }

@ -24,6 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "print.h" #include "print.h"
#include "debug.h" #include "debug.h"
#include "matrix.h" #include "matrix.h"
#include "serial_link/system/serial_link.h"
/* /*

@ -1,6 +1,7 @@
# project specific files # project specific files
SRC = matrix.c \ SRC = matrix.c \
led.c led.c \
animations.c
## chip/board settings ## chip/board settings
# - the next two should match the directories in # - the next two should match the directories in
@ -59,17 +60,13 @@ OPT_DEFS += -DCORTEX_VTOR_INIT=0x00002000
# #
CUSTOM_MATRIX ?= yes # Custom matrix file CUSTOM_MATRIX ?= yes # Custom matrix file
SERIAL_LINK_ENABLE = yes SERIAL_LINK_ENABLE = yes
VISUALIZER_ENABLE ?= no #temporarily disabled to make everything compile VISUALIZER_ENABLE ?= yes
LCD_ENABLE ?= yes LCD_ENABLE ?= yes
LED_ENABLE ?= yes LED_ENABLE ?= no
LCD_BACKLIGHT_ENABLE ?= yes LCD_BACKLIGHT_ENABLE ?= yes
MIDI_ENABLE = no MIDI_ENABLE = no
RGBLIGHT_ENABLE = no RGBLIGHT_ENABLE = no
ifndef QUANTUM_DIR
include ../../../Makefile
endif
ifdef LCD_ENABLE ifdef LCD_ENABLE
include $(SUBPROJECT_PATH)/drivers/gdisp/st7565ergodox/driver.mk include $(SUBPROJECT_PATH)/drivers/gdisp/st7565ergodox/driver.mk
endif endif

@ -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);
}

@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* TL2 TL3 * TL2 TL3
* LSHFT Ü Ö Ä P Z B M , . J Shift * LSHFT Ü Ö Ä P Z B M , . J Shift
* *
* CTL ALT MO1 Win Mod4 Mod4 Win MO1 Alt CTL * CTL ALT MO1 Win Mod4 Mod4 Win MO1 ALT CTL
* *
* *
* *
@ -46,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_END, NEO_K, NEO_H, NEO_G, NEO_F, NEO_Q, NEO_SS, KC_END, NEO_K, NEO_H, NEO_G, NEO_F, NEO_Q, NEO_SS,
NEO_S, NEO_N, NEO_R, NEO_T, NEO_D, NEO_L1_R, NEO_S, NEO_N, NEO_R, NEO_T, NEO_D, NEO_L1_R,
TG(PMN), NEO_B, NEO_M, KC_COMM,KC_DOT, NEO_J, KC_RSFT, TG(PMN), NEO_B, NEO_M, KC_COMM,KC_DOT, NEO_J, KC_RSFT,
NEO_L2_R,KC_RGUI,MO(FMU),KC_RALT,KC_RCTL, NEO_L2_R,KC_RGUI,MO(FMU),KC_LALT,KC_RCTL,
KC_DOWN, KC_RGHT, KC_DOWN, KC_RGHT,
KC_MINS, KC_MINS,
MEH_T(KC_NO),KC_ENT,KC_SPC MEH_T(KC_NO),KC_ENT,KC_SPC
@ -63,7 +63,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* (TL2) (TL3) * (TL2) (TL3)
* LSHFT Ä Q R W N J M , . Shift * LSHFT Ä Q R W N J M , . Shift
* *
* CTL ALT MO1 Win MO4 M04 Win MO1 Alt CTL * CTL ALT MO1 Win MO4 M04 Win MO1 ALT CTL
* *
* *
* *
@ -87,7 +87,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_END, DE_B, DE_A, DE_S, DE_G, DE_V, DE_Y, KC_END, DE_B, DE_A, DE_S, DE_G, DE_V, DE_Y,
DE_U, DE_MINS,DE_Z, DE_E, DE_X, NEO_L1_R, DE_U, DE_MINS,DE_Z, DE_E, DE_X, NEO_L1_R,
KC_TRNS, DE_J, DE_M, DE_COMM,DE_DOT, DE_SS, KC_RSFT, KC_TRNS, DE_J, DE_M, DE_COMM,DE_DOT, DE_SS, KC_RSFT,
MO(NHL),KC_RGUI,MO(FMU),KC_RALT,KC_RCTL, MO(NHL),KC_RGUI,MO(FMU),KC_LALT,KC_RCTL,
KC_DOWN, KC_RGHT, KC_DOWN, KC_RGHT,
KC_MINS, KC_MINS,
MEH_T(KC_NO),KC_ENT,KC_SPC MEH_T(KC_NO),KC_ENT,KC_SPC
@ -104,7 +104,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* (TL2) (TL3) * (TL2) (TL3)
* LSHFT Ü Ö Ä P Z B M , . J Shift * LSHFT Ü Ö Ä P Z B M , . J Shift
* *
* CTL ALT MO1 Win MO4 M04 Win MO1 Alt CTL * CTL ALT MO1 Win MO4 M04 Win MO1 ALT CTL
* *
* *
* *
@ -127,7 +127,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_END, DE_K, DE_H, DE_G, DE_F, DE_Q, DE_SS, KC_END, DE_K, DE_H, DE_G, DE_F, DE_Q, DE_SS,
DE_S, DE_N, DE_R, DE_T, DE_D, KC_NO, DE_S, DE_N, DE_R, DE_T, DE_D, KC_NO,
KC_TRNS, DE_B, DE_M, KC_COMM,KC_DOT, DE_J, KC_RSFT, KC_TRNS, DE_B, DE_M, KC_COMM,KC_DOT, DE_J, KC_RSFT,
MO(NHL),KC_RGUI,MO(FMU),KC_RALT,KC_RCTL, MO(NHL),KC_RGUI,MO(FMU),KC_LALT,KC_RCTL,
KC_DOWN, KC_RGHT, KC_DOWN, KC_RGHT,
KC_MINS, KC_MINS,
MEH_T(KC_NO),KC_ENT,KC_SPC MEH_T(KC_NO),KC_ENT,KC_SPC
@ -135,13 +135,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Layer 3: F-keys, Mouse and Unicode /* Layer 3: F-keys, Mouse and Unicode
* *
* * F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12
* *
* F9 F10 F11 F12 *
* *
* F5 F6 F7 F8 *
* (TL2) (TL3) * (TL2) (TL3)
* F1 F2 F3 F4 *
* *
* (MO1) (MO4) (MO4) (MO1) * (MO1) (MO4) (MO4) (MO1)
* *
@ -154,19 +154,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/ */
[FMU] = KEYMAP( [FMU] = KEYMAP(
// left hand // left hand
KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6,
KC_TRNS, UC(0x250C),UC(0x252C),UC(0x2510),UC(0x2500),UC(0x2502),KC_TRNS, KC_TRNS, UC(0x250C),UC(0x252C),UC(0x2510),UC(0x2500),UC(0x2502),KC_TRNS,
KC_TRNS, UC(0x251C),UC(0x253C),UC(0x2524),UC(0x2713),UC(0x2715), KC_TRNS, UC(0x251C),UC(0x253C),UC(0x2524),UC(0x3008),UC(0x3009),
KC_TRNS, UC(0x2514),UC(0x2534),UC(0x2518),UC(0x2194),UC(0x21D4),KC_TRNS, KC_TRNS, UC(0x2514),UC(0x2534),UC(0x2518),KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_MS_L, KC_MS_U, KC_MS_L, KC_MS_U,
KC_BTN1, KC_BTN1,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
// right hand // right hand
KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS,
KC_TRNS, KC_TRNS,KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, UC(0x2194),UC(0x2190),UC(0x2192),UC(0x2191),UC(0x2193),KC_TRNS,
KC_TRNS,KC_F5, KC_F6, KC_F7, KC_F8, KC_TRNS, KC_TRNS, UC(0x2713),UC(0x2715),UC(0x2022),UC(0x2236),KC_TRNS,
KC_TRNS, KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_TRNS, KC_TRNS, UC(0x21D4),UC(0x21D0),UC(0x21D2),UC(0x21D1),UC(0x21D3),KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_MS_D, KC_MS_R, KC_MS_D, KC_MS_R,
KC_BTN2, KC_BTN2,
@ -296,9 +296,8 @@ uint16_t hex_to_keycode(uint8_t hex)
{ {
if(hex == 0x0) { if(hex == 0x0) {
return KC_0; return KC_0;
} else if (hex < 0xA) { }
return KC_1 + (hex - 0x1); else if(hex >= 0xA) {
} else {
switch(hex) { switch(hex) {
case 0xA: case 0xA:
return NEO_A; return NEO_A;
@ -316,4 +315,6 @@ uint16_t hex_to_keycode(uint8_t hex)
return KC_NO; return KC_NO;
} }
} }
return KC_1 + (hex - 0x1);
} }

@ -4,10 +4,18 @@ The idea of this layout is to use it for [Neo2](http://www.neo-layout.org) but a
The main goal of the default layer is to provide a complete symmetric layout with each modifier equally placed for both hands (mirror, of course). The main goal of the default layer is to provide a complete symmetric layout with each modifier equally placed for both hands (mirror, of course).
It also features a layer for additional keys like F-keys (F1 F12), some mouse keys and (hopefully in the near future) some useful Unicode symbols. It also features a layer for additional keys like F-keys (F1 F12), some mouse keys and some useful Unicode symbols.
## Layers ## Build
```
make clean
make coderkun_neo2
```
## Keymap
0. Default layer for Neo2 0. Default layer for Neo2
1. Poor mans QWERTZ 1. Poor mans QWERTZ
@ -16,16 +24,106 @@ It also features a layer for additional keys like F-keys (F1 F12), some mous
4. Neos software layers 4 rebuilt in hardware 4. Neos software layers 4 rebuilt in hardware
## Build ### Layer 0: Default layer for Neo2
1. Enable Unicode in Makefile ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┬─────┬───────┐
│ TAB │ 1 │ 2 │ 3 │ 4 │ 5 │ ` │ │ ´ │ 6 │ 7 │ 8 │ 9 │ 0 │ BKSPC │
├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤
│ Y │ X │ V │ L │ C │ W │ HOM │ │ END │ K │ H │ G │ F │ Q │ ß │
├───────┼─────┼─────┼─────╆─────╅─────┤ E │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤
│ Mod3 │ U │ I │ A │ E │ O ├─────┤ ├─────┤ S │ N │ R │ T │ D │ Mod3 │
├───────┼─────┼─────┼─────╄─────╃─────┤ TL2 │ │ TL3 ├─────╄─────╃─────┼─────┼─────┼───────┤
│ LSHFT │ Ü │ Ö │ Ä │ P │ Z │ │ │ │ B │ M │ , │ . │ J │ Shift │
└─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘
│ CTL │ ALT │ MO1 │ Win │ Mod4│ │ Mod4│ Win │ MO1 │ Alt │ CTL │
└─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┐ ┌─────┬─────┐ └─────┴─────┴─────┴─────┴─────┘
│ ← │ ↑ │ │ ↓ │ → │
┌─────┼─────┼─────┤ ├─────┼─────┼─────┐
│ │ │ ─ │ │ ─ │ │ │
│ SPC │ RTN ├─────┤ ├─────┤ RTN │ SPC │
│ │ │ HYP │ │ MEH │ │ │
└─────┴─────┴─────┘ └─────┴─────┴─────┘
```
UNICODE_ENABLE = yes
```
2. Build as usual
``` ### Layer 1: Poor mans QWERTZ
make clean
make KEYMAP=coderkun_neo2 ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┬─────┬───────┐
``` │ TAB │ 1 │ 2 │ 3 │ 4 │ 5 │ ` │ │ ´ │ 6 │ 7 │ 8 │ 9 │ 0 │ BKSPC │
├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤
│ C │ P │ T │ F │ K │ L │ HOM │ │ END │ B │ A │ S │ G │ V │ Y │
├───────┼─────┼─────┼─────╆─────╅─────┤ E │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤
│ Mod3 │ D │ H │ Ö │ O │ I ├─────┤ ├─────┤ U │ - │ Z │ E │ X │ Mod3 │
├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤
│ LSHFT │ Ä │ Q │ R │ W │ N │ │ │ │ J │ M │ , │ . │ ẞ │ Shift │
└─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘
│ CTL │ ALT │ MO1 │ Win │ MO4 │ │ M04 │ Win │ MO1 │ Alt │ CTL │
└─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┐ ┌─────┬─────┐ └─────┴─────┴─────┴─────┴─────┘
│ ← │ ↑ │ │ ↓ │ → │
┌─────┼─────┼─────┤ ├─────┼─────┼─────┐
│ │ │ ─ │ │ ─ │ │ │
│ SPC │ RTN ├─────┤ ├─────┤ RTN │ SPC │
│ │ │ HYP │ │ MEH │ │ │
└─────┴─────┴─────┘ └─────┴─────┴─────┘
### Layer 2: Poor mans Neo
┌───────┬─────┬─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┬─────┬───────┐
│ TAB │ 1 │ 2 │ 3 │ 4 │ 5 │ ` │ │ ´ │ 6 │ 7 │ 8 │ 9 │ 0 │ BKSPC │
├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤
│ Y │ X │ V │ L │ C │ W │ HOM │ │ END │ K │ H │ G │ F │ Q │ ß │
├───────┼─────┼─────┼─────╆─────╅─────┤ E │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤
│ Mod3 │ U │ I │ A │ E │ O ├─────┤ ├─────┤ S │ N │ R │ T │ D │ Mod3 │
├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤
│ LSHFT │ Ü │ Ö │ Ä │ P │ Z │ │ │ │ B │ M │ , │ . │ J │ Shift │
└─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘
│ CTL │ ALT │ MO1 │ Win │ MO4 │ │ M04 │ Win │ MO1 │ Alt │ CTL │
└─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┐ ┌─────┬─────┐ └─────┴─────┴─────┴─────┴─────┘
│ ← │ ↑ │ │ ↓ │ → │
┌─────┼─────┼─────┤ ├─────┼─────┼─────┐
│ │ │ ─ │ │ ─ │ │ │
│ SPC │ RTN ├─────┤ ├─────┤ RTN │ SPC │
│ │ │ HYP │ │ MEH │ │ │
└─────┴─────┴─────┘ └─────┴─────┴─────┘
### Layer 3: F-keys, mouse keys und Unicode symbols
┌───────┬─────┬─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┬─────┬───────┐
│ │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ │
├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤
│ │ ┌ │ ┬ │ ┐ │ ─ │ │ │ │ │ │ ↔ │ ← │ → │ ↑ │ ↓ │ │
├───────┼─────┼─────┼─────╆─────╅─────┤ │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤
│ │ ├ │ ┼ │ ┤ │ 〈 │ 〉 ├─────┤ ├─────┤ │ ✓ │ ✕ │ • │ │ │
├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤
│ │ └ │ ┴ │ ┘ │ │ │ │ │ │ ⇔ │ ⇐ │ ⇒ │ ⇑ │ ⇓ │ │
└─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘
│ │ │(MO1)│ │(MO4)│ │(MO4)│ │(MO1)│ │ │
└─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┐ ┌─────┬─────┐ └─────┴─────┴─────┴─────┴─────┘
│ Ms← │ Ms↑ │ │ Ms↓ │ Ms→ │
┌─────┼─────┼─────┤ ├─────┼─────┼─────┐
│ │ │ MLC │ │ MRC │ │ │
│ │ ├─────┤ ├─────┤ │ │
│ │ │ │ │ │ │ │
└─────┴─────┴─────┘ └─────┴─────┴─────┘
### Layer 4: Neos software layers 4 rebuilt in hardware
┌───────┬─────┬─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┬─────┬───────┐
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤
│ │ PgUp│ BSpc│ ↑ │ Del │ PgDn│ │ │ │ │ 7 │ 8 │ 9 │ + │
├───────┼─────┼─────┼─────╆─────╅─────┤ │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤
│ │ Home│ ← │ ↓ │ → │ End ├─────┤ ├─────┤ │ 4 │ 5 │ 6 │ , │ . │
├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤
│ │ Esc │ Tab │ Ins │ Ret │ Undo│ │ │ │ │ 1 │ 2 │ 3 │ │ │
└─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘
│ │ │(MO1)│ │(MO4)│ │(MO4)│ │(MO1)│ │ │
└─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┐ ┌─────┬─────┐ └─────┴─────┴─────┴─────┴─────┘
│ │ │ │ │ │
┌─────┼─────┼─────┤ ├─────┼─────┼─────┐
│ │ │ │ │ │ │ │
│ │ ├─────┤ ├─────┤ │ │
│ │ │ │ │ │ │ │
└─────┴─────┴─────┘ └─────┴─────┴─────┘

@ -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";
}
}

@ -311,12 +311,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
break; break;
case SWITCH_NDS: case SWITCH_NDS:
if (record->event.pressed) { if (record->event.pressed) {
return MACRO( D(LSFT), T(F11), U(LSFT), W(500), D(LALT), T(TAB), U(LALT), END); return MACRO( D(LSFT), T(F11), U(LSFT), W(255), D(LALT), T(TAB), U(LALT), END);
} }
break; break;
case OPEN_CLOSE_PAREN: case OPEN_CLOSE_PAREN:
if (record->event.pressed) { if (record->event.pressed) {
return MACRO( D(LSFT), T(LPRN), T(RPRN), U(LSFT), T(LEFT), END); return MACRO( D(LSFT), T(9), T(0), U(LSFT), T(LEFT), END);
} }
break; break;
case OPEN_CLOSE_BRACKET: case OPEN_CLOSE_BRACKET:
@ -326,7 +326,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
break; break;
case OPEN_CLOSE_CURLY: case OPEN_CLOSE_CURLY:
if (record->event.pressed) { if (record->event.pressed) {
return MACRO( D(LSFT), T(LCBR), T(RCBR), U(LSFT), T(LEFT), END); return MACRO( D(LSFT), T(LBRC), T(RBRC), U(LSFT), T(LEFT), END);
} }
break; break;
case OPEN_CLOSE_SINGLE_QUOTE: case OPEN_CLOSE_SINGLE_QUOTE:

@ -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).

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

@ -0,0 +1,267 @@
#include "ergodox.h"
#include "debug.h"
#include "action_layer.h"
#include "version.h"
// Layers
#define BASE 0 // default layer
#define INTL 1 // international symbols
#define INSF 2 // international symbols shifted
#define NUMP 3 // numpad
#define ARRW 4 // function, media, arrow keys
// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// If it accepts an argument (i.e, is a function), it doesn't need KC_.
// Otherwise, it needs KC_*
/* layer 0 : default
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 0 | - | = | BCKSPC |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | TAB | Q | W | E | R | T | HOME | | PGUP | Y | U | I | O | P | DELETE |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | ` | A | S | D | F | G |------| |------| H | J | K | L | ; | ENTER |
* |--------+------+------+------+------+------| END | | PGDN |------+------+------+------+------+--------|
* | (/LSFT | Z | X | C | V | B | | | | N | M | , | . | UP | )/RSFT |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | LCTRL | LGUI | MENU | ' | " | | [ | ] | LEFT | DOWN | RIGHT |
* `------------------------------------' `------------------------------------'
* ,-------------. ,-------------.
* | VOL- | VOL+ | | | |
* ,------|------|------| |------+------+------.
* | SPC/ |SLASH/| MUTE | |NUMLCK|WHACK/| SPC/ |
* | ALT | MO(1)|------| |------|MO(1) | ALT |
* | | | LAY3 | | LAY2 | | |
* `--------------------' `--------------------'
*/
[BASE] = KEYMAP(
// left hand
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_HOME,
KC_GRV, KC_A, KC_S, KC_D, KC_F, KC_G,
KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END,
KC_LCTL, KC_LGUI, KC_MENU, KC_QUOT, S(KC_QUOT),
KC_VOLD, KC_VOLU,
KC_MUTE,
ALT_T(KC_SPC), LT(ARRW,KC_SLSH), TG(INTL),
// right hand
KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,
KC_PGUP, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL,
KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENTER,
KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_RSPC,
KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_RGHT,
_______, _______,
KC_NLCK,
TG(NUMP), LT(ARRW,KC_BSLS), ALT_T(KC_SPC)
),
/* layer 1: International symbols, etc
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | ´ | ¡ | ² | ³ | ¤ | | ¼ | | ½ | ¾ | | | ¥ | × | |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | ä | å | é | ® | þ | | | | ü | ú | í | ó | ö | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | á | ß | ð | | |------| |------| | | | ø | | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* |MO(INSF)| æ | | © | | | | | | ñ | µ | ç | | |MO(INSF)|
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | ¬ | ¿ | | « | » | | | |
* `------------------------------------' `------------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------|------| |------+------+------.
* | | | | | | | |
* | | |------| |------| | |
* | | | | | | | |
* `--------------------' `--------------------'
*/
[INTL] = KEYMAP(
// left hand
UC(0x00B4), UC(0x00A1), UC(0x00B2), UC(0x00B3), UC(0x00A4), UC(0x20AC), UC(0x00BC),
_______, UC(0x00E4), UC(0x00E5), UC(0x00E9), UC(0x00AE), UC(0x00FE), _______,
_______, UC(0x00E1), UC(0x00DF), UC(0x00F0), _______, _______,
MO(INSF), UC(0x00E6), _______, UC(0x00A9), _______, _______, _______,
_______, _______, _______, UC(0x00AC), UC(0x00BF),
_______, _______,
_______,
_______, _______, _______,
// right hand
UC(0x00BD), UC(0x00BE), UC(0x2018), UC(0x2019), UC(0x00A5), UC(0x00D7), _______,
_______, UC(0x00FC), UC(0x00FA), UC(0x00ED), UC(0x00F3), UC(0x00F6), _______,
_______, _______, _______, UC(0x00F8), UC(0x00B6), _______,
_______, UC(0x00F1), UC(0x00B5), UC(0x00E7), _______, _______, MO(INSF),
UC(0x00AB), UC(0x00BB), _______, _______, _______,
_______, _______,
_______,
_______, _______, _______
),
/* layer 2 : international symbols, shifted
* This layer is an ugly workaround; it pretends that SHIFT still works normally on keys
* which don't produce an "upper case" or "shifted" international symobol.
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | ¨ | ¹ | | | £ | | | | | | | | | ÷ | |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | Ä | Å | É | | Þ | | | | Ü | Ú | Í | Ó | Ö | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | Á | § | Ð | | |------| |------| | | | Ø | ° | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | Æ | | ¢ | | | | | | Ñ | | Ç | | | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | ¦ | | | | | | | |
* `------------------------------------' `------------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------|------| |------+------+------.
* | | | | | | | |
* | | |------| |------| | |
* | | | | | | | |
* `--------------------' `--------------------'
*/
[INSF] = KEYMAP(
// left hand
UC(0x00A8), UC(0x00B9), _______, _______, UC(0x00A3), _______, _______,
_______, UC(0x00C4), UC(0x00C5), UC(0x00C9), _______, UC(0x00DE), _______,
_______, UC(0x00C1), UC(0x00A7), UC(0x00D0), S(KC_F), S(KC_G),
_______, UC(0x00C6), S(KC_X), UC(0x00A2), S(KC_V), S(KC_B), _______,
_______, _______, _______, UC(0x00A6), _______,
_______, _______,
_______,
_______, _______, _______,
// right hand
_______, _______, _______, _______, UC(0x2014), UC(0x00F7), _______,
_______, UC(0x00DC), UC(0x00DA), UC(0x00CD), UC(0x00D3), UC(0x00D6), _______,
S(KC_H), S(KC_J), S(KC_K), UC(0x00D8), UC(0x00B0), _______,
_______, UC(0x00D1), _______, UC(0x00C7), S(KC_DOT), _______, _______,
_______, _______, _______, _______, _______,
_______, _______,
_______,
_______, _______, _______
),
/* layer 3: numberpad
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | | | | | | | | | | | ( | ) | / | * | |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | | | | | | | | | | 7 | 8 | 9 | - | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | | |------| |------| | 4 | 5 | 6 | + | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | | | | | | | 1 | 2 | 3 | = | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | | | | 0 | . | , | ENTER| |
* `------------------------------------' `------------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------|------| |------+------+------.
* | | | | | | | |
* | | |------| |------| | |
* | | | | | | | |
* `--------------------' `--------------------'
*/
[NUMP] = KEYMAP(
// left hand
_______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______,
_______, _______,
_______,
_______, _______, _______,
// right hand
_______, _______, S(KC_9), S(KC_0), KC_PSLS, KC_PAST, _______,
_______, _______, KC_KP_7, KC_KP_8, KC_KP_9, KC_PMNS, _______,
_______, KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, _______,
_______, _______, KC_KP_1, KC_KP_2, KC_KP_3, KC_PEQL, _______,
KC_KP_0, KC_KP_DOT, KC_PCMM, KC_PENT, _______,
_______, _______,
_______,
_______, _______, _______
),
/* layer 4 : functions and arrows
* This layer is at the top so that the functions still work no matter what layers are active.
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | ESCAPE | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | SYSREQ |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | | | UP | | | | | | | | | | | INSERT |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* |CAPSLOCK| | LEFT | DOWN |RIGHT | |------| |------| LEFT | DOWN | UP | RIGHT| | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | |M_PREV|M_STOP|M_PLPS|M_NEXT| | | | | | | | | PGUP | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | | | | | | HOME | PGDN | END |
* `------------------------------------' `------------------------------------'
* ,-------------. ,-------------.
* | | PAUSE| | | |
* ,------|------|------| |------+------+------.
* | | | | |SCRLK | | |
* | | |------| |------| | |
* | | | | | | | |
* `--------------------' `--------------------'
*/
[ARRW] = KEYMAP(
// left hand
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6,
_______, _______, _______, KC_UP, _______, _______, _______,
KC_CAPS, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______,
_______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______,
_______, KC_PAUSE,
_______,
_______, _______, _______,
// right hand
KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_SYSREQ,
_______, _______, _______, _______, _______, _______, KC_INS,
KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______,
_______, _______, _______, _______, _______, KC_PGUP, _______,
_______, _______, KC_HOME, KC_PGDN, KC_END,
_______, _______,
KC_SLCK,
_______, _______, _______
),
};
// Runs just one time when the keyboard initializes.
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)
};
// Runs constantly in the background, in a loop.
void matrix_scan_user(void) {
uint8_t layer = biton32(layer_state);
ergodox_board_led_off();
ergodox_right_led_1_off();
ergodox_right_led_2_off();
ergodox_right_led_3_off();
switch (layer) {
case INTL:
case INSF:
ergodox_right_led_1_on();
break;
case NUMP:
ergodox_right_led_2_on();
break;
case ARRW:
ergodox_right_led_3_on();
break;
default:
// none
break;
}
};

@ -392,7 +392,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
case NotEq: case NotEq:
if (record->event.pressed) { if (record->event.pressed) {
return MACRO( I(10), D(LSFT), T(EXLM), U(LSFT), T(EQL), END ); // != return MACRO( I(10), D(LSFT), T(1), U(LSFT), T(EQL), END ); // !=
} }
break; break;

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 KiB

Binary file not shown.

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)

@ -17,7 +17,7 @@
#include "yoruian.h" #include "yoruian.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = KEYMAP\ [0] = KEYMAP_YORUIAN\
(9, 7, 5, 3, 1, GRV, MINS, EQL, LBRC, 0, 2, 4, 6, 8, (9, 7, 5, 3, 1, GRV, MINS, EQL, LBRC, 0, 2, 4, 6, 8,
ES, RBRC, Y, O, R, BSLS, P3, P3, J, V, D, F, W, Q, ES, RBRC, Y, O, R, BSLS, P3, P3, J, V, D, F, W, Q,
LC, U, I, A, N, SCLN, M, H, T, S, C, RC, LC, U, I, A, N, SCLN, M, H, T, S, C, RC,
@ -26,7 +26,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
BSPC, RALT, P2, TAB, BSPC, RALT, P2, TAB,
NO, NO, NO, NO,
E, LSFT, NO, NO, ENT, SPC), E, LSFT, NO, NO, ENT, SPC),
[1] = KEYMAP\ [1] = KEYMAP_YORUIAN\
(TR, TR, TR, TR, TR, TR, TR, TR, TR, F5, F6, F7, F8, F9, (TR, TR, TR, TR, TR, TR, TR, TR, TR, F5, F6, F7, F8, F9,
TR, TR, TR, TR, TR, TR, TR, TR, TR, F1, F2, F3, F4, FT, TR, TR, TR, TR, TR, TR, TR, TR, TR, F1, F2, F3, F4, FT,
TR, TR, TR, TR, TR, TR, PAUS, LEFT, DOWN, UP, RGHT, FE, TR, TR, TR, TR, TR, TR, PAUS, LEFT, DOWN, UP, RGHT, FE,

@ -18,9 +18,7 @@
#include "debug.h" #include "debug.h"
#include "action_layer.h" #include "action_layer.h"
#undef KEYMAP #define KEYMAP_YORUIAN( \
#define KEYMAP\
( \
/* Spacial positions. */ \ /* Spacial positions. */ \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, \
@ -30,24 +28,22 @@
k55, k56, k57, k58, \ k55, k56, k57, k58, \
k54, k59, \ k54, k59, \
k53, k52, k51, k5C, k5B, k5A) \ k53, k52, k51, k5C, k5B, k5A) \
\ KEYMAP(KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, \
/* Matrix positions. */ \ KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, \
{ \ KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, \
{ KC_##k00, KC_##k10, KC_##k20, KC_##k30, KC_##k40, KC_NO }, \ KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, \
{ KC_##k01, KC_##k11, KC_##k21, KC_##k31, KC_##k41, KC_##k51 }, \ KC_##k40, KC_##k41, KC_##k42, KC_##k43, KC_##k44, \
{ KC_##k02, KC_##k12, KC_##k22, KC_##k32, KC_##k42, KC_##k52 }, \ KC_##k55, KC_##k56, \
{ KC_##k03, KC_##k13, KC_##k23, KC_##k33, KC_##k43, KC_##k53 }, \ KC_##k54, \
{ KC_##k04, KC_##k14, KC_##k24, KC_##k34, KC_##k44, KC_##k54 }, \ KC_##k53, KC_##k52, KC_##k51, \
{ KC_##k05, KC_##k15, KC_##k25, KC_##k35, KC_NO, KC_##k55 }, \ KC_##k07, KC_##k08, KC_##k09, KC_##k0A, KC_##k0B, KC_##k0C, KC_##k0D, \
{ KC_##k06, KC_##k16, KC_NO, KC_##k36, KC_NO, KC_##k56 }, \ KC_##k17, KC_##k18, KC_##k19, KC_##k1A, KC_##k1B, KC_##k1C, KC_##k1D, \
{ KC_##k07, KC_##k17, KC_NO, KC_##k37, KC_NO, KC_##k57 }, \ KC_##k28, KC_##k29, KC_##k2A, KC_##k2B, KC_##k2C, KC_##k2D, \
{ KC_##k08, KC_##k18, KC_##k28, KC_##k38, KC_NO, KC_##k58 }, \ KC_##k37, KC_##k38, KC_##k39, KC_##k3A, KC_##k3B, KC_##k3C, KC_##k3D, \
{ KC_##k09, KC_##k19, KC_##k29, KC_##k39, KC_##k49, KC_##k59 }, \ KC_##k49, KC_##k4A, KC_##k4B, KC_##k4C, KC_##k4D, \
{ KC_##k0A, KC_##k1A, KC_##k2A, KC_##k3A, KC_##k4A, KC_##k5A }, \ KC_##k57, KC_##k58, \
{ KC_##k0B, KC_##k1B, KC_##k2B, KC_##k3B, KC_##k4B, KC_##k5B }, \ KC_##k59, \
{ KC_##k0C, KC_##k1C, KC_##k2C, KC_##k3C, KC_##k4C, KC_##k5C }, \ KC_##k5C, KC_##k5B, KC_##k5A)
{ KC_##k0D, KC_##k1D, KC_##k2D, KC_##k3D, KC_##k4D, KC_NO } \
}
#define KC_ES KC_ESC #define KC_ES KC_ESC
#define KC_LC KC_LCTL #define KC_LC KC_LCTL

@ -115,6 +115,7 @@ inline matrix_row_t matrix_get_row(uint8_t row) {
} }
void matrix_print(void) { void matrix_print(void) {
#ifndef NO_PRINT
print("\nr\\c ABCDEFGHIJKLMNOPQR\n"); print("\nr\\c ABCDEFGHIJKLMNOPQR\n");
for (uint8_t row = 0; row < MATRIX_ROWS; row++) { for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
matrix_row_t matrix_row = matrix_get_row(row); matrix_row_t matrix_row = matrix_get_row(row);
@ -125,6 +126,7 @@ void matrix_print(void) {
} }
print("\n"); print("\n");
} }
#endif
} }
uint8_t matrix_key_count(void) { uint8_t matrix_key_count(void) {

@ -7,7 +7,8 @@ Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts
and https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c and https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c
*/ */
#include "babblePaste.h" #include "../MS_sculpt_mobile/babblePaste.h"
#include "action_macro.h" #include "action_macro.h"
#ifdef USE_BABLPASTE #ifdef USE_BABLPASTE

@ -9,9 +9,9 @@ and jeebak & algernon's keymap
*/ */
#ifndef _babblePaste_h_included__ #ifndef _babblePaste_h_included__
#define _babblePaste_h_included__ #define _babblePaste_h_included__
#include "../MS_sculpt_mobile/config.h"
#include "action_layer.h" #include "action_layer.h"
#include "quantum_keycodes.h" #include "quantum_keycodes.h"
#include "config.h"
#ifdef USE_BABLPASTE #ifdef USE_BABLPASTE

@ -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] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* /*

@ -1,7 +1,7 @@
#ifndef CONFIG_USER_H #ifndef CONFIG_USER_H
#define CONFIG_USER_H #define CONFIG_USER_H
#include "../../config.h" #include "../../../MS_sculpt_mobile/config.h"
#define USE_BABLPASTE #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_layer.h"
#include "action_util.h" #include "action_util.h"
#include "babblePaste.h"
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
#include "audio.h" #include "audio.h"

@ -66,7 +66,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//,----+----+----+----+----+----. ,----+----+----+----+----+----. //,----+----+----+----+----+----. ,----+----+----+----+----+----.
TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,MINS, TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,MINS,
//|----+----+----+----+----+----| |----+----+----+----+----+----| //|----+----+----+----+----+----| |----+----+----+----+----+----|
X0 , A , O , E , U , I , D , H , R , N , S ,SLSH, X0 , A , O , E , U , I , D , H , T , N , S ,SLSH,
//|----+----+----+----+----+----| |----+----+----+----+----+----| //|----+----+----+----+----+----| |----+----+----+----+----+----|
LSFT,SCLN, Q , J , K , X , B , M , W , V , Z , X4 , LSFT,SCLN, Q , J , K , X , B , M , W , V , Z , X4 ,
//|----+----+----+----+----+----|----+----|----+----+----+----+----+----| //|----+----+----+----+----+----|----+----|----+----+----+----+----+----|

@ -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

@ -35,12 +35,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DESCRIPTION #define DESCRIPTION
/* key matrix size */ /* key matrix size */
#define MATRIX_ROWS 8
#define MATRIX_COLS 6 #define MATRIX_COLS 6
#define MATRIX_ROWS 9
/* default pin-out */ /* default pin-out */
#define MATRIX_COL_PINS { B6, B7, D6, C7, F6, F7 } #define MATRIX_COL_PINS { F4, F1, F0, D6, D0, D1 }
#define MATRIX_ROW_PINS { D7, C6, D0, D1, F5, F4, F1, F0 } #define MATRIX_ROW_PINS { F5, F6, F7 }
#define TRACKPOINT_PINS { B7, B6, D7 }
#define UNUSED_PINS #define UNUSED_PINS
/* /*
@ -152,17 +153,20 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//#define NO_ACTION_MACRO //#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION //#define NO_ACTION_FUNCTION
#define PS2_INIT_DELAY 2000 #define PS2_MOUSE_INIT_DELAY 2000
#define BATTERY_PIN 9 #define BATTERY_PIN 9
#define BATTERY_POLL 30000 #define BATTERY_POLL 30000
#define MAX_VOLTAGE 4.2 #define MAX_VOLTAGE 4.2
#define MIN_VOLTAGE 3.2 #define MIN_VOLTAGE 3.2
#define ___ KC_NO
#define KEYMAP( \ #define KEYMAP( \
k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \ k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \
k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \ k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \
k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \ k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \
k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c \ k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, \
tp1, tp2, tp3 \
) \ ) \
{ \ { \
{k11, k12, k13, k14, k15, k16}, \ {k11, k12, k13, k14, k15, k16}, \
@ -172,25 +176,36 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{k17, k18, k19, k1a, k1b, k1c}, \ {k17, k18, k19, k1a, k1b, k1c}, \
{k27, k28, k29, k2a, k2b, k2c}, \ {k27, k28, k29, k2a, k2b, k2c}, \
{k37, k38, k39, k3a, k3b, k3c}, \ {k37, k38, k39, k3a, k3b, k3c}, \
{k47, k48, k49, k4a, k4b, k4c} \ {k47, k48, k49, k4a, k4b, k4c}, \
{tp1, tp2, tp3, ___, ___, ___} \
} }
#ifndef __ASSEMBLER__ // assembler doesn't like enum in .h file #ifndef __ASSEMBLER__ // assembler doesn't like enum in .h file
enum led_sequence { enum led_sequence {
LED_IND_LINUX,
LED_IND_APPLE,
LED_IND_WINDOWS,
LED_IND_QWERTY,
LED_IND_ALT,
LED_IND_AUDIO,
LED_IND_BLUETOOTH, LED_IND_BLUETOOTH,
LED_IND_USB, LED_IND_USB,
LED_IND_BATTERY,
LED_IND_BATTERY,
LED_IND_CAPSLOCK,
LED_IND_GUI,
LED_IND_FUN, LED_IND_FUN,
LED_IND_NUM, LED_IND_NUM,
LED_IND_PUNC,
LED_IND_EMOJI, LED_IND_EMOJI,
LED_IND_GREEK,
LED_BKSP, LED_BKSP,
LED_ENT, LED_ENT,
LED_RSFT, LED_RSFT,
LED_RCTL, LED_RCTL,
LED_RGUI, LED_RALT,
LED_SLSH, LED_SLSH,
LED_SCLN, LED_SCLN,
LED_P, LED_P,
@ -198,9 +213,9 @@ enum led_sequence {
LED_O, LED_O,
LED_L, LED_L,
LED_DOT, LED_DOT,
LED_RALT, LED_RGUI,
LED_EMOJI, LED_GREEK,
LED_COMM, LED_COMM,
LED_K, LED_K,
LED_I, LED_I,
@ -219,35 +234,35 @@ enum led_sequence {
LED_TRACKPOINT2, LED_TRACKPOINT2,
LED_TRACKPOINT1, LED_TRACKPOINT1,
LED_LSPC,
LED_B,
LED_G,
LED_T, LED_T,
LED_G,
LED_B,
LED_LSPC,
LED_R,
LED_F,
LED_V,
LED_NUM, LED_NUM,
LED_V,
LED_F,
LED_R,
LED_PUNC,
LED_C,
LED_D,
LED_E, LED_E,
LED_D,
LED_C,
LED_EMPTY,
LED_W, LED_LGUI,
LED_S,
LED_X, LED_X,
LED_LALT, LED_S,
LED_W,
LED_LGUI,
LED_Z,
LED_A,
LED_Q, LED_Q,
LED_A,
LED_Z,
LED_LALT,
LED_TAB,
LED_ESC,
LED_LSFT,
LED_LCTL, LED_LCTL,
LED_LSFT,
LED_ESC,
LED_TAB,
LED_TOTAL LED_TOTAL
}; };
@ -261,7 +276,7 @@ enum led_sequence {
# define PS2_CLOCK_PORT PORTD # define PS2_CLOCK_PORT PORTD
# define PS2_CLOCK_PIN PIND # define PS2_CLOCK_PIN PIND
# define PS2_CLOCK_DDR DDRD # define PS2_CLOCK_DDR DDRD
# define PS2_CLOCK_BIT 1 # define PS2_CLOCK_BIT 3
# define PS2_DATA_PORT PORTD # define PS2_DATA_PORT PORTD
# define PS2_DATA_PIN PIND # define PS2_DATA_PIN PIND
# define PS2_DATA_DDR DDRD # define PS2_DATA_DDR DDRD

@ -19,6 +19,8 @@ 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. RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
PS2_MOUSE_ENABLE = yes PS2_MOUSE_ENABLE = yes
PS2_USE_INT = yes PS2_USE_INT = yes
FAUXCLICKY_ENABLE = yes
BLUETOOTH = AdafruitBLE
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend

@ -37,8 +37,8 @@ On Promethium, USB or Bluetooth output is detected on startup. If USB is connect
SYS-W, SYS-L, SYS-M switch Unicode input method. SYS-Q, SYS-D, SYS-C, SYS-K, SYS-N switch to QWERTY, DVORAK, Colemak, Workman and Norman, respectively. SYS-W, SYS-L, SYS-M switch Unicode input method. SYS-Q, SYS-D, SYS-C, SYS-K, SYS-N switch to QWERTY, DVORAK, Colemak, Workman and Norman, respectively.
On Planck, SYS-A (mnemonic: audio) toggles faux clicky: use buzzer to emit clicks on key presses and releases. SYS-A (mnemonic: audio) toggles faux clicky: use buzzer to emit clicks on key presses and releases.
On Promethium there are 6 indicator LEDs, and under switch LEDs on each switches, including Trackpoint buttons. Totaling 57 LEDs. Output is limited to 0xF for each LEDs to conserve power. SYS-G (mnemonic: glow) toggles various backlighting modes. On Promethium there are 16 indicator LEDs, and under switch LEDs on each switches, including Trackpoint buttons. Totaling 67 LEDs. Output is limited to 0xF for each LEDs to conserve power. SYS-G (mnemonic: glow) toggles various backlighting modes.
On Promethium, there's a LED to indicate battery level. Hue indicates level: green is full, red is empty. On Promethium, there's a LED to indicate battery level. Hue indicates level: green is full, red is empty.

@ -14,6 +14,7 @@
#define PREVENT_STUCK_MODIFIERS #define PREVENT_STUCK_MODIFIERS
#define RGBSPS_ENABLE #define RGBSPS_ENABLE
#define RGBSPS_DEMO_ENABLE
#define UNICODE_TYPE_DELAY 0 #define UNICODE_TYPE_DELAY 0

@ -31,6 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "quantum.h" #include "quantum.h"
#ifdef RGBSPS_ENABLE #ifdef RGBSPS_ENABLE
#include "rgbsps.h" #include "rgbsps.h"
#include "rgbtheme.h"
#endif #endif
#ifdef PS2_MOUSE_ENABLE #ifdef PS2_MOUSE_ENABLE
#include "ps2_mouse.h" #include "ps2_mouse.h"
@ -38,6 +39,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#endif #endif
#ifdef FAUXCLICKY_ENABLE #ifdef FAUXCLICKY_ENABLE
#include "fauxclicky.h" #include "fauxclicky.h"
#ifdef RGBSPS_ENABLE
#undef FAUXCLICKY_OFF
#define FAUXCLICKY_OFF do { \
fauxclicky_enabled = false; \
rgbsps_set(LED_AUDIO, COLOR_BLANK); \
fauxclicky_stop(); \
} while (0)
#undef FAUXCLICKY_ON
#define FAUXCLICKY_ON do { \
fauxclicky_enabled = true; \
rgbsps_set(LED_AUDIO, THEME_COLOR_AUDIO); \
} while (0)
#endif
#endif #endif
#include "outputselect.h" #include "outputselect.h"
#include "led.h" #include "led.h"
@ -128,9 +142,10 @@ enum planck_keycodes {
#ifndef FAUXCLICKY_ENABLE #ifndef FAUXCLICKY_ENABLE
FC_TOG, FC_TOG,
#endif #endif
#ifndef ADAFRUIT_BLE_ENABLE #ifndef MODULE_ADAFRUIT_BLE
OUT_BLE, OUT_BT,
#endif #endif
RGBDEMO,
KEYCODE_END KEYCODE_END
}; };
@ -421,19 +436,30 @@ const uint8_t PROGMEM LED_MODS[] = {
}; };
const uint8_t PROGMEM LED_FN[] = { const uint8_t PROGMEM LED_FN[] = {
LED_PUNC, LED_EMPTY,
LED_NUM, LED_NUM,
LED_FUN, LED_FUN,
LED_EMOJI LED_GREEK
}; };
const uint8_t PROGMEM LED_INDICATORS[] = { const uint8_t PROGMEM LED_INDICATORS[] = {
LED_IND_EMOJI, LED_IND_LINUX,
LED_IND_NUM, LED_IND_APPLE,
LED_IND_FUN, LED_IND_WINDOWS,
LED_IND_BATTERY, LED_IND_QWERTY,
LED_IND_USB, LED_IND_ALT,
LED_IND_AUDIO,
LED_IND_BLUETOOTH, LED_IND_BLUETOOTH,
LED_IND_USB,
LED_IND_BATTERY,
LED_IND_CAPSLOCK,
LED_IND_GUI,
LED_IND_FUN,
LED_IND_NUM,
LED_IND_PUNC,
LED_IND_EMOJI,
LED_IND_GREEK,
}; };
const uint8_t PROGMEM LED_TRACKPOINT[] = { const uint8_t PROGMEM LED_TRACKPOINT[] = {
@ -444,15 +470,36 @@ const uint8_t PROGMEM LED_TRACKPOINT[] = {
void led_turnoff_keys(void) { void led_turnoff_keys(void) {
for(uint8_t i = 0; i < COUNT(LED_ALNUM); i++) { for(uint8_t i = 0; i < COUNT(LED_ALNUM); i++) {
rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), 0, 0, 0); rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), COLOR_BLACK);
} }
for(uint8_t i = 0; i < COUNT(LED_MODS); i++) { for(uint8_t i = 0; i < COUNT(LED_MODS); i++) {
rgbsps_set(pgm_read_byte(&LED_MODS[i]), 0, 0, 0); rgbsps_set(pgm_read_byte(&LED_MODS[i]), COLOR_BLACK);
} }
for(uint8_t i = 0; i < COUNT(LED_FN); i++) { for(uint8_t i = 0; i < COUNT(LED_FN); i++) {
rgbsps_set(pgm_read_byte(&LED_FN[i]), 0, 0, 0); rgbsps_set(pgm_read_byte(&LED_FN[i]), COLOR_BLACK);
} }
}
#ifdef RGBSPS_DEMO_ENABLE
void led_demo(void) {
rgbsps_set(LED_IND_LINUX, THEME_COLOR_LINUX);
rgbsps_set(LED_IND_APPLE, THEME_COLOR_APPLE);
rgbsps_set(LED_IND_WINDOWS, THEME_COLOR_WINDOWS);
rgbsps_set(LED_IND_QWERTY, THEME_COLOR_QWERTY);
rgbsps_set(LED_IND_ALT, THEME_COLOR_ALT);
rgbsps_set(LED_IND_AUDIO, THEME_COLOR_AUDIO);
rgbsps_set(LED_IND_BLUETOOTH, THEME_COLOR_BLUETOOTH);
rgbsps_set(LED_IND_USB, THEME_COLOR_USB);
rgbsps_set(LED_IND_CAPSLOCK, THEME_COLOR_CAPSLOCK);
rgbsps_set(LED_IND_GUI, THEME_COLOR_GUI);
rgbsps_set(LED_IND_FUN, THEME_COLOR_FUN);
rgbsps_set(LED_IND_NUM, THEME_COLOR_NUM);
rgbsps_set(LED_IND_PUNC, THEME_COLOR_PUNC);
rgbsps_set(LED_IND_GREEK, THEME_COLOR_GREEK);
rgbsps_set(LED_IND_EMOJI, THEME_COLOR_EMOJI);
rgbsps_send();
} }
#endif
void led_reset(void) { void led_reset(void) {
switch (glow_mode) { switch (glow_mode) {
@ -462,39 +509,55 @@ void led_reset(void) {
case GLOW_MIN: case GLOW_MIN:
led_turnoff_keys(); led_turnoff_keys();
for(uint8_t i = 0; i < COUNT(LED_HOMING); i++) { for(uint8_t i = 0; i < COUNT(LED_HOMING); i++) {
rgbsps_set(pgm_read_byte(&LED_HOMING[i]), 8, 8, 8); rgbsps_set(pgm_read_byte(&LED_HOMING[i]), THEME_COLOR_GLOW1_HOME);
} }
rgbsps_set(LED_F, 15, 0, 0); rgbsps_set(LED_F, THEME_COLOR_GLOW1_HOMING);
rgbsps_set(LED_J, 15, 0, 0); rgbsps_set(LED_J, THEME_COLOR_GLOW1_HOMING);
break; break;
case GLOW_FULL: case GLOW_FULL:
for(uint8_t i = 0; i < COUNT(LED_ALNUM); i++) { for(uint8_t i = 0; i < COUNT(LED_ALNUM); i++) {
rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), 8, 8, 8); rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), THEME_COLOR_GLOW2_ALPHA);
} }
for(uint8_t i = 0; i < COUNT(LED_MODS); i++) { for(uint8_t i = 0; i < COUNT(LED_MODS); i++) {
rgbsps_set(pgm_read_byte(&LED_MODS[i]), 0, 15, 0); rgbsps_set(pgm_read_byte(&LED_MODS[i]), THEME_COLOR_GLOW2_MODS);
} }
for(uint8_t i = 0; i < COUNT(LED_FN); i++) { for(uint8_t i = 0; i < COUNT(LED_FN); i++) {
rgbsps_set(pgm_read_byte(&LED_FN[i]), 0, 0, 15); rgbsps_set(pgm_read_byte(&LED_FN[i]), THEME_COLOR_GLOW2_FN);
} }
for(uint8_t i = 0; i < COUNT(LED_HOMING); i++) { for(uint8_t i = 0; i < COUNT(LED_HOMING); i++) {
rgbsps_set(pgm_read_byte(&LED_HOMING[i]), 15, 0, 0); rgbsps_set(pgm_read_byte(&LED_HOMING[i]), THEME_COLOR_GLOW2_HOME);
} }
rgbsps_set(LED_F, 15, 15, 0); rgbsps_set(LED_F, THEME_COLOR_GLOW2_HOMING);
rgbsps_set(LED_J, 15, 15, 0); rgbsps_set(LED_J, THEME_COLOR_GLOW2_HOMING);
break; break;
} }
} }
void led_set_default_layer_indicator(void) {
uint8_t default_layer = biton32(default_layer_state);
if (default_layer == _QWERTY) {
rgbsps_set(LED_IND_QWERTY, THEME_COLOR_QWERTY);
rgbsps_set(LED_IND_ALT, COLOR_BLANK);
} else {
rgbsps_set(LED_IND_QWERTY, COLOR_BLANK);
rgbsps_set(LED_IND_ALT, THEME_COLOR_ALT);
}
rgbsps_send();
return;
}
void led_set_layer_indicator(void) { void led_set_layer_indicator(void) {
static uint8_t oldlayer = 255; static uint8_t oldlayer = 255;
rgbsps_set(LED_IND_FUN, 0, 0, 0);
// rgbsps_set(LED_IND_NUM, 0, 0, 0);
rgbsps_set(LED_IND_EMOJI, 0, 0, 0);
led_reset(); led_reset();
rgbsps_set(LED_IND_GUI, COLOR_BLANK);
rgbsps_set(LED_IND_FUN, COLOR_BLANK);
rgbsps_set(LED_IND_NUM, COLOR_BLANK);
rgbsps_set(LED_IND_PUNC, COLOR_BLANK);
rgbsps_set(LED_IND_GREEK, COLOR_BLANK);
rgbsps_set(LED_IND_EMOJI, COLOR_BLANK);
uint8_t layer = biton32(layer_state); uint8_t layer = biton32(layer_state);
if (oldlayer == layer) { if (oldlayer == layer) {
return; return;
@ -508,39 +571,72 @@ void led_set_layer_indicator(void) {
} }
switch(layer) { switch(layer) {
case _GUI:
rgbsps_set(LED_IND_GUI, THEME_COLOR_GUI);
break;
case _FUN: case _FUN:
rgbsps_set(LED_IND_FUN, 15, 0, 0); rgbsps_set(LED_IND_FUN, THEME_COLOR_FUN);
break;
case _NUM:
rgbsps_set(LED_IND_NUM, THEME_COLOR_NUM);
break;
case _PUNC:
rgbsps_set(LED_IND_PUNC, THEME_COLOR_PUNC);
break;
case _GREEKL:
case _GREEKU:
rgbsps_set(LED_IND_GREEK, THEME_COLOR_GREEK);
break; break;
// case _NUM:
// rgbsps_set(LED_IND_NUM, 0, 0, 15);
// break;
case _EMOJI: case _EMOJI:
rgbsps_set(LED_IND_EMOJI, 15, 15, 0); rgbsps_set(LED_IND_EMOJI, THEME_COLOR_EMOJI);
break; break;
default: default:
rgbsps_set(LED_IND_FUN, 3, 3, 3); rgbsps_set(LED_IND_GUI, THEME_COLOR_OTHERLAYER);
// rgbsps_set(LED_IND_NUM, 3, 3, 3); rgbsps_set(LED_IND_FUN, THEME_COLOR_OTHERLAYER);
rgbsps_set(LED_IND_EMOJI, 3, 3, 3); rgbsps_set(LED_IND_NUM, THEME_COLOR_OTHERLAYER);
rgbsps_set(LED_IND_PUNC, THEME_COLOR_OTHERLAYER);
rgbsps_set(LED_IND_GREEK, THEME_COLOR_OTHERLAYER);
rgbsps_set(LED_IND_EMOJI, THEME_COLOR_OTHERLAYER);
}
rgbsps_send();
} }
void led_set_unicode_input_mode(void) {
rgbsps_set(LED_IND_LINUX, COLOR_BLANK);
rgbsps_set(LED_IND_APPLE, COLOR_BLANK);
rgbsps_set(LED_IND_WINDOWS, COLOR_BLANK);
switch (get_unicode_input_mode()) {
case UC_LNX:
rgbsps_set(LED_IND_LINUX, THEME_COLOR_LINUX);
break;
case UC_OSX:
rgbsps_set(LED_IND_APPLE, THEME_COLOR_APPLE);
break;
case UC_WIN:
case UC_WINC:
rgbsps_set(LED_IND_WINDOWS, THEME_COLOR_WINDOWS);
break;
}
rgbsps_send(); rgbsps_send();
} }
void led_set_output_ble(void) { void led_set_output_ble(void) {
rgbsps_set(LED_IND_BLUETOOTH, 0, 0, 15); rgbsps_set(LED_IND_BLUETOOTH, THEME_COLOR_BLUETOOTH);
rgbsps_set(LED_IND_USB, 0, 0, 0); rgbsps_set(LED_IND_USB, COLOR_BLANK);
rgbsps_send(); rgbsps_send();
} }
void led_set_output_usb(void) { void led_set_output_usb(void) {
rgbsps_set(LED_IND_BLUETOOTH, 0, 0, 0); rgbsps_set(LED_IND_BLUETOOTH, COLOR_BLANK);
rgbsps_set(LED_IND_USB, 15, 15, 15); rgbsps_set(LED_IND_USB, THEME_COLOR_USB);
rgbsps_send(); rgbsps_send();
} }
void led_set_output_none(void) { void led_set_output_none(void) {
rgbsps_set(LED_IND_BLUETOOTH, 0, 0, 0); rgbsps_set(LED_IND_BLUETOOTH, COLOR_BLANK);
rgbsps_set(LED_IND_USB, 0, 0, 0); rgbsps_set(LED_IND_USB, COLOR_BLANK);
rgbsps_send(); rgbsps_send();
} }
@ -549,10 +645,30 @@ void led_init(void) {
rgbsps_turnoff(); rgbsps_turnoff();
// set trackpoint color // set trackpoint color
rgbsps_set(LED_TRACKPOINT1, 15, 0, 0); rgbsps_set(LED_TRACKPOINT1, THEME_COLOR_TP1);
rgbsps_set(LED_TRACKPOINT2, 0, 0, 15); rgbsps_set(LED_TRACKPOINT2, THEME_COLOR_TP2);
rgbsps_set(LED_TRACKPOINT3, 15, 0, 0); rgbsps_set(LED_TRACKPOINT3, THEME_COLOR_TP3);
// unicode input mode
led_set_unicode_input_mode();
// layer indicator
led_set_layer_indicator();
led_set_default_layer_indicator();
// clicky
#ifdef FAUXCLICKY_ENABLE
if (fauxclicky_enabled) {
rgbsps_set(LED_IND_AUDIO, THEME_COLOR_AUDIO);
} else {
rgbsps_set(LED_IND_AUDIO, COLOR_BLANK);
} }
#endif
rgbsps_send();
}
#endif // RGBSPS_ENABLE #endif // RGBSPS_ENABLE
// keymaps // keymaps
@ -574,7 +690,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT , KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT ,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
KC_LCTL, KC_LALT, KC_LGUI, EMPTY, NUM, LSPACE, RSPACE, FUN, GREEK, KC_RGUI, C_RALT, KC_RCTL KC_LCTL, KC_LALT, KC_LGUI, EMPTY, NUM, LSPACE, RSPACE, FUN, GREEK, KC_RGUI, C_RALT, KC_RCTL,
_______, _______, _______
), ),
/* Dvorak /* Dvorak
@ -593,7 +710,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______, _______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______,
_______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, _______, _______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, _______,
_______, KC_SLSH, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, _______, _______, KC_SLSH, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______
), ),
#endif #endif
@ -614,7 +732,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, _______, _______, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, _______,
_______, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, _______, _______, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, _______,
_______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______
), ),
#endif #endif
@ -635,7 +754,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, KC_Q, KC_W, KC_D, KC_F, KC_K, KC_J, KC_U, KC_R, KC_L, KC_QUOT, _______, _______, KC_Q, KC_W, KC_D, KC_F, KC_K, KC_J, KC_U, KC_R, KC_L, KC_QUOT, _______,
_______, KC_A, KC_S, KC_E, KC_T, KC_G, KC_Y, KC_N, KC_I, KC_O, KC_H, _______, _______, KC_A, KC_S, KC_E, KC_T, KC_G, KC_Y, KC_N, KC_I, KC_O, KC_H, _______,
_______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______
), ),
#endif #endif
@ -656,7 +776,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_QUOT, _______, _______, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_QUOT, _______,
_______, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, _______, _______, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, _______,
_______, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, _______, _______, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______
), ),
#endif #endif
@ -675,7 +796,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, X(LTEQ), X(GTEQ), _______, KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, X(LTEQ), X(GTEQ), _______,
KC_GRV, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, X(NOTEQ),KC_LPRN, KC_RPRN, KC_LABK, KC_RABK, _______, KC_GRV, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, X(NOTEQ),KC_LPRN, KC_RPRN, KC_LABK, KC_RABK, _______,
KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, X(PLMIN),KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, _______, KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, X(PLMIN),KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_COLN, _______ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_COLN, _______,
_______, _______, _______
), ),
/* Num /* Num
@ -690,10 +812,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------'
*/ */
[_NUM] = KEYMAP( [_NUM] = KEYMAP(
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, S(KC_A), KC_7, KC_8, KC_9, S(KC_D), _______, KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, S(KC_A), KC_1, KC_2, KC_3, S(KC_D), _______,
KC_GRV, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, S(KC_B), KC_4, KC_5, KC_6, S(KC_E), _______, KC_GRV, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, S(KC_B), KC_4, KC_5, KC_6, S(KC_E), _______,
KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, S(KC_C), KC_1, KC_2, KC_3, S(KC_F), _______, KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, S(KC_C), KC_7, KC_8, KC_9, S(KC_F), _______,
_______, _______, KC_X, _______, _______, _______, _______, FUN0 , KC_COMM, KC_DOT, KC_COLN, _______ _______, _______, KC_X, _______, _______, _______, _______, FUN0 , KC_COMM, KC_DOT, KC_COLN, _______,
_______, _______, _______
), ),
/* Func /* Func
@ -711,7 +834,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_INS, XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_PGUP, KC_DEL, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_INS, XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_PGUP, KC_DEL,
KC_CAPS, KC_F5, KC_F6, KC_F7, KC_F8, KC_PSCR, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, KC_CAPS, KC_F5, KC_F6, KC_F7, KC_F8, KC_PSCR, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______,
_______, KC_F9, KC_F10, KC_F11, KC_F12, KC_PAUS, XXXXXXX, XXXXXXX, KC_HOME, KC_END, XXXXXXX, _______, _______, KC_F9, KC_F10, KC_F11, KC_F12, KC_PAUS, XXXXXXX, XXXXXXX, KC_HOME, KC_END, XXXXXXX, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______
), ),
/* Uppercase Greek /* Uppercase Greek
@ -729,7 +853,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, XXXXXXX, XXXXXXX,X(UEPSI), X(URHO), X(UTAU),X(UUPSI),X(UTHET),X(UIOTA),X(UOMIC), X(UPI), _______, _______, XXXXXXX, XXXXXXX,X(UEPSI), X(URHO), X(UTAU),X(UUPSI),X(UTHET),X(UIOTA),X(UOMIC), X(UPI), _______,
_______,X(UALPH),X(USIGM),X(UDELT), X(UPHI),X(UGAMM), X(UETA), X(UXI),X(UKAPP),X(ULAMB), KC_QUOT, _______, _______,X(UALPH),X(USIGM),X(UDELT), X(UPHI),X(UGAMM), X(UETA), X(UXI),X(UKAPP),X(ULAMB), KC_QUOT, _______,
_______,X(UZETA), X(UCHI), X(UPSI),X(UOMEG),X(UBETA), X(UNU), X(UMU), KC_COMM, KC_DOT, KC_SLSH, _______, _______,X(UZETA), X(UCHI), X(UPSI),X(UOMEG),X(UBETA), X(UNU), X(UMU), KC_COMM, KC_DOT, KC_SLSH, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______
), ),
/* Lowercase Greek /* Lowercase Greek
@ -747,7 +872,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, XXXXXXX,X(FSIGM),X(LEPSI), X(LRHO), X(LTAU),X(LUPSI),X(LTHET),X(LIOTA),X(LOMIC), X(LPI), _______, _______, XXXXXXX,X(FSIGM),X(LEPSI), X(LRHO), X(LTAU),X(LUPSI),X(LTHET),X(LIOTA),X(LOMIC), X(LPI), _______,
_______,X(LALPH),X(LSIGM),X(LDELT), X(LPHI),X(LGAMM), X(LETA), X(LXI),X(LKAPP),X(LLAMB), KC_QUOT, _______, _______,X(LALPH),X(LSIGM),X(LDELT), X(LPHI),X(LGAMM), X(LETA), X(LXI),X(LKAPP),X(LLAMB), KC_QUOT, _______,
_______,X(LZETA), X(LCHI), X(LPSI),X(LOMEG),X(LBETA), X(LNU), X(LMU), KC_COMM, KC_DOT, KC_SLSH, _______, _______,X(LZETA), X(LCHI), X(LPSI),X(LOMEG),X(LBETA), X(LNU), X(LMU), KC_COMM, KC_DOT, KC_SLSH, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______
), ),
/* Empty /* Empty
@ -765,7 +891,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______
), ),
/* Emoji /* Emoji
@ -783,7 +910,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
X(HART2), X(CRY2),X(WEARY),X(EYERT),X(SMIRK), X(TJOY),X(RECYC),X(UNAMU),X(MUSIC),X(OKHND),X(PENSV), X(PHEW), X(HART2), X(CRY2),X(WEARY),X(EYERT),X(SMIRK), X(TJOY),X(RECYC),X(UNAMU),X(MUSIC),X(OKHND),X(PENSV), X(PHEW),
X(THMUP), X(PRAY),X(SMILE),X(SMIL2),X(FLUSH), X(GRIN),X(HEART), X(BYE), X(KISS),X(CELEB), X(COOL),X(NOEVS), X(THMUP), X(PRAY),X(SMILE),X(SMIL2),X(FLUSH), X(GRIN),X(HEART), X(BYE), X(KISS),X(CELEB), X(COOL),X(NOEVS),
X(THMDN),X(SLEEP), X(CLAP), X(CRY), X(VIC),X(BHART), X(SUN),X(SMEYE), X(WINK), X(MOON),X(CONFU),X(NOEVH), X(THMDN),X(SLEEP), X(CLAP), X(CRY), X(VIC),X(BHART), X(SUN),X(SMEYE), X(WINK), X(MOON),X(CONFU),X(NOEVH),
X(POO), X(EYES), X(HUNRD),_______, X(SKULL),X(HORNS), X(HALO), X(FEAR),_______,X(YUMMY),X(DISAP),X(NOEVK) X(POO), X(EYES), X(HUNRD),_______, X(SKULL),X(HORNS), X(HALO), X(FEAR),_______,X(YUMMY),X(DISAP),X(NOEVK),
_______, _______, _______
), ),
/* GUI /* GUI
@ -801,7 +929,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
XXXXXXX, G(KC_1), G(KC_2), G(KC_3), G(KC_4), G(KC_5), G(KC_6), G(KC_7), G(KC_8), G(KC_9), G(KC_0), XXXXXXX, XXXXXXX, G(KC_1), G(KC_2), G(KC_3), G(KC_4), G(KC_5), G(KC_6), G(KC_7), G(KC_8), G(KC_9), G(KC_0), XXXXXXX,
KC_ESC, XXXXXXX, S(KC_TAB),KC_ESC, KC_TAB, XXXXXXX, XXXXXXX, KC_WWWB, XXXXXXX, KC_WWWF, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, S(KC_TAB),KC_ESC, KC_TAB, XXXXXXX, XXXXXXX, KC_WWWB, XXXXXXX, KC_WWWF, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU, KC_SPC, KC_SPC, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU, KC_SPC, KC_SPC, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, _______, _______
), ),
/* Sys /* Sys
@ -816,10 +945,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------'
*/ */
[_SYS] = KEYMAP( [_SYS] = KEYMAP(
XXXXXXX, QWERTY, WIN, XXXXXXX, RESET, XXXXXXX, XXXXXXX, OUT_USB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DEBUG, QWERTY, WIN, XXXXXXX, RESET, XXXXXXX, XXXXXXX, OUT_USB, XXXXXXX, XXXXXXX, XXXXXXX, RGBDEMO,
XXXXXXX, FC_TOG, XXXXXXX, DVORAK, XXXXXXX, GLOW, XXXXXXX, XXXXXXX, WORKMAN, LINUX, XXXXXXX, XXXXXXX, XXXXXXX, FC_TOG, XXXXXXX, DVORAK, XXXXXXX, GLOW, XXXXXXX, XXXXXXX, WORKMAN, LINUX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, COLEMAK, XXXXXXX, OUT_BLE, NORMAN, OSX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, COLEMAK, XXXXXXX, OUT_BT, NORMAN, OSX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______ _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
_______, _______, _______
), ),
@ -828,6 +958,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
void persistant_default_layer_set(uint16_t default_layer) { void persistant_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
#ifdef RGBSPS_ENABLE
led_set_default_layer_indicator();
#endif
} }
#ifdef DOUBLESPACE_LAYER_ENABLE #ifdef DOUBLESPACE_LAYER_ENABLE
@ -1072,14 +1205,23 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
// OS switchers // OS switchers
case LINUX: case LINUX:
set_unicode_input_mode(UC_LNX); set_unicode_input_mode(UC_LNX);
#ifdef RGBSPS_ENABLE
led_set_unicode_input_mode();
#endif
return false; return false;
break; break;
case WIN: case WIN:
set_unicode_input_mode(UC_WINC); set_unicode_input_mode(UC_WINC);
#ifdef RGBSPS_ENABLE
led_set_unicode_input_mode();
#endif
return false; return false;
break; break;
case OSX: case OSX:
set_unicode_input_mode(UC_OSX); set_unicode_input_mode(UC_OSX);
#ifdef RGBSPS_ENABLE
led_set_unicode_input_mode();
#endif
return false; return false;
break; break;
@ -1101,20 +1243,35 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
// faux clicky indicator // faux clicky indicator
#ifdef FAUXCLICKY_ENABLE #ifdef FAUXCLICKY_ENABLE
case FC_TOG: case FC_TOG:
#ifdef RGBSPS_ENABLE
if (fauxclicky_enabled) {
rgbsps_set(LED_IND_AUDIO, THEME_COLOR_AUDIO);
} else {
rgbsps_set(LED_IND_AUDIO, COLOR_BLANK);
}
rgbsps_send();
#endif
return true; return true;
break; break;
#endif #endif
#ifdef RGBSPS_DEMO_ENABLE
case RGBDEMO:
led_demo();
return false;
break;
#endif
} }
return true; return true;
} }
void set_output_user(uint8_t output) { void set_output_user(uint8_t output) {
#ifdef ADAFRUIT_BLE_ENABLE #ifdef MODULE_ADAFRUIT_BLE
switch(output) { switch(output) {
case OUTPUT_USB: case OUTPUT_USB:
led_set_output_usb(); led_set_output_usb();
break; break;
case OUTPUT_ADAFRUIT_BLE: case OUTPUT_BLUETOOTH:
led_set_output_ble(); led_set_output_ble();
break; break;
default: default:
@ -1133,12 +1290,12 @@ void matrix_init_user() {
#endif #endif
// auto detect output on init // auto detect output on init
#ifdef ADAFRUIT_BLE_ENABLE #ifdef MODULE_ADAFRUIT_BLE
uint8_t output = auto_detect_output(); uint8_t output = auto_detect_output();
if (output == OUTPUT_USB) { if (output == OUTPUT_USB) {
set_output(OUTPUT_USB); set_output(OUTPUT_USB);
} else { } else {
set_output(OUTPUT_ADAFRUIT_BLE); set_output(OUTPUT_BLUETOOTH);
} }
#endif #endif
} }
@ -1164,9 +1321,9 @@ void turn_off_capslock() {
bool new_capslock = usb_led & (1<<USB_LED_CAPS_LOCK); bool new_capslock = usb_led & (1<<USB_LED_CAPS_LOCK);
if (new_capslock ^ capslock) { // capslock state is different if (new_capslock ^ capslock) { // capslock state is different
if ((capslock = new_capslock)) { if ((capslock = new_capslock)) {
rgbsps_set(LED_IND_NUM, 15, 0, 0); rgbsps_set(LED_IND_CAPSLOCK, THEME_COLOR_CAPSLOCK);
} else { } else {
rgbsps_set(LED_IND_NUM, 0, 0, 0); rgbsps_set(LED_IND_CAPSLOCK, COLOR_BLANK);
} }
rgbsps_send(); rgbsps_send();
} }

@ -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)
{
}

@ -2,6 +2,11 @@
#include "analog.h" #include "analog.h"
#include "timer.h" #include "timer.h"
#include "matrix.h" #include "matrix.h"
#include "musical_notes.h"
float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_A4, 0.0625);
float fauxclicky_released_note[2] = MUSICAL_NOTE(_A4, 0.0625);
float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C6, 0.25);
// cubic fit {3.3, 0}, {3.5, 2.9}, {3.6, 5}, {3.7, 8.6}, {3.8, 36}, {3.9, 62}, {4.0, 73}, {4.05, 83}, {4.1, 89}, {4.15, 94}, {4.2, 100} // cubic fit {3.3, 0}, {3.5, 2.9}, {3.6, 5}, {3.7, 8.6}, {3.8, 36}, {3.9, 62}, {4.0, 73}, {4.05, 83}, {4.1, 89}, {4.15, 94}, {4.2, 100}

@ -65,8 +65,9 @@ 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. RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
PS2_MOUSE_ENABLE ?= yes PS2_MOUSE_ENABLE ?= yes
PS2_USE_INT ?= yes PS2_USE_INT ?= yes
ADAFRUIT_BLE_ENABLE ?= yes
API_SYSEX_ENABLE ?= no API_SYSEX_ENABLE ?= no
CUSTOM_MATRIX ?= yes
BLUETOOTH ?= AdafruitBLE
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
@ -74,3 +75,4 @@ SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
SRC += $(QUANTUM_DIR)/light_ws2812.c SRC += $(QUANTUM_DIR)/light_ws2812.c
SRC += rgbsps.c SRC += rgbsps.c
SRC += $(QUANTUM_DIR)/analog.c SRC += $(QUANTUM_DIR)/analog.c
SRC += matrix.c

@ -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;
}

@ -53,7 +53,7 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
#OPT_DEFS += -DBOOTLOADER_SIZE=4096 #OPT_DEFS += -DBOOTLOADER_SIZE=4096
# as per original hasu settings # as per original hasu settings
OPT_DEFS += -DBOOTLOADER_SIZE=512 OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options # Build Options
# comment out to disable the options. # comment out to disable the options.

@ -22,7 +22,7 @@
#undef MOUSEKEY_WHEEL_MAX_SPEED #undef MOUSEKEY_WHEEL_MAX_SPEED
#define MOUSEKEY_WHEEL_MAX_SPEED 3 #define MOUSEKEY_WHEEL_MAX_SPEED 3
#undef MOUSEKEY_WHEEL_TIME_TO_MAX #undef MOUSEKEY_WHEEL_TIME_TO_MAX
#define MOUSEKEY_WHEEL_TIME_TO_MAX 1000 #define MOUSEKEY_WHEEL_TIME_TO_MAX 255
#undef ONESHOT_TIMEOUT #undef ONESHOT_TIMEOUT
#define ONESHOT_TIMEOUT 500 #define ONESHOT_TIMEOUT 500
#undef TAPPING_TOGGLE #undef TAPPING_TOGGLE

@ -0,0 +1,3 @@
ifndef MAKEFILE_INCLUDED
include ../../Makefile
endif

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save