Merge branch 'master' of https://github.com/jackhumbert/qmk_firmware
@ -0,0 +1,83 @@
|
||||
#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 _CL 2
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap _BL: Base Layer (Default Layer)
|
||||
*/
|
||||
[_BL] = KEYMAP(
|
||||
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_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, \
|
||||
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),
|
||||
|
||||
/* Keymap _FL: Function Layer
|
||||
*/
|
||||
[_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, \
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK, KC_PAUS, _______, _______, _______, _______, \
|
||||
_______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_PGUP, \
|
||||
_______, _______, _______, _______, _______,_______, _______, _______, _______, MO(_FL), KC_HOME, KC_PGDN, KC_END),
|
||||
|
||||
/* 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()
|
||||
};
|
||||
|
||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
static uint8_t mods_pressed;
|
||||
|
||||
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) {
|
||||
add_key(KC_GRV);
|
||||
send_keyboard_report();
|
||||
} else {
|
||||
add_key(KC_ESC);
|
||||
send_keyboard_report();
|
||||
}
|
||||
} else {
|
||||
/* The key is being released.
|
||||
*/
|
||||
if (mods_pressed) {
|
||||
del_key(KC_GRV);
|
||||
send_keyboard_report();
|
||||
} else {
|
||||
del_key(KC_ESC);
|
||||
send_keyboard_report();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 110 KiB |
@ -0,0 +1,15 @@
|
||||
```
|
||||
___ _____ _ _ _ __ __ _ __
|
||||
|__ \ / ____| | | | | | / / / /(_) / /
|
||||
||) | | | | |_ _ ___| |__ ___ __ _ _ __ __| | / /_ / /_ / /
|
||||
|/ / | | | | | | |/ _ \ '_ \ / _ \ / _` | '__/ _` | | '_ \| '_ \ / /
|
||||
|_| | |____| | |_| | __/ |_) | (_) | (_| | | | (_| | | (_) | (_) / / _
|
||||
(_) \_____|_|\__,_|\___|_.__/ \___/ \__,_|_| \__,_| \___/ \___/_/ (_)
|
||||
```
|
||||
|
||||
![Clueboard Layout Image](layout.png)
|
||||
|
||||
# Caps Fn Layout
|
||||
|
||||
This is the default layout except that Caps Lock acts like Caps Lock when
|
||||
tapped but Fn when held.
|
After Width: | Height: | Size: 110 KiB |
@ -0,0 +1,17 @@
|
||||
```
|
||||
___ _____ _ _ _ __ __ _ __
|
||||
|__ \ / ____| | | | | | / / / /(_) / /
|
||||
||) | | | | |_ _ ___| |__ ___ __ _ _ __ __| | / /_ / /_ / /
|
||||
|/ / | | | | | | |/ _ \ '_ \ / _ \ / _` | '__/ _` | | '_ \| '_ \ / /
|
||||
|_| | |____| | |_| | __/ |_) | (_) | (_| | | | (_| | | (_) | (_) / / _
|
||||
(_) \_____|_|\__,_|\___|_.__/ \___/ \__,_|_| \__,_| \___/ \___/_/ (_)
|
||||
```
|
||||
|
||||
![Clueboard Layout Image](layout.png)
|
||||
|
||||
# Default Clueboard Layout
|
||||
|
||||
This is the default layout that comes flashed on every Clueboard. For the most
|
||||
part it's a straightforward and easy to follow layout. The only unusual key is
|
||||
the key in the upper left, which sends Escape normally, but Grave when any of
|
||||
the Ctrl, Alt, or GUI modifiers are held down.
|
@ -0,0 +1,83 @@
|
||||
#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 _CL 2
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap _BL: Base Layer (Default Layer)
|
||||
*/
|
||||
[_BL] = KEYMAP(
|
||||
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_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, \
|
||||
KC_LCTL, KC_LALT, KC_LGUI,KC_MHEN, KC_SPC, KC_SPC, KC_HENK, KC_RGUI, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT),
|
||||
|
||||
/* Keymap _FL: Function Layer
|
||||
*/
|
||||
[_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, \
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_PGUP, \
|
||||
_______, _______, _______, _______, _______,_______, _______, _______, _______, MO(_FL), KC_HOME, KC_PGDN, KC_END),
|
||||
|
||||
/* 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()
|
||||
};
|
||||
|
||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
static uint8_t mods_pressed;
|
||||
|
||||
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) {
|
||||
add_key(KC_GRV);
|
||||
send_keyboard_report();
|
||||
} else {
|
||||
add_key(KC_ESC);
|
||||
send_keyboard_report();
|
||||
}
|
||||
} else {
|
||||
/* The key is being released.
|
||||
*/
|
||||
if (mods_pressed) {
|
||||
del_key(KC_GRV);
|
||||
send_keyboard_report();
|
||||
} else {
|
||||
del_key(KC_ESC);
|
||||
send_keyboard_report();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 105 KiB |
@ -0,0 +1,15 @@
|
||||
```
|
||||
___ _____ _ _ _ __ __ _ __
|
||||
|__ \ / ____| | | | | | / / / /(_) / /
|
||||
||) | | | | |_ _ ___| |__ ___ __ _ _ __ __| | / /_ / /_ / /
|
||||
|/ / | | | | | | |/ _ \ '_ \ / _ \ / _` | '__/ _` | | '_ \| '_ \ / /
|
||||
|_| | |____| | |_| | __/ |_) | (_) | (_| | | | (_| | | (_) | (_) / / _
|
||||
(_) \_____|_|\__,_|\___|_.__/ \___/ \__,_|_| \__,_| \___/ \___/_/ (_)
|
||||
```
|
||||
|
||||
![Clueboard Layout Image](layout.png)
|
||||
|
||||
# Default Clueboard Layout for Mac
|
||||
|
||||
This is the default Clueboard layout with Alt and GUI switched to match Mac
|
||||
conventions.
|
@ -1,49 +0,0 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# On command line:
|
||||
#
|
||||
# make all = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# make coff = Convert ELF to AVR COFF.
|
||||
#
|
||||
# make extcoff = Convert ELF to AVR Extended COFF.
|
||||
#
|
||||
# make program = Download the hex file to the device.
|
||||
# Please customize your programmer settings(PROGRAM_CMD)
|
||||
#
|
||||
# make teensy = Download the hex file to the device, using teensy_loader_cli.
|
||||
# (must have teensy_loader_cli installed).
|
||||
#
|
||||
# make dfu = Download the hex file to the device, using dfu-programmer (must
|
||||
# have dfu-programmer installed).
|
||||
#
|
||||
# make flip = Download the hex file to the device, using Atmel FLIP (must
|
||||
# have Atmel FLIP installed).
|
||||
#
|
||||
# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
|
||||
# (must have dfu-programmer installed).
|
||||
#
|
||||
# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
|
||||
# (must have Atmel FLIP installed).
|
||||
#
|
||||
# make debug = Start either simulavr or avarice as specified for debugging,
|
||||
# with avr-gdb or avr-insight as the front end for debugging.
|
||||
#
|
||||
# make filename.s = Just compile filename.c into the assembler code only.
|
||||
#
|
||||
# make filename.i = Create a preprocessed source file for use in submitting
|
||||
# bug reports to the GCC project.
|
||||
#
|
||||
# To rebuild project do "make clean" then "make all".
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the makefile.mk in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
@ -1,85 +0,0 @@
|
||||
#include "clueboard.h"
|
||||
|
||||
// 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 _RS 2
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap _BL: (Base Layer) Default Layer
|
||||
* ,--------------------------------------------------------------------------. ,----.
|
||||
* | Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| ~| BS| |PgUp|
|
||||
* |--------------------------------------------------------------------------| |----|
|
||||
* | Tab| Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |PgDn|
|
||||
* |--------------------------------------------------------------------------| `----'
|
||||
* |Capslck| A| S| D| F| G| H| J| K| L| ;| '| # | Ent|
|
||||
* |-----------------------------------------------------------------------------.
|
||||
* |Shift| BS| Z| X| C| V| B| N| M| ,| .| /| BS|Shift| Up|
|
||||
* |------------------------------------------------------------------------|----|----.
|
||||
* | Ctrl| Alt| Gui| MHen| Space| Space| Hen| Gui| Alt| Ctrl|Left|Down|Rght|
|
||||
* `----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_BL] = 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_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_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, \
|
||||
MO(_FL), 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(_FL), KC_UP, \
|
||||
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
|
||||
* ,--------------------------------------------------------------------------. ,----.
|
||||
* | `| F1| F2| F3| F4| F5| F6| F7| F8| F9| F10| F11| F12| | Del| |BLIN|
|
||||
* |--------------------------------------------------------------------------| |----|
|
||||
* | | | | | | | | |PScr|SLck|Paus| | | | |BLDE|
|
||||
* |--------------------------------------------------------------------------| `----'
|
||||
* | | | _RS| | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | |PGUP|
|
||||
* |------------------------------------------------------------------------|----|----.
|
||||
* | | | | | | | | | | _FL|HOME|PGDN| END|
|
||||
* `----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_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_TRNS, KC_DEL, BL_STEP, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, MO(_RS),KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
MO(_FL), KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(_FL), KC_PGUP, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END),
|
||||
|
||||
/* Keymap _RS: Reset/Underlight layer
|
||||
* ,--------------------------------------------------------------------------. ,----.
|
||||
* | | | | | | | | | | | | | | | | | |
|
||||
* |--------------------------------------------------------------------------| |----|
|
||||
* | | | | |RESET| | | | | | | | | | | |
|
||||
* |--------------------------------------------------------------------------| `----'
|
||||
* | | | _RS| | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |------------------------------------------------------------------------|----|----.
|
||||
* | | | | | | | | | | _FL| | | |
|
||||
* `----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_RS] = KEYMAP(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_VAI, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAD, \
|
||||
KC_TRNS, KC_TRNS, MO(_RS),KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
MO(_FL), KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(_FL), RGB_SAI, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, RGB_MOD, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_HUD, RGB_SAD, RGB_HUI),
|
||||
};
|
||||
|
||||
/*enum function_id {
|
||||
};*/
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
};
|
||||
|
||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
switch (id) {
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
#include "clueboard.h"
|
||||
|
||||
// Helpful defines
|
||||
#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 _CL 2
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap _BL: Base Layer (Default Layer)
|
||||
*/
|
||||
[_BL] = 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_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_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, \
|
||||
MO(_FL), 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(_FL), KC_UP, \
|
||||
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
|
||||
*/
|
||||
[_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, \
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,_______,KC_SLCK, KC_PAUS, _______, _______, _______, _______, \
|
||||
_______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
|
||||
MO(_FL), _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, MO(_FL), KC_PGUP, \
|
||||
_______, _______, _______,_______, _______,_______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END),
|
||||
|
||||
/* Keymap _CL: Reset/Underlight 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),
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
};
|
||||
|
||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
};
|
After Width: | Height: | Size: 109 KiB |
@ -0,0 +1,14 @@
|
||||
```
|
||||
___ _____ _ _ _ __ __ _ __
|
||||
|__ \ / ____| | | | | | / / / /(_) / /
|
||||
||) | | | | |_ _ ___| |__ ___ __ _ _ __ __| | / /_ / /_ / /
|
||||
|/ / | | | | | | |/ _ \ '_ \ / _ \ / _` | '__/ _` | | '_ \| '_ \ / /
|
||||
|_| | |____| | |_| | __/ |_) | (_) | (_| | | | (_| | | (_) | (_) / / _
|
||||
(_) \_____|_|\__,_|\___|_.__/ \___/ \__,_|_| \__,_| \___/ \___/_/ (_)
|
||||
```
|
||||
|
||||
![Clueboard Layout Image](layout.png)
|
||||
|
||||
# Maximised Clueboard Layout
|
||||
|
||||
This layout is intended for a board with one or both shifts split. The outside key on the split shift is an Fn, while the inside is shift. The bottom row has all the mods on both sides, optimised for a Mac.
|
@ -0,0 +1 @@
|
||||
MOUSEKEY_ENABLE = yes
|
@ -0,0 +1,93 @@
|
||||
#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 _CL 2
|
||||
#define _ML 3
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap _BL: Base Layer (Default Layer)
|
||||
*/
|
||||
[_BL] = KEYMAP(
|
||||
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_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, \
|
||||
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),
|
||||
|
||||
/* Keymap _FL: Function Layer
|
||||
*/
|
||||
[_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, \
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK, KC_PAUS, _______, _______, _______, _______, \
|
||||
_______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_PGUP, \
|
||||
_______, _______, _______, _______, _______,_______, _______, _______, _______, MO(_FL), KC_HOME, KC_PGDN, KC_END),
|
||||
|
||||
/* 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),
|
||||
|
||||
/* Keymap _ML: Mouse layer
|
||||
*/
|
||||
[_ML] = KEYMAP(
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, KC_BTN3,KC_BTN2,KC_BTN1,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_MS_U, \
|
||||
_______, _______, _______,_______, LT(_ML, KC_SPC),LT(_ML, KC_SPC), _______, KC_BTN1, KC_BTN2, KC_BTN3, KC_MS_L, KC_MS_D,KC_MS_R),
|
||||
};
|
||||
|
||||
/* 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()
|
||||
};
|
||||
|
||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
static uint8_t mods_pressed;
|
||||
|
||||
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) {
|
||||
add_key(KC_GRV);
|
||||
send_keyboard_report();
|
||||
} else {
|
||||
add_key(KC_ESC);
|
||||
send_keyboard_report();
|
||||
}
|
||||
} else {
|
||||
/* The key is being released.
|
||||
*/
|
||||
if (mods_pressed) {
|
||||
del_key(KC_GRV);
|
||||
send_keyboard_report();
|
||||
} else {
|
||||
del_key(KC_ESC);
|
||||
send_keyboard_report();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 140 KiB |
@ -0,0 +1,16 @@
|
||||
```
|
||||
___ _____ _ _ _ __ __ _ __
|
||||
|__ \ / ____| | | | | | / / / /(_) / /
|
||||
||) | | | | |_ _ ___| |__ ___ __ _ _ __ __| | / /_ / /_ / /
|
||||
|/ / | | | | | | |/ _ \ '_ \ / _ \ / _` | '__/ _` | | '_ \| '_ \ / /
|
||||
|_| | |____| | |_| | __/ |_) | (_) | (_| | | | (_| | | (_) | (_) / / _
|
||||
(_) \_____|_|\__,_|\___|_.__/ \___/ \__,_|_| \__,_| \___/ \___/_/ (_)
|
||||
```
|
||||
|
||||
![Clueboard Layout Image](layout.png)
|
||||
|
||||
# MouseKeys Layout
|
||||
|
||||
This layout adds a mouse layer. When you hold down the spacebar the arrow keys
|
||||
will move your mouse cursor. You can click using the 3 mods to the left of the
|
||||
arrow keys, or the 3 keys under your primary fingers on the home row.
|
@ -0,0 +1,83 @@
|
||||
#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 _CL 2
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap _BL: Base Layer (Default Layer)
|
||||
*/
|
||||
[_BL] = KEYMAP(
|
||||
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_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, \
|
||||
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),
|
||||
|
||||
/* Keymap _FL: Function Layer
|
||||
*/
|
||||
[_FL] = KEYMAP(
|
||||
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, \
|
||||
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), \
|
||||
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),
|
||||
|
||||
/* 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()
|
||||
};
|
||||
|
||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
static uint8_t mods_pressed;
|
||||
|
||||
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) {
|
||||
add_key(KC_GRV);
|
||||
send_keyboard_report();
|
||||
} else {
|
||||
add_key(KC_ESC);
|
||||
send_keyboard_report();
|
||||
}
|
||||
} else {
|
||||
/* The key is being released.
|
||||
*/
|
||||
if (mods_pressed) {
|
||||
del_key(KC_GRV);
|
||||
send_keyboard_report();
|
||||
} else {
|
||||
del_key(KC_ESC);
|
||||
send_keyboard_report();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 105 KiB |
@ -0,0 +1,17 @@
|
||||
```
|
||||
___ _____ _ _ _ __ __ _ __
|
||||
|__ \ / ____| | | | | | / / / /(_) / /
|
||||
||) | | | | |_ _ ___| |__ ___ __ _ _ __ __| | / /_ / /_ / /
|
||||
|/ / | | | | | | |/ _ \ '_ \ / _ \ / _` | '__/ _` | | '_ \| '_ \ / /
|
||||
|_| | |____| | |_| | __/ |_) | (_) | (_| | | | (_| | | (_) | (_) / / _
|
||||
(_) \_____|_|\__,_|\___|_.__/ \___/ \__,_|_| \__,_| \___/ \___/_/ (_)
|
||||
```
|
||||
|
||||
![Clueboard Layout Image](layout.png)
|
||||
|
||||
# Shift Fn Clueboard Layout
|
||||
|
||||
This is an experimental layout. It makes the left shift key a dual roll key.
|
||||
For most keys it acts as a shift key, but for some keys it activates an
|
||||
alternate function instead. Primarily I use this to access the F-keys under
|
||||
the number rows.
|
After Width: | Height: | Size: 109 KiB |
@ -0,0 +1,83 @@
|
||||
#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 _CL 2
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap _BL: Base Layer (Default Layer)
|
||||
*/
|
||||
[_BL] = KEYMAP(
|
||||
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_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, \
|
||||
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),
|
||||
|
||||
/* Keymap _FL: Function Layer
|
||||
*/
|
||||
[_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, KC_INS, \
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK, KC_PAUS, _______, _______, _______, KC_DEL, \
|
||||
_______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_PGUP, \
|
||||
_______, _______, _______, _______, _______,_______, _______, _______, _______, MO(_FL), KC_HOME, KC_PGDN, KC_END),
|
||||
|
||||
/* 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()
|
||||
};
|
||||
|
||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
static uint8_t mods_pressed;
|
||||
|
||||
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) {
|
||||
add_key(KC_GRV);
|
||||
send_keyboard_report();
|
||||
} else {
|
||||
add_key(KC_ESC);
|
||||
send_keyboard_report();
|
||||
}
|
||||
} else {
|
||||
/* The key is being released.
|
||||
*/
|
||||
if (mods_pressed) {
|
||||
del_key(KC_GRV);
|
||||
send_keyboard_report();
|
||||
} else {
|
||||
del_key(KC_ESC);
|
||||
send_keyboard_report();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 109 KiB |
@ -0,0 +1,15 @@
|
||||
```
|
||||
___ _____ _ _ _ __ __ _ __
|
||||
|__ \ / ____| | | | | | / / / /(_) / /
|
||||
||) | | | | |_ _ ___| |__ ___ __ _ _ __ __| | / /_ / /_ / /
|
||||
|/ / | | | | | | |/ _ \ '_ \ / _ \ / _` | '__/ _` | | '_ \| '_ \ / /
|
||||
|_| | |____| | |_| | __/ |_) | (_) | (_| | | | (_| | | (_) | (_) / / _
|
||||
(_) \_____|_|\__,_|\___|_.__/ \___/ \__,_|_| \__,_| \___/ \___/_/ (_)
|
||||
```
|
||||
|
||||
![Clueboard Layout Image](layout.png)
|
||||
|
||||
# Default Clueboard Layout
|
||||
|
||||
This is the default layout except that Caps Lock has been changed to Control
|
||||
and Insert and Delete have been put into the Fn layer.
|
@ -0,0 +1,83 @@
|
||||
#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 _CL 2
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap _BL: Base Layer (Default Layer)
|
||||
*/
|
||||
[_BL] = KEYMAP(
|
||||
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_INS, \
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, \
|
||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \
|
||||
KC_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_RALT, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT),
|
||||
|
||||
/* Keymap _FL: Function Layer
|
||||
*/
|
||||
[_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, \
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK, KC_PAUS, _______, _______, _______, _______, \
|
||||
_______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_PGUP, \
|
||||
_______, _______, _______, _______, _______,_______, _______, _______, _______, MO(_FL), KC_HOME, KC_PGDN, KC_END),
|
||||
|
||||
/* 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()
|
||||
};
|
||||
|
||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
static uint8_t mods_pressed;
|
||||
|
||||
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) {
|
||||
add_key(KC_GRV);
|
||||
send_keyboard_report();
|
||||
} else {
|
||||
add_key(KC_ESC);
|
||||
send_keyboard_report();
|
||||
}
|
||||
} else {
|
||||
/* The key is being released.
|
||||
*/
|
||||
if (mods_pressed) {
|
||||
del_key(KC_GRV);
|
||||
send_keyboard_report();
|
||||
} else {
|
||||
del_key(KC_ESC);
|
||||
send_keyboard_report();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 108 KiB |
@ -0,0 +1,17 @@
|
||||
```
|
||||
___ _____ _ _ _ __ __ _ __
|
||||
|__ \ / ____| | | | | | / / / /(_) / /
|
||||
||) | | | | |_ _ ___| |__ ___ __ _ _ __ __| | / /_ / /_ / /
|
||||
|/ / | | | | | | |/ _ \ '_ \ / _ \ / _` | '__/ _` | | '_ \| '_ \ / /
|
||||
|_| | |____| | |_| | __/ |_) | (_) | (_| | | | (_| | | (_) | (_) / / _
|
||||
(_) \_____|_|\__,_|\___|_.__/ \___/ \__,_|_| \__,_| \___/ \___/_/ (_)
|
||||
```
|
||||
|
||||
![Clueboard Layout Image](layout.png)
|
||||
|
||||
# Default Clueboard Layout
|
||||
|
||||
This is the default layout that comes flashed on every Clueboard. For the most
|
||||
part it's a straightforward and easy to follow layout. The only unusual key is
|
||||
the key in the upper left, which sends Escape normally, but Grave when any of
|
||||
the Ctrl, Alt, or GUI modifiers are held down.
|
@ -0,0 +1 @@
|
||||
TAP_DANCE_ENABLE = no
|
After Width: | Height: | Size: 294 KiB |
After Width: | Height: | Size: 230 KiB |
@ -0,0 +1,256 @@
|
||||
#include "ergodox.h"
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap 0: Basic layer
|
||||
* MEH: Alt+Control+Shift
|
||||
* HYPER: Alt+Control+Shift+Gui
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | ` ~ | 1 ! | 2 @ | 3 # | 4 $ | 5 % | 6 ^ | | 7 & | 8 * | 9 ( | 0 ) | - _ | = + | Backsp |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | TAB | Q | W | F | P | G |TG(3) | |TG(4) | J | L | U | Y | ; : | ' " |
|
||||
* |--------+------+------+------+------+------|F-lck | |N-lck |------+------+------+------+------+--------|
|
||||
* | CAPS | A | R | S | T | D |------| |------| H | N | E | I | O | ENT |
|
||||
* |--------+------+------+------+------+------| MEH | | MEH |------+------+------+------+------+--------|
|
||||
* | Shift | Z | X | C | V | B | | | | K | M | , < | . > | UP | Shift |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | LCTL | LCTL | LGUI | LALT | LGUI | | RALT | RCTL | LEFT | DOWN | RIGHT|
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,--------------. ,--------------.
|
||||
* | Esc | App | | Ins | Del |
|
||||
* ,------|------|-------| |------+-------+------.
|
||||
* | | | Home | | PgUp | | |
|
||||
* | MO(2)| MO(4)|-------| |------| Space |Space |
|
||||
* |symbol|N-Lock| End | | PgDn | | |
|
||||
* `---------------------' `---------------------'
|
||||
*/
|
||||
[0] = KEYMAP( // layer 0 : default
|
||||
// left hand
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6,
|
||||
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, TG(3),
|
||||
KC_CAPS, KC_A, KC_R, KC_S, KC_T, KC_D,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MEH,
|
||||
KC_LCTL, KC_LCTL, KC_LGUI, KC_LALT, KC_LGUI,
|
||||
|
||||
KC_ESC, KC_APP,
|
||||
KC_HOME,
|
||||
MO(2), MO(4), KC_END,
|
||||
|
||||
// right hand
|
||||
KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,
|
||||
TG(4), KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_QUOT,
|
||||
KC_H, KC_N, KC_E, KC_I, KC_O, KC_ENT,
|
||||
KC_MEH, KC_K, KC_M, KC_COMM, KC_DOT, KC_UP, KC_RSFT,
|
||||
KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT,
|
||||
|
||||
KC_INS, KC_DEL,
|
||||
KC_PGUP,
|
||||
KC_PGDN, KC_SPC, KC_SPC
|
||||
),
|
||||
|
||||
/* Keymap 1: QWERTY layer (games)
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | Q | W | E | R | T | | | | Y | U | I | O | P | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | A | S | D | F | G |------| |------| H | J | K | L | ; | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | Z | X | C | V | B | | | | N | M | | | | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | | | | | | | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+--------+------.
|
||||
* | | | | | | | |
|
||||
* | | |------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `----------------------'
|
||||
*/
|
||||
[1] = KEYMAP( // layer 1: QWERTY layer (games)
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TRNS,
|
||||
KC_TRNS, KC_A, KC_S, KC_D, KC_F, KC_G,
|
||||
KC_TRNS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
|
||||
// right hand
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_TRNS,
|
||||
KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_TRNS,
|
||||
KC_TRNS, KC_N, KC_M, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS
|
||||
),
|
||||
|
||||
/* Keymap 2: Symbol Layer
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | | | + | < | % | # | DF(1)| | | & | [ | ] | \ | : | " |
|
||||
* |--------+------+------+------+------+------|QWERTY| | |------+------+------+------+------+--------|
|
||||
* | | ! | - | > | = | @ |------| |------| * | { | } | / | ? | |
|
||||
* |--------+------+------+------+------+------| DF(0)| | |------+------+------+------+------+--------|
|
||||
* | | NUBS | NUHS | / | $ | ^ |COLEMAK | | | | ( | ) | | | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | | | | | | | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* | | |------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// SYMBOLS
|
||||
[2] = KEYMAP(
|
||||
// left hand
|
||||
KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6,
|
||||
KC_TRNS, KC_PIPE, KC_PLUS, KC_LT, KC_PERC, KC_HASH, DF(1),
|
||||
KC_LBRC, KC_EXCLAIM, KC_MINUS, KC_GT, KC_EQUAL, KC_AT,
|
||||
KC_TRNS, KC_NUBS, KC_NUHS, KC_SLSH, KC_DOLLAR, KC_CIRC, DF(0),
|
||||
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_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS,
|
||||
KC_TRNS, KC_AMPERSAND, KC_LBRC, KC_RBRC, KC_BSLS, KC_COLN, KC_DQT,
|
||||
KC_ASTERISK, KC_LCBR, KC_RCBR, KC_SLSH, KC_QUES, KC_TRNS,
|
||||
KC_TRNS, KC_PIPE, KC_LPRN, KC_RPRN, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS
|
||||
),
|
||||
|
||||
/* Keymap 3:
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | | | | | |------| |------| | | | | | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | | | | | | HYPR | | HYPR | | | | | | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | | | | | | | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* | | |------ |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// F-keys
|
||||
[3] = KEYMAP(
|
||||
KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HYPR,
|
||||
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_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_HYPR, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS
|
||||
),
|
||||
/* Keymap 4: Numlock
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | RESET | | | |P-SCRE|S-LOCK|PAUSE | |NLOCK | CALC | = | / | * | | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | Vol+ | 7 | 8 | 9 | - | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | | | | | |------| |------| Vol- | 4 | 5 | 6 | + | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | | | | | | HYPR | | HYPR | Mute | 1 | 2 | 3 |Enter | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | | | | | 0 | . | RCTL | RCTL |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* | | |------ |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
[4] = KEYMAP(
|
||||
RESET, KC_LSFT, KC_LSFT, KC_SYSREQ, KC_PSCR, KC_SLCK, KC_PAUSE,
|
||||
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_HYPR,
|
||||
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_NLCK, KC_CALC, KC_PEQL, KC_PSLS, KC_PAST, KC_LSFT, KC_TRNS,
|
||||
KC_TRNS, KC_VOLU, KC_P7, KC_P8, KC_P9, KC_PMNS, KC_TRNS,
|
||||
KC_VOLD, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_TRNS,
|
||||
KC_HYPR, KC_MUTE, KC_P1, KC_P2, KC_P3, KC_PENT, KC_TRNS,
|
||||
KC_TRNS, KC_P0, KC_PDOT, KC_RCTL, KC_RCTL,
|
||||
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS
|
||||
),
|
||||
|
||||
};
|
||||
|
||||
|
||||
// Runs constantly in the background, in a loop.
|
||||
void matrix_scan_user(void) {
|
||||
static uint8_t state;
|
||||
|
||||
ergodox_board_led_off();
|
||||
ergodox_right_led_1_off();
|
||||
ergodox_right_led_2_off();
|
||||
ergodox_right_led_3_off();
|
||||
|
||||
//reduce LED on time to 1/6th because LEDs are too strong
|
||||
if (++state < 6) return;
|
||||
state = 0;
|
||||
|
||||
//bit 1: default layer 1 - QWERTY
|
||||
if (default_layer_state & (1UL << 1)) ergodox_right_led_1_on();
|
||||
|
||||
uint8_t layer = biton32(layer_state);
|
||||
|
||||
//layer 2 : Symbols (& Fs)
|
||||
//if (layer == 2) ergodox_right_led_2_on();
|
||||
|
||||
//layer 3 : F-lock
|
||||
if (layer == 3) ergodox_right_led_2_on();
|
||||
|
||||
//layer 4 : Num-lock
|
||||
if (layer == 4) ergodox_right_led_3_on();
|
||||
};
|
@ -0,0 +1,23 @@
|
||||
# ErgoDox EZ colemak_programmer
|
||||
|
||||
## Features
|
||||
|
||||
* Qwerty and colemak 2 in 1
|
||||
* Use DF() macro to swap the bottom layer so it behaves literally as collemak or qwerty
|
||||
* Graphical creator did not allow this so I had to use TO(0) and TO(1) on the picture
|
||||
* Symbol layer programmers friendly
|
||||
* Not only symbols are easy to access but common combination are easy too: ->, =>, !=, etc.
|
||||
* Windows and Mac
|
||||
* The extra repeated Win key is very handy on Mac
|
||||
* Numlock
|
||||
|
||||
I came to this layout after several iterations. It is not the ultimate best ergonomic layout but it is the best if you switch back and forth between ergodox and laptops.
|
||||
|
||||
## Notes
|
||||
* The Quote and Enter can be swapped
|
||||
* If you use sculpted key caps try turning the bottom key 180 degrees so it became very comfortable to type with thumb.
|
||||
|
||||
Alternatively view the [graphical creator version](http://configure.ergodox-ez.com/keyboard_layouts/kmevwm/edit) but beware it is not the same due to the creator limitations.
|
||||
|
||||
![Default](colemak_programmer_001.jpg)
|
||||
![Default](colemak_programmer_002.jpg)
|
@ -0,0 +1,166 @@
|
||||
#include "ergodox.h"
|
||||
#include "keymap_dvorak.h"
|
||||
#include "debug.h"
|
||||
#include "action_layer.h"
|
||||
|
||||
/******************************************************************************************
|
||||
* DVORAK LAYOUT (see http://djelibeibi.unex.es/dvorak/)
|
||||
* Layer 1: auxiliary keys
|
||||
* Layer 2: full qwerty layout
|
||||
*****************************************************************************************/
|
||||
|
||||
// LAYERS
|
||||
#define BASE 0 // dvorak layout (default)
|
||||
#define AUX 1 // auxiliary keys
|
||||
|
||||
// MACROS
|
||||
/* #define OBRACE 0 // key { or shift */
|
||||
/* #define CBRACE 1 // key } or shift */
|
||||
/* #define OBRACK 2 // key [ or left alt */
|
||||
/* #define CBRACK 3 // key ] or left alt */
|
||||
/* #define CAPS 4 // caps lock */
|
||||
|
||||
// LEDS
|
||||
#define USB_LED_NUM_LOCK 0
|
||||
#define USB_LED_CAPS_LOCK 1
|
||||
#define USB_LED_SCROLL_LOCK 2
|
||||
#define USB_LED_COMPOSE 3
|
||||
#define USB_LED_KANA 4
|
||||
|
||||
// TIMERS
|
||||
#define KEY_TAP_FAST 85
|
||||
#define KEY_TAP_SLOW 95
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap 0: Base layer
|
||||
* Keys with double values (like Esc/Ctrl) correspond to the 'tapped' key and the 'held' key, respectively
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | 1 | 2 | 3 | 4 | 5 | Esc | | Esc | 6 | 7 | 8 | 9 | 0 | = / + |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | ~ |" / ' |, / < |. / > | P | Y | [ | | ] | F | G | C | H | L | / / ? |
|
||||
* |--------+------+------+------+------+------| { | | } |------+------+------+------+------+--------|
|
||||
* | Tab | A | O | E |U/LSft| I/L1 |------| |------| D/L1|R/RSft| T | N | S | - / _ |
|
||||
* |--------+------+------+------+------+------| LGUI | | LGUI |------+------+------+------+------+--------|
|
||||
* | {/LSft |; / : | Q | J | K | X | | | | B | M | W | V | Z | }/RSft |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | | ~L1 | | ~L1 | | | \ / || |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | HOME | END | | LEFT | RIGHT|
|
||||
* ,------|------|------| |------+--------+------.
|
||||
* | BSPC | DEL | PGUP | | UP | SPACE |RETURN|
|
||||
* | / | / |------| |------| / | / |
|
||||
* | LCTL | LALT |PGDWN | | DOWN | LALT | LCTL |
|
||||
* `--------------------' `----------------------'
|
||||
*
|
||||
*/
|
||||
[BASE] = KEYMAP(
|
||||
// left hand
|
||||
KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC,
|
||||
KC_TILD, DV_QUOT, DV_COMM,DV_DOT, DV_P, DV_Y, DV_LBRC,
|
||||
KC_TAB, DV_A, DV_O, DV_E, SFT_T(DV_U), LT(AUX, DV_I),
|
||||
SFT_T(DV_LBRC), DV_SCLN, DV_Q, DV_J, DV_K, DV_X, KC_LGUI,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, MO(AUX),
|
||||
KC_HOME, KC_END,
|
||||
KC_PGUP,
|
||||
CTL_T(KC_BSPC), ALT_T(KC_DEL), KC_PGDN,
|
||||
// right hand
|
||||
KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, DV_EQL,
|
||||
DV_RBRC, DV_F, DV_G, DV_C, DV_R, DV_L, DV_SLSH,
|
||||
LT(AUX, DV_D), SFT_T(DV_H), DV_T, DV_N, DV_S, DV_MINS,
|
||||
KC_LGUI, DV_B, DV_M, DV_W, DV_V, DV_Z, SFT_T(DV_RBRC),
|
||||
MO(AUX), KC_NO, KC_NO, KC_BSLS, KC_NO,
|
||||
KC_LEFT, KC_RIGHT,
|
||||
KC_UP,
|
||||
KC_DOWN, ALT_T(KC_ENT), CTL_T(KC_SPC)
|
||||
),
|
||||
/* Keymap 1: Aux layer
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | VolUp | | | | | | SLEEP | PWR | | | | | | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | VolDn | F1 | F2 | F3 | F4 | | | | | | 7 | 8 | 9 | * | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | F5 | F6 | F7 | F8 | TRANS|------| |------|TRANS | 4 | 5 | 6 | + | |
|
||||
* |--------+------+------+------+------+------| | |PSCR |------+-----aan+------+------+------+--------|
|
||||
* | TRANS | F9 | F10 | F11 | F12 | | | | | | 1 | 2 | 3 | / | TRANS |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* |CTRL-S|CTRL-Z|CTRL-X|CTRL-C| TRANS| | TRANS| . | 0 | = | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | TRANS| TRANS| | TRANS| TRANS|
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | TRANS| | TRANS| | |
|
||||
* |TRANS |TRANS |------| |------| TRANS| TRANS|
|
||||
* | | | TRANS| | TRANS| | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
[AUX] = KEYMAP(
|
||||
// left hand
|
||||
KC_VOLU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_SLEP,
|
||||
KC_VOLD, KC_F1, KC_F2, KC_F3, KC_F4, KC_NO, KC_NO,
|
||||
KC_NO , KC_F5, KC_F6, KC_F7, KC_F8, KC_TRNS,
|
||||
KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO,
|
||||
LCTL(DV_S), LCTL(DV_Z), LCTL(DV_X), LCTL(DV_C), KC_TRNS,
|
||||
KC_TRNS , KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
// right hand
|
||||
KC_PWR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, KC_NO, KC_7, KC_8, KC_9, KC_PAST, KC_NO,
|
||||
KC_TRNS, KC_4, KC_5, KC_6, KC_PPLS, KC_NO,
|
||||
KC_PSCR, KC_NO, KC_1, KC_2, KC_3, KC_PSLS, KC_TRNS,
|
||||
KC_TRNS,KC_DOT, KC_0, KC_PEQL, KC_NO,
|
||||
KC_TRNS , KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS
|
||||
),
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[1] = ACTION_LAYER_TAP_TOGGLE(AUX) // FN1 - Momentary Layer 1 (Aux)
|
||||
};
|
||||
|
||||
|
||||
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) {
|
||||
case 1:
|
||||
ergodox_right_led_1_on();
|
||||
break;
|
||||
case 2:
|
||||
ergodox_right_led_2_on();
|
||||
break;
|
||||
default:
|
||||
// none
|
||||
break;
|
||||
}
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
# Ergodox Dvorak Layout with emacs binding in mind - software version
|
||||
|
||||
This configuration is the same as the dvorak_emacs layout, but using a sofware dvorak configuration
|
||||
instead of a firmware configuration. This layout is for those who run their computer in dvorak mode.
|
||||
|
||||
* Control & Alt key on the thumbs (activated if pressed with another key).
|
||||
* In the same way, "U" and "R" are the shift modifier if pressed with another key.
|
||||
* "I" and "D" set the layer 1 for the auxiliary keys if pressed with another key.
|
||||
* Software layout set to english.
|
||||
|
||||
## Keymap Layers
|
||||
- L0: dvorak with some customizations (see layout below)
|
||||
- L1: auxiliary keys (includes function keys, numpad...)
|
||||
|
||||
|
||||
### Keymap 0: Base layer
|
||||
Keys with double values (like U/LSft) correspond to the 'tapped' key and the 'held' key, respectively
|
||||
|
||||
<pre><code>
|
||||
|
||||
,--------------------------------------------------. ,--------------------------------------------------.
|
||||
| | 1 | 2 | 3 | 4 | 5 | Esc | | Esc | 6 | 7 | 8 | 9 | 0 | = |
|
||||
|--------|------|------|------|------|-------------| |------|------|------|------|------|------|--------|
|
||||
| ~ | ' | , | . | P | Y | [ | | ] | F | G | C | H | L | / |
|
||||
|--------|------|------|------|------|------| { | | } |------|------|------|------|------|--------|
|
||||
| Tab | A | O | E |U/LSft| I/L1 |------| |------| D/L1|R/RSft| T | N | S | - |
|
||||
|--------|------|------|------|------|------| LGUI | | LGUI |------|------|------|------|------|--------|
|
||||
| {/LSft | ; | Q | J | K | X | | | | B | M | W | V | Z | }/RSft |
|
||||
`--------|------|------|------|------|-------------' `-------------|------|------|------|------|--------'
|
||||
| | | | | ~L1 | | ~L1 | | | \ | |
|
||||
`----------------------------------' `----------------------------------'
|
||||
,-------------. ,-------------.
|
||||
| HOME | END | | LEFT | RIGHT|
|
||||
,------|------|------| |------|--------|------.
|
||||
| BSPC | DEL | PGUP | | UP | SPACE |RETURN|
|
||||
| / | / |------| |------| / | / |
|
||||
| LCTL | LALT |PGDWN | | DOWN | LALT | LCTL |
|
||||
`--------------------' `----------------------'
|
||||
|
||||
</pre></code>
|
||||
|
||||
### Keymap 1: Aux layer
|
||||
|
||||
<pre><code>
|
||||
|
||||
,--------------------------------------------------. ,--------------------------------------------------.
|
||||
| VolUp | | | | | | SLEEP | PWR | | | | | | |
|
||||
|--------|------|------|------|------|-------------| |------|------|------|------|------|------|--------|
|
||||
| VolDn | F1 | F2 | F3 | F4 | | | | | | 7 | 8 | 9 | * | |
|
||||
|--------|------|------|------|------|------| | | |------|------|------|------|------|--------|
|
||||
| | F5 | F6 | F7 | F8 | TRANS|------| |------|TRANS | 4 | 5 | 6 | + | |
|
||||
|--------|------|------|------|------|------| | |PSCR |------|------|------|------|------|--------|
|
||||
| TRANS | F9 | F10 | F11 | F12 | | | | | | 1 | 2 | 3 | / | TRANS |
|
||||
`--------|------|------|------|------|-------------' `-------------|------|------|------|------|--------'
|
||||
|CTRL-S|CTRL-Z|CTRL-X|CTRL-C| TRANS| | TRANS| . | 0 | = | |
|
||||
`----------------------------------' `----------------------------------'
|
||||
,-------------. ,-------------.
|
||||
| TRANS| TRANS| | TRANS| TRANS|
|
||||
,------|------|------| |------|------|------.
|
||||
| | | TRANS| | TRANS| | |
|
||||
|TRANS |TRANS |------| |------| TRANS| TRANS|
|
||||
| | | TRANS| | TRANS| | |
|
||||
`--------------------' `--------------------'
|
||||
|
||||
</pre></code>
|
||||
|
||||
|
||||
|
||||
## Generation of .hex file
|
||||
> In the "qmk_firmware/keyboards/ergodox" directory.
|
||||
|
||||
> Execute "make dvorak_emacs". Then the hex file "ergodox_ez_dvorak_emacs.hex" is in the root directory : "qmk_firmware".
|
||||
|
||||
> Flash with `teensy_loader` binary
|
@ -0,0 +1,12 @@
|
||||
# About this keymap
|
||||
|
||||
This keymap is based on the qwertz layout.
|
||||
It has a key for pressing the left control and the left alt key at once.
|
||||
|
||||
Linux makes a difference between AltGr and Control + Alt. Some keybindings are easier to press now.
|
||||
|
||||
Also, I added a layer for pressing Control + Alt + F-Keys very fast.
|
||||
|
||||
# Layer
|
||||
|
||||
Each layer in the *keymap.c*-file has a comment showing the mappings of the layer.
|
@ -0,0 +1,236 @@
|
||||
#include "ergodox.h"
|
||||
#include "debug.h"
|
||||
#include "action_layer.h"
|
||||
#include "keymap_german.h"
|
||||
|
||||
// Layer names
|
||||
#define BASE 0 // default layer
|
||||
#define SYMB 1 // symbol layer
|
||||
#define MDIA 2 // media keys
|
||||
#define SHRT 3 // shortcut layer
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap 0: Basic layer
|
||||
*
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | Caps | 1 | 2 | 3 | 4 | 5 |X ` X| | PRSC | 6 | 7 | 8 | 9 | 0 | ß |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | Tab | Q | W | E | R | T | L1 | | L1 | Z | U | I | O | P | Ü |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | Esc | A | S | D | F | G |------| |------| H | J | K | L | Ö | Ä/L2 |
|
||||
* |--------+------+------+------+------+------| L2 | | L2 |------+------+------+------+------+--------|
|
||||
* | LShift | Y | X | C | V | B | | | | N | M | , | . | - | RShift |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | LGui | ^ | < | LEFT | RIGHT| | Up | Down | # | + | LCA |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | CTRL | ALT | | Alt |Ctrl/Esc|
|
||||
* ,------+------+------| |------+--------+------.
|
||||
* | | | Home | | PgUp | | |
|
||||
* | Space|Del |------| |------| Bkspc | Enter|
|
||||
* | | | 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_CAPS, KC_1, KC_2, KC_3, KC_4, KC_5, DE_ACUT,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB),
|
||||
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G,
|
||||
KC_LSFT, DE_Y, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO),
|
||||
KC_LGUI, DE_CIRC, DE_LESS, KC_LEFT, KC_RIGHT,
|
||||
KC_LCTRL, KC_LALT,
|
||||
KC_HOME,
|
||||
KC_SPC ,KC_DELT,KC_END,
|
||||
// right hand
|
||||
KC_PSCREEN, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
|
||||
TG(MDIA), DE_Z, KC_U, KC_I, KC_O, KC_P, LT(SHRT,DE_UE),
|
||||
KC_H, KC_J, KC_K, KC_L, DE_OE, LT(MDIA,DE_AE),
|
||||
MEH_T(KC_NO), KC_N, KC_M, KC_COMM, KC_DOT, DE_MINS, KC_RSFT,
|
||||
KC_UP, KC_DOWN, DE_HASH, DE_PLUS, LCA_T(KC_NO),
|
||||
KC_RALT, KC_RCTRL,
|
||||
KC_PGUP,
|
||||
KC_PGDN, KC_BSPC, 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,DE_EXLM,DE_AT, DE_LCBR,DE_RCBR,DE_PIPE,KC_TRNS,
|
||||
KC_TRNS,DE_HASH,DE_DLR, DE_LPRN,DE_RPRN,DE_GRV,
|
||||
KC_TRNS,DE_PERC,DE_CIRC,DE_LBRC,DE_RBRC,DE_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, DE_ASTR, KC_F12,
|
||||
KC_DOWN, KC_4, KC_5, KC_6, DE_PLUS, KC_TRNS,
|
||||
KC_TRNS, DE_AMPR, KC_1, KC_2, KC_3, DE_BSLS, KC_TRNS,
|
||||
KC_TRNS,KC_DOT, KC_0, DE_EQL, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS
|
||||
),
|
||||
|
||||
/* Keymap 2: Media and mouse keys
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | | Lclk | MsUp | Rclk | | | | | |VolDwn| Mute |VolUp | | F12 |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | Btn4 |MsLeft|MsDown|MsRght| Btn5 |------| |------| | Prev | Stop | Play | Next | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | |WhRght|WhDown| WhUp |WhLeft|WhClk | | | |BwSrch|BwBack|BwHome|BwRefr|BwFwd | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | |MsAcl0|MsAcl1|MsAcl2| | | | | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | |Brwser|Brwser|
|
||||
* | Lclk | Rclk |------| |------|Back |Forwd |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// MEDIA AND MOUSE
|
||||
[MDIA] = KEYMAP(
|
||||
// left hand
|
||||
KC_TRNS, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_BTN4, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN5,
|
||||
KC_TRNS, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, KC_BTN3, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_ACL0, KC_ACL1, KC_ACL2,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_BTN1, KC_BTN2, KC_TRNS,
|
||||
// right hand
|
||||
KC_TRNS, KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11,
|
||||
KC_TRNS, KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_F12,
|
||||
KC_TRNS, KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT, KC_TRNS,
|
||||
KC_TRNS, KC_WSCH, KC_WBAK, KC_WHOM, KC_WREF, KC_WFWD, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_WBAK, KC_WFWD
|
||||
),
|
||||
|
||||
/* Keymap 3: Linux shortcuts
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | |LCA-F1|LCA-F2|LCA-F3|LCA-F4|LCA-F5| | | |LCA-F6|LCA-F7|LCA-F8|LCA-F9| | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | |LCA-Le| |LCA-Ri| |------| |------| | | | | | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | |LCA-Le|LCA-Ri| | | | | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* | | |------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// Shortcuts
|
||||
[SHRT] = KEYMAP(
|
||||
// left hand
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, LCA(KC_F1), LCA(KC_F2), LCA(KC_F3), LCA(KC_F4), LCA(KC_F5), KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, LCA(KC_LEFT), KC_TRNS, LCA(KC_RIGHT), KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, LCA(KC_LEFT), LCA(KC_RIGHT),
|
||||
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, LCA(KC_F6), LCA(KC_F7), LCA(KC_F8), LCA(KC_F9), 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,
|
||||
LCA(KC_UP), LCA(KC_DOWN), KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS
|
||||
),
|
||||
};
|
||||
|
||||
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) {
|
||||
case SYMB:
|
||||
ergodox_right_led_1_on();
|
||||
break;
|
||||
case MDIA:
|
||||
ergodox_right_led_2_on();
|
||||
break;
|
||||
case SHRT:
|
||||
ergodox_right_led_3_on();
|
||||
break;
|
||||
default:
|
||||
ergodox_board_led_off();
|
||||
break;
|
||||
}
|
||||
|
||||
};
|
@ -0,0 +1,177 @@
|
||||
#include "ergodox.h"
|
||||
#include "debug.h"
|
||||
#include "action_layer.h"
|
||||
#include "bootloader.h"
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
KEYMAP( // layer 0 : default
|
||||
// left hand
|
||||
KC_EQL , KC_1, KC_2, KC_3, KC_4, KC_5, KC_LBRC,
|
||||
KC_FN25 , KC_Q, KC_W, KC_E, KC_R, KC_T, KC_HOME,
|
||||
KC_FN27 , KC_A, KC_S, KC_D, KC_F, KC_G,
|
||||
KC_LSFT , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_PGUP,
|
||||
KC_LGUI , KC_GRV,KC_LEFT,KC_RGHT,KC_LALT,
|
||||
KC_NO , KC_NO ,
|
||||
KC_NO ,
|
||||
KC_BSPC,KC_DEL ,KC_FN23,
|
||||
// right hand
|
||||
KC_RBRC , KC_6, KC_7 , KC_8, KC_9, KC_0, KC_MINS,
|
||||
KC_END , KC_Y, KC_U , KC_I, KC_O, KC_P, KC_FN28,
|
||||
KC_H , KC_J, KC_K , KC_L, KC_SCLN,KC_FN30,
|
||||
KC_PGDN , KC_N, KC_M , KC_COMM,KC_DOT, KC_SLSH,KC_FN29,
|
||||
KC_RALT , KC_DOWN,KC_UP, KC_NO ,KC_RGUI,
|
||||
KC_NO , KC_NO,
|
||||
KC_NO ,
|
||||
KC_FN29,KC_ENT ,KC_SPC
|
||||
),
|
||||
|
||||
KEYMAP( // layer 1 : function and symbol keys
|
||||
// left hand
|
||||
KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11,
|
||||
KC_TRNS,KC_AT,KC_UNDS ,KC_LBRC,KC_RBRC,KC_CIRC ,KC_TRNS,
|
||||
KC_TRNS,KC_BSLS,KC_SLSH,KC_LCBR ,KC_RCBR ,KC_ASTR,
|
||||
KC_TRNS,KC_HASH ,KC_DLR ,KC_PIPE ,KC_TILD ,KC_GRV ,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_FN1,
|
||||
// right hand
|
||||
KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS,
|
||||
KC_TRNS,KC_EXLM,LSFT(KC_COMM),LSFT(KC_DOT),KC_EQL,KC_AMPR, KC_TRNS,
|
||||
LSFT(KC_SLSH),KC_LPRN,KC_RPRN,KC_MINS,LSFT(KC_SCLN),KC_TRNS,
|
||||
KC_TRNS,KC_PLUS,LSFT(KC_5),LSFT(KC_QUOT),KC_QUOT,KC_SCLN,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS
|
||||
),
|
||||
|
||||
KEYMAP( // layer 2: navigation
|
||||
// left hand
|
||||
KC_NO,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,KC_PGUP,KC_HOME,KC_UP ,KC_END,KC_NO ,KC_TRNS,
|
||||
KC_TRNS,KC_PGDN,KC_LEFT,KC_DOWN,KC_RGHT,KC_NO,
|
||||
KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO,KC_NO,KC_NO,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_FN1 ,
|
||||
// right hand
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS ,KC_TRNS, KC_HOME, KC_TRNS, KC_TRNS, KC_END ,KC_TRNS,
|
||||
KC_NO, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS, KC_HOME, KC_UP, KC_END, KC_PGUP,KC_TRNS,
|
||||
KC_LEFT, KC_DOWN,KC_RGHT,KC_PGDN,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS
|
||||
),
|
||||
KEYMAP( // layer 3 : teensy bootloader functions
|
||||
// left hand
|
||||
KC_FN0, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_FN1 ,
|
||||
// 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_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS
|
||||
),
|
||||
|
||||
|
||||
KEYMAP( // layer 4: numpad
|
||||
// left 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_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
// right hand
|
||||
KC_TRNS,KC_NLCK,KC_PSLS,KC_PAST,KC_PAST,KC_PMNS,KC_BSPC,
|
||||
KC_TRNS,KC_NO, KC_P7, KC_P8, KC_P9, KC_PMNS,KC_BSPC,
|
||||
KC_NO, KC_P4, KC_P5, KC_P6, KC_PPLS,KC_PENT,
|
||||
KC_TRNS,KC_NO, KC_P1, KC_P2, KC_P3, KC_PPLS,KC_PENT,
|
||||
KC_P0, KC_PDOT,KC_SLSH,KC_PENT,KC_PENT,
|
||||
KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS
|
||||
),
|
||||
|
||||
};
|
||||
|
||||
/* id for user defined functions */
|
||||
enum function_id {
|
||||
TEENSY_KEY,
|
||||
};
|
||||
|
||||
/*
|
||||
* Fn action definition
|
||||
*/
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[0] = ACTION_FUNCTION(TEENSY_KEY), // FN0 - Teensy key
|
||||
[1] = ACTION_LAYER_SET(0, ON_PRESS),
|
||||
//[11] = ACTION_MODS_KEY(MOD_LSFT, KC_COMM),
|
||||
//[12] = ACTION_MODS_KEY(MOD_LSFT, KC_DOT),
|
||||
|
||||
//[14] = ACTION_MODS_KEY(MOD_LSFT, KC_SLSH),
|
||||
//[17] = ACTION_MODS_KEY(MOD_LSFT, KC_SCLN),
|
||||
//[20] = ACTION_MODS_KEY(MOD_LSFT, KC_5),
|
||||
//[21] = ACTION_MODS_KEY(MOD_LSFT, KC_QUOT),
|
||||
[23] = ACTION_LAYER_SET(3, ON_PRESS),
|
||||
[24] = ACTION_LAYER_SET(2, ON_PRESS),
|
||||
[25] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_TAB),
|
||||
[26] = ACTION_LAYER_SET(1, ON_PRESS),
|
||||
[27] = ACTION_LAYER_TAP_KEY(1, KC_CAPS),
|
||||
[28] = ACTION_MODS_TAP_KEY(MOD_RCTL,KC_BSLS),
|
||||
//[29] = ACTION_LAYER_TOGGLE(4),
|
||||
[29] = ACTION_MODS_TAP_KEY(MOD_RSFT,KC_ESC),
|
||||
[30] = ACTION_LAYER_TAP_KEY(1, KC_QUOT),
|
||||
[31] = ACTION_LAYER_MOMENTARY(2),
|
||||
//[] = ACTION_LAYER_TAP_KEY(4, KC_S),
|
||||
};
|
||||
|
||||
|
||||
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) {
|
||||
|
||||
};
|
||||
|
||||
|
||||
void action_function(keyrecord_t *event, uint8_t id, uint8_t opt)
|
||||
{
|
||||
|
||||
if (id == TEENSY_KEY) {
|
||||
clear_keyboard();
|
||||
print("\n\nJump to bootloader... ");
|
||||
_delay_ms(250);
|
||||
bootloader_jump(); // should not return
|
||||
print("not supported.\n");
|
||||
}
|
||||
}
|
@ -0,0 +1,133 @@
|
||||
My main layout (Layer 0) is based on qwerty. I tried to fit the layout of the kinesis keyboard onto the ergodox. Furthermore I did some tweaks.
|
||||
The other layers are seldom used. Except the F Keys and the teensy key. As I own a ergodox I cant press the reset button, so i need a key to send the teensy into reprogram mode.
|
||||
There is a layer with symbols a numpad. These layers are seldom used. Except the F Keys and the teensy key. As I own a ergodox I need a key to reprogram, because I can't access the reset button.
|
||||
|
||||
I am a linux user and need the esc key and str keys often therefore it is easyly accessed. Switching console str+alt+tab+f2 (layer 2 and 2) is tricky but you get it after a while.
|
||||
As I live in germany and need to type umlaut frquently, i mapped the CAPS to the meta key, and swapped ' and ". So I can type ö with CAPS o + ¨. no need to press o+SHIFT+'
|
||||
As a note for linux users i use str+p to get last command, instead of using the cursor keys.
|
||||
|
||||
HOWTO to convert CAPS to Meta-Key and swap ' with "
|
||||
|
||||
* create file with following content
|
||||
.Xmodmap
|
||||
clear Lock
|
||||
keycode 48 = quotedbl apostrophe quotedbl apostrophe
|
||||
keycode 66 = Multi_key
|
||||
|
||||
* apply with
|
||||
xmodmap .Xmodmap
|
||||
|
||||
* convert to xkbmap
|
||||
xkbcomp $DISPLAY $HOME/.xkbmap
|
||||
|
||||
* automatic startup each time you startup x
|
||||
echo 'xkbcomp $HOME/.xkbmap $DISPLAY' >> ~/.xinitrc
|
||||
|
||||
KEYMAP( // layer 0 : default
|
||||
// left hand
|
||||
KC_EQL , KC_1, KC_2, KC_3, KC_4, KC_5, KC_LBRC,
|
||||
KC_FN25 , KC_Q, KC_W, KC_E, KC_R, KC_T, KC_HOME,
|
||||
KC_FN27 , KC_A, KC_S, KC_D, KC_F, KC_G,
|
||||
KC_LSFT , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_PGUP,
|
||||
KC_LGUI , KC_GRV,KC_LEFT,KC_RGHT,KC_LALT,
|
||||
KC_NO , KC_NO ,
|
||||
KC_NO ,
|
||||
KC_BSPC,KC_DEL ,KC_FN23,
|
||||
// right hand
|
||||
KC_RBRC , KC_6, KC_7 , KC_8, KC_9, KC_0, KC_MINS,
|
||||
KC_END , KC_Y, KC_U , KC_I, KC_O, KC_P, KC_FN28,
|
||||
KC_H , KC_J, KC_K , KC_L, KC_SCLN,KC_FN30,
|
||||
KC_PGDN , KC_N, KC_M , KC_COMM,KC_DOT, KC_SLSH,KC_FN29,
|
||||
KC_RALT , KC_DOWN,KC_UP, KC_NO ,KC_RGUI,
|
||||
KC_NO , KC_NO,
|
||||
KC_NO ,
|
||||
KC_FN29,KC_ENT ,KC_SPC
|
||||
),
|
||||
|
||||
KEYMAP( // layer 1 : function and symbol keys
|
||||
// left hand
|
||||
KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11,
|
||||
KC_TRNS,KC_AT,KC_UNDS ,KC_LBRC,KC_RBRC,KC_CIRC ,KC_TRNS,
|
||||
KC_TRNS,KC_BSLS,KC_SLSH,KC_LCBR ,KC_RCBR ,KC_ASTR,
|
||||
KC_TRNS,KC_HASH ,KC_DLR ,KC_PIPE ,KC_TILD ,KC_GRV ,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_FN1,
|
||||
// right hand
|
||||
KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS,
|
||||
KC_TRNS,KC_EXLM,LSFT(KC_COMM),LSFT(KC_DOT),KC_EQL,KC_AMPR, KC_TRNS,
|
||||
LSFT(KC_SLSH),KC_LPRN,KC_RPRN,KC_MINS,LSFT(KC_SCLN),KC_TRNS,
|
||||
KC_TRNS,KC_PLUS,LSFT(KC_5),LSFT(KC_QUOT),KC_QUOT,KC_SCLN,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS
|
||||
),
|
||||
|
||||
KEYMAP( // layer 2: navigation
|
||||
// left hand
|
||||
KC_NO,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,KC_PGUP,KC_HOME,KC_UP ,KC_END,KC_NO ,KC_TRNS,
|
||||
KC_TRNS,KC_PGDN,KC_LEFT,KC_DOWN,KC_RGHT,KC_NO,
|
||||
KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO,KC_NO,KC_NO,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_FN1 ,
|
||||
// right hand
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS ,KC_TRNS, KC_HOME, KC_TRNS, KC_TRNS, KC_END ,KC_TRNS,
|
||||
KC_NO, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS, KC_HOME, KC_UP, KC_END, KC_PGUP,KC_TRNS,
|
||||
KC_LEFT, KC_DOWN,KC_RGHT,KC_PGDN,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS
|
||||
),
|
||||
KEYMAP( // layer 3 : teensy bootloader functions
|
||||
// left hand
|
||||
KC_FN0, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_FN1 ,
|
||||
// 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_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS
|
||||
),
|
||||
|
||||
|
||||
KEYMAP( // layer 4: numpad
|
||||
// left 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_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,
|
||||
// right hand
|
||||
KC_TRNS,KC_NLCK,KC_PSLS,KC_PAST,KC_PAST,KC_PMNS,KC_BSPC,
|
||||
KC_TRNS,KC_NO, KC_P7, KC_P8, KC_P9, KC_PMNS,KC_BSPC,
|
||||
KC_NO, KC_P4, KC_P5, KC_P6, KC_PPLS,KC_PENT,
|
||||
KC_TRNS,KC_NO, KC_P1, KC_P2, KC_P3, KC_PPLS,KC_PENT,
|
||||
KC_P0, KC_PDOT,KC_SLSH,KC_PENT,KC_PENT,
|
||||
KC_TRNS,KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS,KC_TRNS,KC_TRNS
|
||||
),
|
||||
|
||||
};
|
||||
|
||||
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 118 KiB |
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 121 KiB |
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 88 KiB |
@ -0,0 +1,112 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# On command line:
|
||||
#
|
||||
# make all = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# make coff = Convert ELF to AVR COFF.
|
||||
#
|
||||
# make extcoff = Convert ELF to AVR Extended COFF.
|
||||
#
|
||||
# make program = Download the hex file to the device.
|
||||
# Please customize your programmer settings(PROGRAM_CMD)
|
||||
#
|
||||
# make teensy = Download the hex file to the device, using teensy_loader_cli.
|
||||
# (must have teensy_loader_cli installed).
|
||||
#
|
||||
# make dfu = Download the hex file to the device, using dfu-programmer (must
|
||||
# have dfu-programmer installed).
|
||||
#
|
||||
# make flip = Download the hex file to the device, using Atmel FLIP (must
|
||||
# have Atmel FLIP installed).
|
||||
#
|
||||
# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
|
||||
# (must have dfu-programmer installed).
|
||||
#
|
||||
# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
|
||||
# (must have Atmel FLIP installed).
|
||||
#
|
||||
# make debug = Start either simulavr or avarice as specified for debugging,
|
||||
# with avr-gdb or avr-insight as the front end for debugging.
|
||||
#
|
||||
# make filename.s = Just compile filename.c into the assembler code only.
|
||||
#
|
||||
# make filename.i = Create a preprocessed source file for use in submitting
|
||||
# bug reports to the GCC project.
|
||||
#
|
||||
# To rebuild project do "make clean" then "make all".
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
# CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
# COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
|
||||
# MIDI_ENABLE ?= YES # MIDI controls
|
||||
# UNICODE_ENABLE ?= YES # Unicode
|
||||
# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE ?= yes # Enable RGB Underglow
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
||||
|
@ -0,0 +1,20 @@
|
||||
Unxmaal's GH60 Layout
|
||||
=====================
|
||||
* Mostly stolen from /u/robotmaxtron
|
||||
|
||||
##Quantum MK Firmware
|
||||
For the full Quantum feature list, see the parent readme.md.
|
||||
|
||||
* Standard Mac ANSI layout
|
||||
* Spacebar acts as space when tapped, Fn when held
|
||||
* Menu acts as menu when tapped, Fn2 when held
|
||||
* Layer1:
|
||||
* Top row = `~, F1-F12, Del
|
||||
* JKIL = arrow cluster
|
||||
* Layer2:
|
||||
* Top row = media controls
|
||||
* JKIL = PgDn/Up/Home/Insert
|
||||
* Backspace = Reset
|
||||
|
||||
### Additional Credits
|
||||
Keymap has been based on various keymaps available from the QMK Repo for the GH60-SATAN and KC60 keyboards.
|
After Width: | Height: | Size: 1015 KiB |
@ -0,0 +1,190 @@
|
||||
/*
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x6060
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER geekhack
|
||||
#define PRODUCT GH60
|
||||
#define DESCRIPTION t.m.k. keyboard firmware for GH60
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 5
|
||||
#define MATRIX_COLS 14
|
||||
|
||||
/*
|
||||
* Keyboard Matrix Assignments
|
||||
*
|
||||
* Change this to how you wired your keyboard
|
||||
* COLS: AVR pins used for columns, left to right
|
||||
* ROWS: AVR pins used for rows, top to bottom
|
||||
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||
*
|
||||
*/
|
||||
#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 }
|
||||
// Rev A
|
||||
// #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B0, B5, B4, D7, D6, B3 }
|
||||
// Rev B/C
|
||||
#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B7, B5, B4, D7, D6, B3 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||
#define DEBOUNCING_DELAY 5
|
||||
|
||||
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* number of backlight levels */
|
||||
#define BACKLIGHT_LEVELS 3
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/*
|
||||
* Force NKRO
|
||||
*
|
||||
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
|
||||
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
|
||||
* makefile for this to work.)
|
||||
*
|
||||
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
|
||||
* until the next keyboard reset.
|
||||
*
|
||||
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
|
||||
* fully operational during normal computer usage.
|
||||
*
|
||||
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
|
||||
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
|
||||
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
|
||||
* power-up.
|
||||
*
|
||||
*/
|
||||
//#define FORCE_NKRO
|
||||
|
||||
/*
|
||||
* Magic Key Options
|
||||
*
|
||||
* Magic keys are hotkey commands that allow control over firmware functions of
|
||||
* the keyboard. They are best used in combination with the HID Listen program,
|
||||
* found here: https://www.pjrc.com/teensy/hid_listen.html
|
||||
*
|
||||
* The options below allow the magic key functionality to be changed. This is
|
||||
* useful if your keyboard/keypad is missing keys and you want magic key support.
|
||||
*
|
||||
*/
|
||||
|
||||
/* key combination for magic key command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
/* control how magic key switches layers */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
|
||||
|
||||
/* override magic key keymap */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
|
||||
//#define MAGIC_KEY_HELP1 H
|
||||
//#define MAGIC_KEY_HELP2 SLASH
|
||||
//#define MAGIC_KEY_DEBUG D
|
||||
//#define MAGIC_KEY_DEBUG_MATRIX X
|
||||
//#define MAGIC_KEY_DEBUG_KBD K
|
||||
//#define MAGIC_KEY_DEBUG_MOUSE M
|
||||
//#define MAGIC_KEY_VERSION V
|
||||
//#define MAGIC_KEY_STATUS S
|
||||
//#define MAGIC_KEY_CONSOLE C
|
||||
//#define MAGIC_KEY_LAYER0_ALT1 ESC
|
||||
//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
|
||||
//#define MAGIC_KEY_LAYER0 0
|
||||
//#define MAGIC_KEY_LAYER1 1
|
||||
//#define MAGIC_KEY_LAYER2 2
|
||||
//#define MAGIC_KEY_LAYER3 3
|
||||
//#define MAGIC_KEY_LAYER4 4
|
||||
//#define MAGIC_KEY_LAYER5 5
|
||||
//#define MAGIC_KEY_LAYER6 6
|
||||
//#define MAGIC_KEY_LAYER7 7
|
||||
//#define MAGIC_KEY_LAYER8 8
|
||||
//#define MAGIC_KEY_LAYER9 9
|
||||
//#define MAGIC_KEY_BOOTLOADER PAUSE
|
||||
//#define MAGIC_KEY_LOCK CAPS
|
||||
//#define MAGIC_KEY_EEPROM E
|
||||
//#define MAGIC_KEY_NKRO N
|
||||
//#define MAGIC_KEY_SLEEP_LED Z
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
*/
|
||||
|
||||
/* disable debug print */
|
||||
//#define NO_DEBUG
|
||||
|
||||
/* disable print */
|
||||
//#define NO_PRINT
|
||||
|
||||
/* disable action features */
|
||||
//#define NO_ACTION_LAYER
|
||||
//#define NO_ACTION_TAPPING
|
||||
//#define NO_ACTION_ONESHOT
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
|
||||
/*
|
||||
* RGB Underglow
|
||||
* These settings are for the F4 by default:
|
||||
*
|
||||
*
|
||||
* #define ws2812_PORTREG PORTF
|
||||
* #define ws2812_DDRREG DDRF
|
||||
* #define ws2812_pin PF4
|
||||
* #define RGBLED_NUM 14 // Number of LEDs
|
||||
* #define RGBLIGHT_HUE_STEP 10
|
||||
* #define RGBLIGHT_SAT_STEP 17
|
||||
* #define RGBLIGHT_VAL_STEP 17
|
||||
*
|
||||
* The firmware supports 5 different light effects, and the color (hue, saturation, brightness) can be customized in most effects.
|
||||
* To control the underglow, you need to modify your keymap file to assign those functions to some keys/key combinations.
|
||||
* For details, please check this keymap. keyboard/planck/keymaps/yang/keymap.c
|
||||
*/
|
||||
|
||||
/* Deprecated code below
|
||||
#define ws2812_PORTREG PORTF
|
||||
#define ws2812_DDRREG DDRF
|
||||
#define ws2812_pin PF4
|
||||
*/
|
||||
#define RGB_DI_PIN F4
|
||||
#define RGBLIGHT_ANIMATIONS
|
||||
#define RGBLED_NUM 8 // Number of LEDs
|
||||
#define RGBLIGHT_HUE_STEP 8
|
||||
#define RGBLIGHT_SAT_STEP 8
|
||||
#define RGBLIGHT_VAL_STEP 8
|
||||
#endif
|
@ -0,0 +1,228 @@
|
||||
#include "gh60.h"
|
||||
#include "action_layer.h"
|
||||
|
||||
#define _BL 0
|
||||
#define _AL 1
|
||||
#define _FL 2
|
||||
#define _UL 3
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/*
|
||||
* ANSI Base, Mac style
|
||||
* ,-----------------------------------------------------------------------------.
|
||||
* |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| = | Backsp |
|
||||
* |-----------------------------------------------------------------------------|
|
||||
* |Tab | Q | W | E | R | T | Y | U | I| O| P| [| ]| \|
|
||||
* |-----------------------------------------------------------------------------|
|
||||
* |Caps/Fn | A| S| D| F| G| H| J| K| L| ;| '| Enter |
|
||||
* |-----------------------------------------------------------------------------|
|
||||
* |Shift | Z| X| C| V| B| N| M| ,| .| /| Shift |
|
||||
* |-----------------------------------------------------------------------------|
|
||||
* |Fn|Alt |Gui | Space(tapped), Fn(held) |Gui |Alt |Menu(tapped, Fn2(held)|Ctrl|
|
||||
* `-----------------------------------------------------------------------------'
|
||||
*/
|
||||
[_BL] = 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_BSPC, \
|
||||
KC_TAB,KC_Q,KC_W,KC_E,KC_R,KC_T,KC_Y,KC_U,KC_I,KC_O,KC_P,KC_LBRC,KC_RBRC,KC_BSLS, \
|
||||
KC_LCTL,KC_A,KC_S,KC_D,KC_F,KC_G,KC_H,KC_J,KC_K,KC_L,KC_SCLN,KC_QUOT,KC_NO,KC_ENT, \
|
||||
KC_LSFT,KC_NO,KC_Z,KC_X,KC_C,KC_V,KC_B,KC_N,KC_M,KC_COMM,KC_DOT,KC_SLSH,KC_NO,KC_RSFT, \
|
||||
MO(1),KC_LALT,KC_LGUI, LT(1,KC_SPACE), KC_NO, KC_RGUI, KC_RALT, LT(2,KC_MENU), KC_RCTL),
|
||||
|
||||
/*
|
||||
* Pok3r style arrow cluster
|
||||
* ,-----------------------------------------------------------.
|
||||
* |`~ | F1| F2| F3| F4| F5| F6| F7| F8| F9| F10| F11| F12|DEL |
|
||||
* |-----------------------------------------------------------|
|
||||
* | | | | | | | | |Up| | | | | |
|
||||
* |-----------------------------------------------------------|
|
||||
* | | | | | | | |Left|Down|Right| | | |
|
||||
* |-----------------------------------------------------------|
|
||||
* | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------|
|
||||
* | | | | | | | | |
|
||||
* `-----------------------------------------------------------'
|
||||
*/
|
||||
[_AL] = 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_DELETE, \
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_UP,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_LEFT,KC_DOWN,KC_RGHT,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, \
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, \
|
||||
KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS),
|
||||
|
||||
|
||||
/*
|
||||
* Secondary function layer
|
||||
* ,-------------------------------------------------------------.
|
||||
* | | | | | | | | RW|Play|FF| Mute| Vol Down | Vol up |Reset |
|
||||
* |-------------------------------------------------------------|
|
||||
* | | | | | | | | | |PgUp| | | | |
|
||||
* |-------------------------------------------------------------|
|
||||
* | | | | | | | |Home|PgDown|End| | | |
|
||||
* |-------------------------------------------------------------|
|
||||
* | | | | | | | | | | | | |
|
||||
* |-------------------------------------------------------------|
|
||||
* | | | | | | | | |
|
||||
* `-------------------------------------------------------------'
|
||||
*/
|
||||
[_FL] = KEYMAP(
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_MPRV,KC_MPLY,KC_MNXT,KC_MUTE,KC_VOLD,KC_VOLU,RESET, \
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PGUP,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, \
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_HOME,KC_TRNS,KC_HOME,KC_PGDN,KC_END,KC_TRNS,KC_TRNS,KC_TRNS, \
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, \
|
||||
KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS),
|
||||
|
||||
/*
|
||||
* Locking layer for controlling the underglow.
|
||||
* NOTE: currently unused.
|
||||
*
|
||||
* ,-----------------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------|
|
||||
* | | | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------|
|
||||
* | |On|Mode| | | | | | | | | | |
|
||||
* |-----------------------------------------------------------|
|
||||
* | | |Hue+|Hue-|Sat+|Sat-|Val+|Val-| | | | |
|
||||
* |-----------------------------------------------------------|
|
||||
* | | | | | | | | |
|
||||
* `-----------------------------------------------------------'
|
||||
*/
|
||||
[_UL] = KEYMAP(
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, \
|
||||
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, \
|
||||
KC_TRNS,F(4),F(5),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,F(6),F(7),F(8),F(9),F(10),F(11),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),
|
||||
};
|
||||
|
||||
enum function_id {
|
||||
RGBLED_TOGGLE,
|
||||
RGBLED_STEP_MODE,
|
||||
RGBLED_INCREASE_HUE,
|
||||
RGBLED_DECREASE_HUE,
|
||||
RGBLED_INCREASE_SAT,
|
||||
RGBLED_DECREASE_SAT,
|
||||
RGBLED_INCREASE_VAL,
|
||||
RGBLED_DECREASE_VAL,
|
||||
SHIFT_ESC,
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[0] = ACTION_LAYER_MOMENTARY(2), // Momentary Fn overlay
|
||||
[1] = ACTION_LAYER_TOGGLE(1), // Toggle Arrow Layer overlay
|
||||
[2] = ACTION_LAYER_TAP_KEY(2, KC_CAPS), // Tap to toggle caps lock and hold to activate function layer
|
||||
[3] = ACTION_LAYER_TOGGLE(3), // Toggle Underglow Layer overlay
|
||||
[4] = ACTION_FUNCTION(RGBLED_TOGGLE), //Turn on/off underglow
|
||||
[5] = ACTION_FUNCTION(RGBLED_STEP_MODE), // Change underglow mode
|
||||
[6] = ACTION_FUNCTION(RGBLED_INCREASE_HUE),
|
||||
[7] = ACTION_FUNCTION(RGBLED_DECREASE_HUE),
|
||||
[8] = ACTION_FUNCTION(RGBLED_INCREASE_SAT),
|
||||
[9] = ACTION_FUNCTION(RGBLED_DECREASE_SAT),
|
||||
[10] = ACTION_FUNCTION(RGBLED_INCREASE_VAL),
|
||||
[11] = ACTION_FUNCTION(RGBLED_DECREASE_VAL),
|
||||
[12] = ACTION_FUNCTION(SHIFT_ESC),
|
||||
[13] = ACTION_LAYER_TAP_KEY(1, KC_SPACE),
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
// MACRODOWN only works in this function
|
||||
switch(id) {
|
||||
case 0:
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_RSFT);
|
||||
} else {
|
||||
unregister_code(KC_RSFT);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
|
||||
// Layer LED indicators
|
||||
// ESC led on when in function layer, WASD cluster leds enabled when on arrow cluster
|
||||
uint32_t layer = layer_state;
|
||||
if (layer & (1<<1)) {
|
||||
gh60_wasd_leds_on();
|
||||
} else {
|
||||
gh60_wasd_leds_off();
|
||||
}
|
||||
|
||||
if (layer & (1<<2)) {
|
||||
gh60_esc_led_on();
|
||||
} else {
|
||||
gh60_esc_led_off();
|
||||
}
|
||||
};
|
||||
|
||||
#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
|
||||
|
||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
switch (id) {
|
||||
case RGBLED_TOGGLE:
|
||||
//led operations
|
||||
if (record->event.pressed) {
|
||||
rgblight_toggle();
|
||||
}
|
||||
break;
|
||||
case RGBLED_INCREASE_HUE:
|
||||
if (record->event.pressed) {
|
||||
rgblight_increase_hue();
|
||||
}
|
||||
break;
|
||||
case RGBLED_DECREASE_HUE:
|
||||
if (record->event.pressed) {
|
||||
rgblight_decrease_hue();
|
||||
}
|
||||
break;
|
||||
case RGBLED_INCREASE_SAT:
|
||||
if (record->event.pressed) {
|
||||
rgblight_increase_sat();
|
||||
}
|
||||
break;
|
||||
case RGBLED_DECREASE_SAT:
|
||||
if (record->event.pressed) {
|
||||
rgblight_decrease_sat();
|
||||
}
|
||||
break;
|
||||
case RGBLED_INCREASE_VAL:
|
||||
if (record->event.pressed) {
|
||||
rgblight_increase_val();
|
||||
}
|
||||
break;
|
||||
case RGBLED_DECREASE_VAL:
|
||||
if (record->event.pressed) {
|
||||
rgblight_decrease_val();
|
||||
}
|
||||
break;
|
||||
case RGBLED_STEP_MODE:
|
||||
if (record->event.pressed) {
|
||||
rgblight_step();
|
||||
}
|
||||
break;
|
||||
static uint8_t shift_esc_shift_mask;
|
||||
// Shift + ESC = ~
|
||||
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,3 @@
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../../Makefile
|
||||
endif
|
@ -0,0 +1,20 @@
|
||||
Magicforce 68 Handwired
|
||||
=======================
|
||||
|
||||
This firmware is for a Magicforce 68 that's had its PCB removed and is handwired with an Arduino Micro. NOTE: The Arduino Micro is different than the Arduino *Pro* Micro.
|
||||
|
||||
## Wiring Layout
|
||||
|
||||
![Wiring Layout](wiring-layout.png)
|
||||
|
||||
## Pinout
|
||||
|
||||
The following pins are used:
|
||||
- Columns 1-15: B2, B0, D3, D2, D1, D0, D4, C6, D7, E6, B4, B5, B6, B7, D6
|
||||
- Rows 1-5: F0, F1, F4, F5, F6
|
||||
|
||||
## Compiling and loading the firmware
|
||||
|
||||
To build the firmware, run `make`.
|
||||
|
||||
To flash the firemware onto the microcontroller, run `make avrdude`, and press the reset button.
|
@ -0,0 +1,162 @@
|
||||
/*
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x6060
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER Hexwire
|
||||
#define PRODUCT Magicforce 68
|
||||
#define DESCRIPTION Handwired Magicforce 68
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 5
|
||||
#define MATRIX_COLS 15
|
||||
|
||||
/*
|
||||
* Keyboard Matrix Assignments
|
||||
*
|
||||
* Change this to how you wired your keyboard
|
||||
* COLS: AVR pins used for columns, left to right
|
||||
* ROWS: AVR pins used for rows, top to bottom
|
||||
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||
*
|
||||
*/
|
||||
#define MATRIX_ROW_PINS { F0, F1, F4, F5, F6 }
|
||||
#define MATRIX_COL_PINS { B2, B0, D3, D2, D1, D0, D4, C6, D7, E6, B4, B5, B6, B7, D6 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
// #define BACKLIGHT_PIN B7
|
||||
// #define BACKLIGHT_BREATHING
|
||||
// #define BACKLIGHT_LEVELS 3
|
||||
|
||||
|
||||
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||
#define DEBOUNCING_DELAY 5
|
||||
|
||||
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* number of backlight levels */
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/*
|
||||
* Force NKRO
|
||||
*
|
||||
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
|
||||
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
|
||||
* makefile for this to work.)
|
||||
*
|
||||
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
|
||||
* until the next keyboard reset.
|
||||
*
|
||||
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
|
||||
* fully operational during normal computer usage.
|
||||
*
|
||||
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
|
||||
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
|
||||
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
|
||||
* power-up.
|
||||
*
|
||||
*/
|
||||
//#define FORCE_NKRO
|
||||
|
||||
/*
|
||||
* Magic Key Options
|
||||
*
|
||||
* Magic keys are hotkey commands that allow control over firmware functions of
|
||||
* the keyboard. They are best used in combination with the HID Listen program,
|
||||
* found here: https://www.pjrc.com/teensy/hid_listen.html
|
||||
*
|
||||
* The options below allow the magic key functionality to be changed. This is
|
||||
* useful if your keyboard/keypad is missing keys and you want magic key support.
|
||||
*
|
||||
*/
|
||||
|
||||
/* key combination for magic key command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
/* control how magic key switches layers */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
|
||||
|
||||
/* override magic key keymap */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
|
||||
//#define MAGIC_KEY_HELP1 H
|
||||
//#define MAGIC_KEY_HELP2 SLASH
|
||||
//#define MAGIC_KEY_DEBUG D
|
||||
//#define MAGIC_KEY_DEBUG_MATRIX X
|
||||
//#define MAGIC_KEY_DEBUG_KBD K
|
||||
//#define MAGIC_KEY_DEBUG_MOUSE M
|
||||
//#define MAGIC_KEY_VERSION V
|
||||
//#define MAGIC_KEY_STATUS S
|
||||
//#define MAGIC_KEY_CONSOLE C
|
||||
//#define MAGIC_KEY_LAYER0_ALT1 ESC
|
||||
//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
|
||||
//#define MAGIC_KEY_LAYER0 0
|
||||
//#define MAGIC_KEY_LAYER1 1
|
||||
//#define MAGIC_KEY_LAYER2 2
|
||||
//#define MAGIC_KEY_LAYER3 3
|
||||
//#define MAGIC_KEY_LAYER4 4
|
||||
//#define MAGIC_KEY_LAYER5 5
|
||||
//#define MAGIC_KEY_LAYER6 6
|
||||
//#define MAGIC_KEY_LAYER7 7
|
||||
//#define MAGIC_KEY_LAYER8 8
|
||||
//#define MAGIC_KEY_LAYER9 9
|
||||
//#define MAGIC_KEY_BOOTLOADER PAUSE
|
||||
//#define MAGIC_KEY_LOCK CAPS
|
||||
//#define MAGIC_KEY_EEPROM E
|
||||
//#define MAGIC_KEY_NKRO N
|
||||
//#define MAGIC_KEY_SLEEP_LED Z
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
*/
|
||||
|
||||
/* disable debug print */
|
||||
//#define NO_DEBUG
|
||||
|
||||
/* disable print */
|
||||
//#define NO_PRINT
|
||||
|
||||
/* disable action features */
|
||||
//#define NO_ACTION_LAYER
|
||||
//#define NO_ACTION_TAPPING
|
||||
//#define NO_ACTION_ONESHOT
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
|
||||
#endif
|
@ -0,0 +1,67 @@
|
||||
#include "magicforce68.h"
|
||||
|
||||
#define _QWERTY 0
|
||||
#define _FN1 1
|
||||
#define _FN2 2
|
||||
#define KC_ KC_TRNS
|
||||
#define KC_X0 LT(_FN2, KC_GRV)
|
||||
#define KC_X1 MO(_FN1)
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[_QWERTY] = KEYMAP(
|
||||
/*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */
|
||||
ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,EQL , BSPC , INS ,PGUP,
|
||||
/*|----`----`----`----`----`----`----`----`----`----`----`----`----`--------| |----`----| */
|
||||
TAB , Q , W , E , R , T , Y , U , I , O , P ,LBRC,RBRC, BSLS , DEL ,PGDN,
|
||||
/*|------`----`----`----`----`----`----`----`----`----`----`----`----`------| `----`----' */
|
||||
X0 , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, ENTER ,
|
||||
/*|-------`----`----`----`----`----`----`----`----`----`----`----`----------| ,----. */
|
||||
LSFT , Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, RSFT , UP ,
|
||||
/*|---------`----`----`----`----`----`----`----`----`----`----`-------------.--|----|----. */
|
||||
LCTL ,LGUI ,LALT , SPACE , X1 ,RALT ,RCTL , LEFT,DOWN,RGHT
|
||||
/*`-----+-----+-----+------------------------------+------+-----+-----' `----+----+----' */
|
||||
),
|
||||
|
||||
[_FN1] = KEYMAP(
|
||||
/*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */
|
||||
GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , VOLU,HOME,
|
||||
/*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| |ins-`pgup| */
|
||||
, , , UP , , , , , , , , , , , VOLD,END,
|
||||
/*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| `del-`pgdn' */
|
||||
, ,LEFT,DOWN,RGHT, , , , , , , , ,
|
||||
/*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| ,----. */
|
||||
, , , , , , ,MUTE, , , , , MUTE,
|
||||
/*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-.--|-up-|----. */
|
||||
, , , , , , , MPRV,MPLY,MNXT
|
||||
/*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */
|
||||
),
|
||||
|
||||
[_FN2] = KEYMAP(
|
||||
/*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */
|
||||
GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , VOLU,HOME,
|
||||
/*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| |ins-`pgup| */
|
||||
, , , UP , , , , 7 , 8 , 9 , , , , , VOLD,END,
|
||||
/*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| `del-`pgdn' */
|
||||
, ,LEFT,DOWN,RGHT, , , 4 , 5 , 6 , , , ,
|
||||
/*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| ,----. */
|
||||
, , , , , , 0 , 1 , 2 , 3 , , , MUTE,
|
||||
/*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-.--|-up-|----. */
|
||||
, , , , , , , MPRV,MPLY,MNXT
|
||||
/*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */
|
||||
)
|
||||
};
|
||||
|
||||
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;
|
||||
};
|
@ -0,0 +1,8 @@
|
||||
#include "magicforce68.h"
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
// put your keyboard start-up code here
|
||||
// runs once when the firmware starts up
|
||||
|
||||
matrix_init_user();
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
#ifndef MAGICFORCE68_H
|
||||
#define MAGICFORCE68_H
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
#define KEYMAP( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K2E, \
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K3E, \
|
||||
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \
|
||||
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3C, K3D, \
|
||||
K40, K41, K42, K45, K49, K4A, K4B, K4C, K4D, K4E \
|
||||
) { \
|
||||
{ KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E }, \
|
||||
{ KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E }, \
|
||||
{ KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_NO, KC_##K2E }, \
|
||||
{ KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_NO, KC_##K3C, KC_##K3D, KC_##K3E }, \
|
||||
{ KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_##K45, KC_NO, KC_NO, KC_NO, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E } \
|
||||
}
|
||||
|
||||
#endif
|
@ -0,0 +1,83 @@
|
||||
|
||||
# MCU name
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE ?= no # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../Makefile
|
||||
endif
|
||||
|
||||
avrdude: build
|
||||
ls /dev/tty* > /tmp/1; \
|
||||
echo "Reset your Pro Micro now"; \
|
||||
while [[ -z $$USB ]]; do \
|
||||
sleep 1; \
|
||||
ls /dev/tty* > /tmp/2; \
|
||||
USB=`diff /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`; \
|
||||
done; \
|
||||
avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex
|
||||
|
||||
.PHONY: avrdude
|
After Width: | Height: | Size: 72 KiB |
@ -0,0 +1,44 @@
|
||||
Priyadi Keymap for Planck-like Keyboards
|
||||
========================================
|
||||
|
||||
Main layer modifications from default Planck layout:
|
||||
|
||||
* Enter moved to quotes position
|
||||
* Quotes moved to semicolon position.
|
||||
* QWERTZ style colon & semicolon. shift-. = : shift-, = ; This is done in hardware, no layout switching needed in software.
|
||||
* < & > occupied precious real estate, and so they are moved down to punctuation layer.
|
||||
* Right-shift on Enter position.
|
||||
* Removed arrow keys, they are on another layer now.
|
||||
* Put Ctrl-Alt-Super and Super-AltGr-Ctrl in left & right corners.
|
||||
* Lower & Raise is now called Num and Fun.
|
||||
* OS & Left keys become another thumb modifier: Empty & Greek (Empty because I used this for another use and my muscle memory is not adapted to it yet)
|
||||
|
||||
On Promethium, Trackpoint is enabled on PD2 and PD3. We impersonate a Thinkpad keyboard to be able to use Thinkpad driver on Windows (still needs verification).
|
||||
|
||||
AltGr & Compose dual use key. Tap for Compose (mapped to Scroll Lock in hardware) and press for AltGr.
|
||||
|
||||
Supported layouts: QWERTY, DVORAK, Colemak, Workman, Norman. Switchable from SYS layer. In DVORAK, semicolon is replaced by /? key.
|
||||
|
||||
Num activates NUM layer: hexkeypad on the right side and most punctuation on the left side. Hexkeypad is optimized for C-style hex, IPv6, HTML RGB triplets, etc.
|
||||
|
||||
Fun activates FUN layer: arrow cluster on right home row, F-numbers on left side.
|
||||
|
||||
Pressing Num+Fun activates PUNC layer: same punctuations as NUM layer on the left side, parens on the right side.
|
||||
|
||||
Greek activates either GREEKU or GREEKL layer, depending whether shift is pressed or not. Shift state changes are also taken into account when the layer is active.
|
||||
|
||||
Greek+Empty activates EMOJI layer. The whole keyboard now outputs emojis!
|
||||
|
||||
Pressing both spacebars (spacekeys, actually) activates GUI layer. QWERTYUIOP switches to a virtual desktop. J & L switches virtual desktop to the left or right. S & F behaves like Alt-Tab and Alt-Shift-Tab. This works by sending Alt press when entering the layer, and Alt release when other than S or F keys are pressed.
|
||||
|
||||
Pressing both Ctrls activates SYS layer for configuring the keyboard.
|
||||
|
||||
On Promethium, USB or Bluetooth output is detected on startup. If USB is connected, then USB is used initially. SYS-U and SYS-B switch output to USB or Bluetooth at runtime. Current active output is indicated with LEDs.
|
||||
|
||||
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.
|
||||
|
||||
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's a LED to indicate battery level. Hue indicates level: green is full, red is empty.
|
@ -1,108 +1,10 @@
|
||||
#ifndef PROMETHIUM_H
|
||||
#define PROMETHIUM_H
|
||||
|
||||
#include "quantum.h"
|
||||
#include "stdint.h"
|
||||
|
||||
#define PS2_INIT_DELAY 2000
|
||||
#define UNICODE_TYPE_DELAY 0
|
||||
#define BATTERY_PIN 9
|
||||
#define BATTERY_POLL 30000
|
||||
#define MAX_VOLTAGE 4.2
|
||||
#define MIN_VOLTAGE 3.2
|
||||
|
||||
#define KEYMAP( \
|
||||
k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \
|
||||
k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \
|
||||
k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \
|
||||
k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c \
|
||||
) \
|
||||
{ \
|
||||
{k11, k12, k13, k14, k15, k16}, \
|
||||
{k21, k22, k23, k24, k25, k26}, \
|
||||
{k31, k32, k33, k34, k35, k36}, \
|
||||
{k41, k42, k43, k44, k45, k46}, \
|
||||
{k17, k18, k19, k1a, k1b, k1c}, \
|
||||
{k27, k28, k29, k2a, k2b, k2c}, \
|
||||
{k37, k38, k39, k3a, k3b, k3c}, \
|
||||
{k47, k48, k49, k4a, k4b, k4c} \
|
||||
}
|
||||
|
||||
|
||||
|
||||
enum led_sequence {
|
||||
LED_IND_BLUETOOTH,
|
||||
LED_IND_USB,
|
||||
LED_IND_BATTERY,
|
||||
|
||||
LED_IND_FUNC,
|
||||
LED_IND_NUM,
|
||||
LED_IND_EMOJI,
|
||||
|
||||
LED_BKSP,
|
||||
LED_ENT,
|
||||
LED_RSFT,
|
||||
LED_RCTL,
|
||||
|
||||
LED_RGUI,
|
||||
LED_SLSH,
|
||||
LED_SCLN,
|
||||
LED_P,
|
||||
|
||||
LED_O,
|
||||
LED_L,
|
||||
LED_DOT,
|
||||
LED_RALT,
|
||||
|
||||
LED_EMOJI,
|
||||
LED_COMM,
|
||||
LED_K,
|
||||
LED_I,
|
||||
|
||||
LED_U,
|
||||
LED_J,
|
||||
LED_M,
|
||||
LED_FUNC,
|
||||
|
||||
LED_RSPC,
|
||||
LED_N,
|
||||
LED_HH,
|
||||
LED_Y,
|
||||
|
||||
LED_TRACKPOINT3,
|
||||
LED_TRACKPOINT2,
|
||||
LED_TRACKPOINT1,
|
||||
|
||||
LED_LSPC,
|
||||
LED_B,
|
||||
LED_G,
|
||||
LED_T,
|
||||
|
||||
LED_R,
|
||||
LED_F,
|
||||
LED_V,
|
||||
LED_NUM,
|
||||
|
||||
LED_PUNC,
|
||||
LED_C,
|
||||
LED_D,
|
||||
LED_E,
|
||||
|
||||
LED_W,
|
||||
LED_S,
|
||||
LED_X,
|
||||
LED_LALT,
|
||||
|
||||
LED_LGUI,
|
||||
LED_Z,
|
||||
LED_A,
|
||||
LED_Q,
|
||||
|
||||
LED_TAB,
|
||||
LED_ESC,
|
||||
LED_LSFT,
|
||||
LED_LCTL,
|
||||
};
|
||||
void battery_poll(uint8_t level);
|
||||
void led_set_kb(uint8_t usb_led);
|
||||
void led_set_user(uint8_t usb_led);
|
||||
|
||||
#endif
|
||||
|
||||
void battery_poll(uint8_t level);
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
@ -0,0 +1,39 @@
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "../../config.h"
|
||||
|
||||
#define PRIYADI_PLANCK
|
||||
|
||||
/* bootmagic salt key */
|
||||
#define BOOTMAGIC_KEY_SALT KC_ESC
|
||||
|
||||
/* skip bootmagic and eeconfig */
|
||||
#define BOOTMAGIC_KEY_SKIP KC_SPACE
|
||||
|
||||
#define PREVENT_STUCK_MODIFIERS
|
||||
|
||||
#define UNICODE_TYPE_DELAY 0
|
||||
|
||||
#define LAYOUT_DVORAK
|
||||
#define LAYOUT_COLEMAK
|
||||
#define LAYOUT_NORMAN
|
||||
#define LAYOUT_WORKMAN
|
||||
|
||||
#define DOUBLESPACE_LAYER_ENABLE
|
||||
// #define TOLELOT_ENABLE
|
||||
|
||||
#define KEYMAP( \
|
||||
k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \
|
||||
k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \
|
||||
k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \
|
||||
k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c \
|
||||
) \
|
||||
{ \
|
||||
{k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c}, \
|
||||
{k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c}, \
|
||||
{k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c}, \
|
||||
{k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c} \
|
||||
}
|
||||
|
||||
#endif
|
@ -1,680 +1 @@
|
||||
// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
|
||||
// this is the style you want to emulate.
|
||||
|
||||
#include "planck.h"
|
||||
#include "action_layer.h"
|
||||
#ifdef AUDIO_ENABLE
|
||||
#include "audio.h"
|
||||
#include "musical_notes.h"
|
||||
#endif
|
||||
#include "eeconfig.h"
|
||||
#include "process_unicode.h"
|
||||
#include "quantum.h"
|
||||
|
||||
// #define TOLELOT_ENABLE
|
||||
|
||||
extern keymap_config_t keymap_config;
|
||||
|
||||
enum layers {
|
||||
_QWERTY,
|
||||
_COLEMAK,
|
||||
_WORKMAN,
|
||||
_PUNC,
|
||||
_NUM,
|
||||
_FUNC,
|
||||
_EMOJI,
|
||||
_GREEKU,
|
||||
_GREEKL,
|
||||
_GUI,
|
||||
};
|
||||
|
||||
enum planck_keycodes {
|
||||
// layouts
|
||||
QWERTY = SAFE_RANGE,
|
||||
COLEMAK,
|
||||
WORKMAN,
|
||||
|
||||
// layer switchers
|
||||
PUNC,
|
||||
NUM,
|
||||
FUNC,
|
||||
EMOJI,
|
||||
GUI,
|
||||
GREEK,
|
||||
|
||||
// os switchers
|
||||
LINUX,
|
||||
WIN,
|
||||
OSX,
|
||||
};
|
||||
|
||||
// Fillers to make layering clearer
|
||||
|
||||
#define _______ KC_TRNS
|
||||
#define XXXXXXX KC_NO
|
||||
|
||||
// unicode map
|
||||
|
||||
enum unicode_name {
|
||||
GRIN, // grinning face 😊
|
||||
TJOY, // tears of joy 😂
|
||||
SMILE, // grining face with smiling eyes 😁
|
||||
HEART, // heart ❤
|
||||
EYERT, // smiling face with heart shaped eyes 😍
|
||||
CRY, // crying face 😭
|
||||
SMEYE, // smiling face with smiling eyes 😊
|
||||
UNAMU, // unamused 😒
|
||||
KISS, // kiss 😘
|
||||
HART2, // two hearts 💕
|
||||
WEARY, // weary 😩
|
||||
OKHND, // ok hand sign 👌
|
||||
PENSV, // pensive 😔
|
||||
SMIRK, // smirk 😏
|
||||
RECYC, // recycle ♻
|
||||
WINK, // wink 😉
|
||||
THMUP, // thumb up 👍
|
||||
THMDN, // thumb down 👎
|
||||
PRAY, // pray 🙏
|
||||
PHEW, // relieved 😌
|
||||
MUSIC, // musical notes
|
||||
FLUSH, // flushed 😳
|
||||
CELEB, // celebration 🙌
|
||||
CRY2, // crying face 😢
|
||||
COOL, // smile with sunglasses 😎
|
||||
NOEVS, // see no evil
|
||||
NOEVH, // hear no evil
|
||||
NOEVK, // speak no evil
|
||||
POO, // pile of poo
|
||||
EYES, // eyes
|
||||
VIC, // victory hand
|
||||
BHART, // broken heart
|
||||
SLEEP, // sleeping face
|
||||
SMIL2, // smiling face with open mouth & sweat
|
||||
HUNRD, // 100
|
||||
CONFU, // confused
|
||||
TONGU, // face with tongue & winking eye
|
||||
DISAP, // disappointed
|
||||
YUMMY, // face savoring delicious food
|
||||
CLAP, // hand clapping
|
||||
FEAR, // face screaming in fear
|
||||
HORNS, // smiling face with horns
|
||||
HALO, // smiling face with halo
|
||||
BYE, // waving hand
|
||||
SUN, // sun
|
||||
MOON, // moon
|
||||
SKULL, // skull
|
||||
|
||||
// greek letters
|
||||
UALPH,
|
||||
UBETA,
|
||||
UGAMM,
|
||||
UDELT,
|
||||
UEPSI,
|
||||
UZETA,
|
||||
UETA,
|
||||
UTHET,
|
||||
UIOTA,
|
||||
UKAPP,
|
||||
ULAMB,
|
||||
UMU,
|
||||
UNU,
|
||||
UXI,
|
||||
UOMIC,
|
||||
UPI,
|
||||
URHO,
|
||||
USIGM,
|
||||
UTAU,
|
||||
UUPSI,
|
||||
UPHI,
|
||||
UCHI,
|
||||
UPSI,
|
||||
UOMEG,
|
||||
|
||||
LALPH,
|
||||
LBETA,
|
||||
LGAMM,
|
||||
LDELT,
|
||||
LEPSI,
|
||||
LZETA,
|
||||
LETA,
|
||||
LTHET,
|
||||
LIOTA,
|
||||
LKAPP,
|
||||
LLAMB,
|
||||
LMU,
|
||||
LNU,
|
||||
LXI,
|
||||
LOMIC,
|
||||
LPI,
|
||||
LRHO,
|
||||
LSIGM,
|
||||
LTAU,
|
||||
LUPSI,
|
||||
LPHI,
|
||||
LCHI,
|
||||
LPSI,
|
||||
LOMEG,
|
||||
|
||||
FSIGM,
|
||||
};
|
||||
|
||||
const uint32_t PROGMEM unicode_map[] = {
|
||||
[GRIN] = 0x1F600,
|
||||
[TJOY] = 0x1F602,
|
||||
[SMILE] = 0x1F601,
|
||||
[HEART] = 0x2764,
|
||||
[EYERT] = 0x1f60d,
|
||||
[CRY] = 0x1f62d,
|
||||
[SMEYE] = 0x1F60A,
|
||||
[UNAMU] = 0x1F612,
|
||||
[KISS] = 0x1F618,
|
||||
[HART2] = 0x1F495,
|
||||
[WEARY] = 0x1F629,
|
||||
[OKHND] = 0x1F44C,
|
||||
[PENSV] = 0x1F614,
|
||||
[SMIRK] = 0x1F60F,
|
||||
[RECYC] = 0x267B,
|
||||
[WINK] = 0x1F609,
|
||||
[THMUP] = 0x1F44D,
|
||||
[THMDN] = 0x1F44E,
|
||||
[PRAY] = 0x1F64F,
|
||||
[PHEW] = 0x1F60C,
|
||||
[MUSIC] = 0x1F3B6,
|
||||
[FLUSH] = 0x1F633,
|
||||
[CELEB] = 0x1F64C,
|
||||
[CRY2] = 0x1F622,
|
||||
[COOL] = 0x1F60E,
|
||||
[NOEVS] = 0x1F648,
|
||||
[NOEVH] = 0x1F649,
|
||||
[NOEVK] = 0x1F64A,
|
||||
[POO] = 0x1F4A9,
|
||||
[EYES] = 0x1F440,
|
||||
[VIC] = 0x270C,
|
||||
[BHART] = 0x1F494,
|
||||
[SLEEP] = 0x1F634,
|
||||
[SMIL2] = 0x1F605,
|
||||
[HUNRD] = 0x1F4AF,
|
||||
[CONFU] = 0x1F615,
|
||||
[TONGU] = 0x1F61C,
|
||||
[DISAP] = 0x1F61E,
|
||||
[YUMMY] = 0x1F60B,
|
||||
[CLAP] = 0x1F44F,
|
||||
[FEAR] = 0x1F631,
|
||||
[HORNS] = 0x1F608,
|
||||
[HALO] = 0x1F607,
|
||||
[BYE] = 0x1F44B,
|
||||
[SUN] = 0x2600,
|
||||
[MOON] = 0x1F314,
|
||||
[SKULL] = 0x1F480,
|
||||
|
||||
// greek letters
|
||||
[UALPH] = 0x0391,
|
||||
[UBETA] = 0x0392,
|
||||
[UGAMM] = 0x0393,
|
||||
[UDELT] = 0x0394,
|
||||
[UEPSI] = 0x0395,
|
||||
[UZETA] = 0x0396,
|
||||
[UETA] = 0x0397,
|
||||
[UTHET] = 0x0398,
|
||||
[UIOTA] = 0x0399,
|
||||
[UKAPP] = 0x039A,
|
||||
[ULAMB] = 0x039B,
|
||||
[UMU] = 0x039C,
|
||||
[UNU] = 0x039D,
|
||||
[UXI] = 0x039E,
|
||||
[UOMIC] = 0x039F,
|
||||
[UPI] = 0x03A0,
|
||||
[URHO] = 0x03A1,
|
||||
[USIGM] = 0x03A3,
|
||||
[UTAU] = 0x03A4,
|
||||
[UUPSI] = 0x03A5,
|
||||
[UPHI] = 0x03A6,
|
||||
[UCHI] = 0x03A7,
|
||||
[UPSI] = 0x03A8,
|
||||
[UOMEG] = 0x03A9,
|
||||
[LALPH] = 0x03B1,
|
||||
[LBETA] = 0x03B2,
|
||||
[LGAMM] = 0x03B3,
|
||||
[LDELT] = 0x03B4,
|
||||
[LEPSI] = 0x03B5,
|
||||
[LZETA] = 0x03B6,
|
||||
[LETA] = 0x03B7,
|
||||
[LTHET] = 0x03B8,
|
||||
[LIOTA] = 0x03B9,
|
||||
[LKAPP] = 0x03BA,
|
||||
[LLAMB] = 0x03BB,
|
||||
[LMU] = 0x03BC,
|
||||
[LNU] = 0x03BD,
|
||||
[LXI] = 0x03BE,
|
||||
[LOMIC] = 0x03BF,
|
||||
[LPI] = 0x03C0,
|
||||
[LRHO] = 0x03C1,
|
||||
[LSIGM] = 0x03C3,
|
||||
[LTAU] = 0x03C4,
|
||||
[LUPSI] = 0x03C5,
|
||||
[LPHI] = 0x03C6,
|
||||
[LCHI] = 0x03C7,
|
||||
[LPSI] = 0x03C8,
|
||||
[LOMEG] = 0x03C9,
|
||||
[FSIGM] = 0x03C2,
|
||||
};
|
||||
|
||||
|
||||
// hybrid shift - =
|
||||
// #undef KC_LSFT
|
||||
// #define KC_LSFT MT(MOD_LSFT, KC_MINS)
|
||||
// #undef KC_RSFT
|
||||
// #define KC_RSFT MT(MOD_LSFT, KC_EQL)
|
||||
|
||||
|
||||
// hybrid right-gui & scroll lock (mapped to Compose in OS)
|
||||
#undef KC_RCTL
|
||||
#define KC_RCTL MT(MOD_LCTL, KC_SLCK)
|
||||
|
||||
// keymaps
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* Qwerty
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Esc | A | S | D | F | G | H | J | K | L | ; |Enter |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | Shift| Z | X | C | V | B | N | M | , | . | / |Shift |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Ctrl | GUI | Alt | Punc | Num | Space | Func |Emoji |Greek |AltGr | Ctrl |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_QWERTY] = {
|
||||
{KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
|
||||
{KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_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_LCTL, KC_LALT, KC_LGUI, PUNC, NUM, KC_SPC, KC_SPC, FUNC, EMOJI, GREEK, KC_RALT, KC_RCTL}
|
||||
},
|
||||
|
||||
/* Colemak
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Esc | A | R | S | T | D | H | N | E | I | O |Enter |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | Shift| Z | X | C | V | B | K | M | , | . | / |Shift |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Ctrl | GUI | Alt | Punc | Num | Space | Func |Emoji |AltGr | GUI | Ctrl |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_COLEMAK] = {
|
||||
{_______, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______},
|
||||
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
|
||||
},
|
||||
|
||||
/* Workman
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | Tab | Q | D | R | W | B | J | F | U | P | ; | Bksp |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Esc | A | S | H | T | G | Y | N | E | O | I |Enter |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | Shift| Z | X | M | C | V | K | K | , | . | / |Shift |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Ctrl | GUI | Alt | Punc | Num | Space | Func |Emoji |AltGr | GUI | Ctrl |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_WORKMAN] = {
|
||||
{_______, 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_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, _______},
|
||||
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
|
||||
},
|
||||
|
||||
/* Uppercase Greek
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | | |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_GREEKU] = {
|
||||
{_______, _______, _______,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), _______, _______},
|
||||
{_______,X(UZETA), X(UCHI), X(UPSI),X(UOMEG),X(UBETA), X(UNU), X(UMU), _______, _______, _______, _______},
|
||||
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
|
||||
},
|
||||
|
||||
/* Lowercase Greek
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | | |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_GREEKL] = {
|
||||
{_______, _______,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), _______, _______},
|
||||
{_______,X(LZETA), X(LCHI), X(LPSI),X(LOMEG),X(LBETA), X(LNU), X(LMU), _______, _______, _______, _______},
|
||||
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
|
||||
},
|
||||
|
||||
/* Punc
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | ` |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | | | \ | - | = | < | > | ( | ) | ' | | |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | | | | _ | + | { | } | [ | ] | " | | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_PUNC] = {
|
||||
{KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_GRV },
|
||||
{XXXXXXX, XXXXXXX, KC_BSLS, KC_MINS, KC_EQL, KC_LABK, KC_RABK, KC_LPRN, KC_RPRN, KC_QUOT, XXXXXXX, XXXXXXX},
|
||||
{XXXXXXX, XXXXXXX, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_LBRC, KC_RBRC, KC_DQUO, XXXXXXX, XXXXXXX},
|
||||
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
|
||||
},
|
||||
|
||||
/* Num
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | ^ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Esc | @ | A | B | C | ( | ) | 4 | 5 | 6 | : |Enter |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | & | # | D | E | F | [ | ] | 1 | 2 | 3 | / | * |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | x | | | 0 | , | . | + | - |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_NUM] = {
|
||||
{KC_CIRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
|
||||
{ KC_ESC, KC_AT, S(KC_A), S(KC_B), S(KC_C), KC_LPRN, KC_RPRN, KC_4, KC_5, KC_6, KC_COLN, KC_ENT},
|
||||
{KC_AMPR, KC_HASH, S(KC_D), S(KC_E), S(KC_F), KC_LBRC, KC_RBRC, KC_1, KC_2, KC_3, KC_SLSH, KC_ASTR},
|
||||
{_______, _______, _______, KC_X, _______, KC_SPC, KC_SPC, KC_0, KC_COMM, KC_DOT, KC_PLUS, KC_MINS}
|
||||
},
|
||||
|
||||
/* Func
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | | F1 | F2 | F3 | F4 | | | PgUp | Up | PgDn | PgUp | Del |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | | F5 | F6 | F7 | F8 |PrtSc | | Left | Down | Right| PgDn | Ins |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | F9 | F10 | F11 | F12 | | | | Home | End | | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_FUNC] = {
|
||||
{XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_PGUP, KC_DEL},
|
||||
{XXXXXXX, KC_F5, KC_F6, KC_F7, KC_F8,KC_PSCREEN,XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_INS},
|
||||
{_______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_END, XXXXXXX, _______},
|
||||
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
|
||||
},
|
||||
|
||||
/* Emoji
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | | |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_EMOJI] = {
|
||||
{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(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)}
|
||||
},
|
||||
|
||||
/* GUI
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | | D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8 | D9 | D10 | |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* |Linux | | Vol- | Mute | Vol+ | | | D- | | D+ | |Qwerty|
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Win | | Prev | Play | Next | | | | | | |Colmak|
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | OSX | | | | | BL- | BL+ | | | | |Workmn|
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_GUI] = {
|
||||
{_______, LGUI(KC_1),LGUI(KC_2),LGUI(KC_3),LGUI(KC_4),LGUI(KC_5),LGUI(KC_6),LGUI(KC_7),LGUI(KC_8),LGUI(KC_9),LGUI(KC_0), _______},
|
||||
{ LINUX, _______, KC_VOLD, KC_MUTE, KC_VOLU,_______,_______,KC_WWW_BACK,_______,KC_WWW_FORWARD,_______, QWERTY},
|
||||
{ WIN, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, _______, _______, _______, COLEMAK},
|
||||
{ OSX, _______, _______, _______, _______, BL_DEC, BL_INC, _______, _______, _______, _______, WORKMAN}
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
float tone_startup[][2] = SONG(STARTUP_SOUND);
|
||||
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
|
||||
float tone_colemak[][2] = SONG(COLEMAK_SOUND);
|
||||
float tone_workman[][2] = SONG(DVORAK_SOUND);
|
||||
float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
|
||||
float tone_linux[][2] = SONG(CAPS_LOCK_ON_SOUND);
|
||||
float tone_windows[][2] = SONG(SCROLL_LOCK_ON_SOUND);
|
||||
float tone_osx[][2] = SONG(NUM_LOCK_ON_SOUND);
|
||||
float tone_click[][2] = SONG(MUSICAL_NOTE(_F3, 2));
|
||||
float tone_release[][2] = SONG(MUSICAL_NOTE(_A3, 2));
|
||||
float tone_tolelot[][2] = SONG(Q__NOTE(_E5), Q__NOTE(_C5), Q__NOTE(_D5));
|
||||
#endif
|
||||
|
||||
void persistant_default_layer_set(uint16_t default_layer) {
|
||||
eeconfig_update_default_layer(default_layer);
|
||||
default_layer_set(default_layer);
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
// faux clicky
|
||||
// if (record->event.pressed) PLAY_NOTE_ARRAY(tone_click, false, 0);
|
||||
#ifdef AUDIO_ENABLE
|
||||
#ifdef TOLELOT_ENABLE
|
||||
if (record->event.pressed) {
|
||||
PLAY_NOTE_ARRAY(tone_tolelot, false, 0);
|
||||
}
|
||||
#else
|
||||
if (record->event.pressed) {
|
||||
PLAY_NOTE_ARRAY(tone_click, false, 0);
|
||||
} else {
|
||||
PLAY_NOTE_ARRAY(tone_release, false, 0);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
bool lshifted = keyboard_report->mods & MOD_BIT(KC_LSFT);
|
||||
bool rshifted = keyboard_report->mods & MOD_BIT(KC_RSFT);
|
||||
|
||||
switch (keycode) {
|
||||
// Greek layer handling
|
||||
case GREEK:
|
||||
if (record->event.pressed) {
|
||||
if (lshifted || rshifted) {
|
||||
layer_on(_GREEKU);
|
||||
layer_off(_GREEKL);
|
||||
} else {
|
||||
layer_on(_GREEKL);
|
||||
layer_off(_GREEKU);
|
||||
}
|
||||
} else {
|
||||
layer_off(_GREEKU);
|
||||
layer_off(_GREEKL);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
case KC_LSFT:
|
||||
case KC_RSFT:
|
||||
;
|
||||
uint8_t layer = biton32(layer_state);
|
||||
if (layer == _GREEKU || layer == _GREEKL) {
|
||||
if (record->event.pressed) {
|
||||
layer_on(_GREEKU);
|
||||
layer_off(_GREEKL);
|
||||
} else {
|
||||
if (lshifted ^ rshifted) { // if only one shift is pressed
|
||||
layer_on(_GREEKL);
|
||||
layer_off(_GREEKU);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
break;
|
||||
|
||||
// QWERTZ style comma and dot: semicolon and colon when shifted
|
||||
case KC_COMM:
|
||||
if (record->event.pressed) {
|
||||
if (lshifted || rshifted) {
|
||||
if (lshifted) unregister_code(KC_LSFT);
|
||||
if (rshifted) unregister_code(KC_RSFT);
|
||||
register_code(KC_SCLN);
|
||||
unregister_code(KC_SCLN);
|
||||
if (lshifted) register_code(KC_LSFT);
|
||||
if (rshifted) register_code(KC_RSFT);
|
||||
} else {
|
||||
register_code(KC_COMM);
|
||||
unregister_code(KC_COMM);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case KC_DOT:
|
||||
if (record->event.pressed) {
|
||||
if ((keyboard_report->mods & MOD_BIT(KC_LSFT)) || (keyboard_report->mods & MOD_BIT(KC_RSFT))) {
|
||||
register_code(KC_SCLN);
|
||||
unregister_code(KC_SCLN);
|
||||
} else {
|
||||
register_code(KC_DOT);
|
||||
unregister_code(KC_DOT);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
// layout switcher
|
||||
case QWERTY:
|
||||
if (record->event.pressed) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
|
||||
#endif
|
||||
persistant_default_layer_set(1UL<<_QWERTY);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case COLEMAK:
|
||||
if (record->event.pressed) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_NOTE_ARRAY(tone_colemak, false, 0);
|
||||
#endif
|
||||
persistant_default_layer_set(1UL<<_COLEMAK);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case WORKMAN:
|
||||
if (record->event.pressed) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_NOTE_ARRAY(tone_workman, false, 0);
|
||||
#endif
|
||||
persistant_default_layer_set(1UL<<_WORKMAN);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
// layer switchers
|
||||
case PUNC:
|
||||
if (record->event.pressed) {
|
||||
layer_on(_PUNC);
|
||||
update_tri_layer(_PUNC, _EMOJI, _GUI);
|
||||
} else {
|
||||
layer_off(_PUNC);
|
||||
update_tri_layer(_PUNC, _EMOJI, _GUI);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case EMOJI:
|
||||
if (record->event.pressed) {
|
||||
layer_on(_EMOJI);
|
||||
update_tri_layer(_PUNC, _EMOJI, _GUI);
|
||||
} else {
|
||||
layer_off(_EMOJI);
|
||||
update_tri_layer(_PUNC, _EMOJI, _GUI);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case NUM:
|
||||
if (record->event.pressed) {
|
||||
layer_on(_NUM);
|
||||
} else {
|
||||
layer_off(_NUM);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case FUNC:
|
||||
if (record->event.pressed) {
|
||||
layer_on(_FUNC);
|
||||
} else {
|
||||
layer_off(_FUNC);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
// OS switchers
|
||||
case LINUX:
|
||||
set_unicode_input_mode(UC_LNX);
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_NOTE_ARRAY(tone_linux, false, 0);
|
||||
#endif
|
||||
return false;
|
||||
break;
|
||||
case WIN:
|
||||
set_unicode_input_mode(UC_WINC);
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_NOTE_ARRAY(tone_windows, false, 0);
|
||||
#endif
|
||||
return false;
|
||||
break;
|
||||
case OSX:
|
||||
set_unicode_input_mode(UC_OSX);
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_NOTE_ARRAY(tone_osx, false, 0);
|
||||
#endif
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void matrix_init_user(void) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
startup_user();
|
||||
#endif
|
||||
set_unicode_input_mode(UC_LNX);
|
||||
}
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
|
||||
void startup_user()
|
||||
{
|
||||
_delay_ms(20); // gets rid of tick
|
||||
PLAY_NOTE_ARRAY(tone_startup, false, 0);
|
||||
}
|
||||
|
||||
void shutdown_user()
|
||||
{
|
||||
PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
|
||||
_delay_ms(150);
|
||||
stop_all_notes();
|
||||
}
|
||||
|
||||
#endif
|
||||
#include "../../../handwired/promethium/keymaps/priyadi/keymap.c"
|
@ -0,0 +1,3 @@
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
@ -0,0 +1,162 @@
|
||||
/*
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEAE
|
||||
#define PRODUCT_ID 0x8846
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER TheVan Keyboards
|
||||
#define PRODUCT Roadkit Micro
|
||||
#define DESCRIPTION keyboard firmware for Roadkit Micro
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 4
|
||||
#define MATRIX_COLS 4
|
||||
|
||||
/*
|
||||
* Keyboard Matrix Assignments
|
||||
*
|
||||
* Change this to how you wired your keyboard
|
||||
* COLS: AVR pins used for columns, left to right
|
||||
* ROWS: AVR pins used for rows, top to bottom
|
||||
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||
*
|
||||
*/
|
||||
#define MATRIX_ROW_PINS { F0, F5, D7, B4 }
|
||||
#define MATRIX_COL_PINS { F1, F4, D6, D4 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
// #define BACKLIGHT_PIN B7
|
||||
// #define BACKLIGHT_BREATHING
|
||||
// #define BACKLIGHT_LEVELS 3
|
||||
|
||||
|
||||
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||
#define DEBOUNCING_DELAY 5
|
||||
|
||||
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* number of backlight levels */
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/*
|
||||
* Force NKRO
|
||||
*
|
||||
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
|
||||
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
|
||||
* makefile for this to work.)
|
||||
*
|
||||
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
|
||||
* until the next keyboard reset.
|
||||
*
|
||||
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
|
||||
* fully operational during normal computer usage.
|
||||
*
|
||||
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
|
||||
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
|
||||
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
|
||||
* power-up.
|
||||
*
|
||||
*/
|
||||
//#define FORCE_NKRO
|
||||
|
||||
/*
|
||||
* Magic Key Options
|
||||
*
|
||||
* Magic keys are hotkey commands that allow control over firmware functions of
|
||||
* the keyboard. They are best used in combination with the HID Listen program,
|
||||
* found here: https://www.pjrc.com/teensy/hid_listen.html
|
||||
*
|
||||
* The options below allow the magic key functionality to be changed. This is
|
||||
* useful if your keyboard/keypad is missing keys and you want magic key support.
|
||||
*
|
||||
*/
|
||||
|
||||
/* key combination for magic key command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
/* control how magic key switches layers */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
|
||||
|
||||
/* override magic key keymap */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
|
||||
//#define MAGIC_KEY_HELP1 H
|
||||
//#define MAGIC_KEY_HELP2 SLASH
|
||||
//#define MAGIC_KEY_DEBUG D
|
||||
//#define MAGIC_KEY_DEBUG_MATRIX X
|
||||
//#define MAGIC_KEY_DEBUG_KBD K
|
||||
//#define MAGIC_KEY_DEBUG_MOUSE M
|
||||
//#define MAGIC_KEY_VERSION V
|
||||
//#define MAGIC_KEY_STATUS S
|
||||
//#define MAGIC_KEY_CONSOLE C
|
||||
//#define MAGIC_KEY_LAYER0_ALT1 ESC
|
||||
//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
|
||||
//#define MAGIC_KEY_LAYER0 0
|
||||
//#define MAGIC_KEY_LAYER1 1
|
||||
//#define MAGIC_KEY_LAYER2 2
|
||||
//#define MAGIC_KEY_LAYER3 3
|
||||
//#define MAGIC_KEY_LAYER4 4
|
||||
//#define MAGIC_KEY_LAYER5 5
|
||||
//#define MAGIC_KEY_LAYER6 6
|
||||
//#define MAGIC_KEY_LAYER7 7
|
||||
//#define MAGIC_KEY_LAYER8 8
|
||||
//#define MAGIC_KEY_LAYER9 9
|
||||
//#define MAGIC_KEY_BOOTLOADER PAUSE
|
||||
//#define MAGIC_KEY_LOCK CAPS
|
||||
//#define MAGIC_KEY_EEPROM E
|
||||
//#define MAGIC_KEY_NKRO N
|
||||
//#define MAGIC_KEY_SLEEP_LED Z
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
*/
|
||||
|
||||
/* disable debug print */
|
||||
//#define NO_DEBUG
|
||||
|
||||
/* disable print */
|
||||
//#define NO_PRINT
|
||||
|
||||
/* disable action features */
|
||||
//#define NO_ACTION_LAYER
|
||||
//#define NO_ACTION_TAPPING
|
||||
//#define NO_ACTION_ONESHOT
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
|
||||
#endif
|
@ -0,0 +1,21 @@
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
@ -0,0 +1,8 @@
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "../../config.h"
|
||||
|
||||
// place overrides here
|
||||
|
||||
#endif
|
@ -0,0 +1,49 @@
|
||||
#include "roadkit.h"
|
||||
#include "action_layer.h"
|
||||
#include "eeconfig.h"
|
||||
|
||||
extern keymap_config_t keymap_config;
|
||||
|
||||
// Each layer gets a name for readability, which is then used in the keymap matrix below.
|
||||
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
|
||||
// Layer names don't all need to be of the same length, obviously, and you can also skip them
|
||||
// entirely and just use numbers.
|
||||
|
||||
#define _NP 0
|
||||
|
||||
// Macro name shortcuts
|
||||
#define NUMPAD M(_NP)
|
||||
|
||||
// Fillers to make layering more clear
|
||||
#define _______ KC_TRNS
|
||||
#define XXXXXXX KC_NO
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[_NP] = /* Numpad */
|
||||
KEYMAP(KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, \
|
||||
KC_KP_4, KC_KP_5, KC_KP_6, \
|
||||
KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_ENTER, \
|
||||
KC_KP_0, KC_KP_DOT),
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
|
||||
};
|
||||
|
||||
void persistant_default_layer_set(uint16_t default_layer) {
|
||||
eeconfig_update_default_layer(default_layer);
|
||||
default_layer_set(default_layer);
|
||||
}
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
switch(id) {
|
||||
case _NP:
|
||||
if (record->event.pressed) {
|
||||
persistant_default_layer_set(1UL<<_NP);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
@ -0,0 +1 @@
|
||||
# The default keymap for roadkit
|
@ -0,0 +1,21 @@
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
@ -0,0 +1,8 @@
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "../../config.h"
|
||||
|
||||
// place overrides here
|
||||
|
||||
#endif
|
@ -0,0 +1,61 @@
|
||||
#include "roadkit.h"
|
||||
#include "action_layer.h"
|
||||
#include "eeconfig.h"
|
||||
|
||||
extern keymap_config_t keymap_config;
|
||||
|
||||
// Each layer gets a name for readability, which is then used in the keymap matrix below.
|
||||
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
|
||||
// Layer names don't all need to be of the same length, obviously, and you can also skip them
|
||||
// entirely and just use numbers.
|
||||
|
||||
#define _NP 0
|
||||
#define _L1 1
|
||||
|
||||
// Macro name shortcuts
|
||||
#define NUMPAD M(_NP)
|
||||
#define LAYER1 M(_L1)
|
||||
|
||||
// Fillers to make layering more clear
|
||||
#define _______ KC_TRNS
|
||||
#define XXXXXXX KC_NO
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[_NP] = /* Numpad */
|
||||
SINGLES_KEYMAP(KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, \
|
||||
KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_MINUS, \
|
||||
KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_ENTER, \
|
||||
KC_KP_0, KC_KP_DOT, TG(_L1), KC_BSPC),
|
||||
[_L1] = /* LAYER 1 */
|
||||
SINGLES_KEYMAP(KC_NUMLOCK, KC_TRNS, KC_TRNS, KC_VOLU, \
|
||||
KC_TRNS, KC_UP, KC_TRNS, KC_VOLD, \
|
||||
KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS)
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
|
||||
};
|
||||
|
||||
void persistant_default_layer_set(uint16_t default_layer) {
|
||||
eeconfig_update_default_layer(default_layer);
|
||||
default_layer_set(default_layer);
|
||||
}
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
switch(id) {
|
||||
case _L1:
|
||||
if (record->event.pressed) {
|
||||
persistant_default_layer_set(1UL<<_L1);
|
||||
}
|
||||
break;
|
||||
case _NP:
|
||||
if (record->event.pressed) {
|
||||
persistant_default_layer_set(1UL<<_NP);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
@ -0,0 +1,3 @@
|
||||
# The singles keymap for roadkit
|
||||
|
||||
This keymap has a base layer with numpad functionality, and then a second layer with some additional keys. The user is encouraged to develop their own keymap using this as a starting point.
|
@ -0,0 +1,32 @@
|
||||
roadkit keyboard firmware
|
||||
======================
|
||||
|
||||
## Quantum MK Firmware
|
||||
|
||||
For the full Quantum feature list, see [the QMK Wiki](https://github.com/qmk/qmk_firmware/wiki).
|
||||
|
||||
## Building
|
||||
|
||||
Download or clone the whole firmware and navigate to the `keyboards/roadkit` folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex. You can then use the programmer of your choice to program your .hex file.
|
||||
|
||||
Depending on which keymap you would like to use, you will have to compile slightly differently.
|
||||
|
||||
### Default
|
||||
|
||||
To build with the default keymap, simply run `make default`. For the roadkit, the default layout is a standard numpad layout.
|
||||
|
||||
### Singles
|
||||
|
||||
The singles layout for the roadkit corresponds to the configuration where only 1u keys are used and there are 16 of them on the board. To build the singles keymap, run `make singles`.
|
||||
|
||||
### Other Keymaps
|
||||
|
||||
Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files.
|
||||
|
||||
To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
|
||||
|
||||
```
|
||||
$ make [default|jack|<name>]
|
||||
```
|
||||
|
||||
Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/`
|
@ -0,0 +1,28 @@
|
||||
#include "roadkit.h"
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
// put your keyboard start-up code here
|
||||
// runs once when the firmware starts up
|
||||
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
void matrix_scan_kb(void) {
|
||||
// put your looping keyboard code here
|
||||
// runs every cycle (a lot)
|
||||
|
||||
matrix_scan_user();
|
||||
}
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
// put your per-action keyboard code here
|
||||
// runs for every action, just before processing by the firmware
|
||||
|
||||
return process_record_user(keycode, record);
|
||||
}
|
||||
|
||||
void led_set_kb(uint8_t usb_led) {
|
||||
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||
|
||||
led_set_user(usb_led);
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
#ifndef ROADKIT_H
|
||||
#define ROADKIT_H
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
// This is a shortcut to help you visually see your layout.
|
||||
#define KEYMAP( \
|
||||
K00, K01, K02, K03, \
|
||||
K10, K11, K12, \
|
||||
K20, K21, K22, K23, \
|
||||
K30, K32 \
|
||||
) \
|
||||
{ \
|
||||
{ K00, K01, K02, K03 }, \
|
||||
{ K10, K11, K12, KC_NO }, \
|
||||
{ K20, K21, K22, K23 }, \
|
||||
{ K30, KC_NO, K32, KC_NO } \
|
||||
}
|
||||
|
||||
#define SINGLES_KEYMAP( \
|
||||
K00, K01, K02, K03, \
|
||||
K10, K11, K12, K13, \
|
||||
K20, K21, K22, K23, \
|
||||
K30, K31, K32, K33 \
|
||||
) \
|
||||
{ \
|
||||
{ K00, K01, K02, K03 }, \
|
||||
{ K10, K11, K12, K13 }, \
|
||||
{ K20, K21, K22, K23 }, \
|
||||
{ K30, K31, K32, K33 } \
|
||||
}
|
||||
|
||||
#endif
|
@ -0,0 +1,69 @@
|
||||
|
||||
|
||||
# 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 yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
@ -0,0 +1,21 @@
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. 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,20 @@
|
||||
Unxmaal's GH60 Satan Layout
|
||||
=====================
|
||||
* Mostly stolen from /u/robotmaxtron
|
||||
|
||||
##Quantum MK Firmware
|
||||
For the full Quantum feature list, see the parent readme.md.
|
||||
|
||||
* Standard Mac ANSI layout
|
||||
* Spacebar acts as space when tapped, Fn when held
|
||||
* Menu acts as menu when tapped, Fn2 when held
|
||||
* Layer1:
|
||||
* Top row = `~, F1-F12, Del
|
||||
* JKIL = arrow cluster
|
||||
* Layer2:
|
||||
* Top row = media controls
|
||||
* JKIL = PgDn/Up/Home/Insert
|
||||
* Backspace = Reset
|
||||
|
||||
### Additional Credits
|
||||
Keymap has been based on various keymaps available from the QMK Repo for the GH60-SATAN and KC60 keyboards.
|
@ -0,0 +1,119 @@
|
||||
#include "satan.h"
|
||||
|
||||
|
||||
// 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 _AL 1
|
||||
#define _FL 2
|
||||
|
||||
#define _______ KC_TRNS
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/*
|
||||
* ANSI Base, Mac style
|
||||
* ,-----------------------------------------------------------------------------.
|
||||
* |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| = | Backsp |
|
||||
* |-----------------------------------------------------------------------------|
|
||||
* |Tab | Q | W | E | R | T | Y | U | I| O| P| [| ]| \|
|
||||
* |-----------------------------------------------------------------------------|
|
||||
* |Caps/Fn | A| S| D| F| G| H| J| K| L| ;| '| Enter |
|
||||
* |-----------------------------------------------------------------------------|
|
||||
* |Shift | Z| X| C| V| B| N| M| ,| .| /| Shift |
|
||||
* |-----------------------------------------------------------------------------|
|
||||
* |Fn|Alt |Gui | Space(tapped), Fn(held) |Gui |Alt |Menu(tapped, Fn2(held)|Ctrl|
|
||||
* `-----------------------------------------------------------------------------'
|
||||
*/
|
||||
[_BL] = KEYMAP_ANSI(
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \
|
||||
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_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(_AL), KC_LALT,KC_LGUI, LT(_AL,KC_SPACE), KC_RGUI, KC_RALT, LT(_FL,KC_MENU), KC_RCTL),
|
||||
/*
|
||||
* Pok3r style arrow cluster
|
||||
* ,-----------------------------------------------------------.
|
||||
* |`~ | F1| F2| F3| F4| F5| F6| F7| F8| F9| F10| F11| F12|DEL |
|
||||
* |-----------------------------------------------------------|
|
||||
* | | | | | | | | |Up| | | | | |
|
||||
* |-----------------------------------------------------------|
|
||||
* | | | | | | | |Left|Down|Right| | | |
|
||||
* |-----------------------------------------------------------|
|
||||
* | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------|
|
||||
* | | | | | | | | |
|
||||
* `-----------------------------------------------------------'
|
||||
*/
|
||||
[_AL] = KEYMAP_ANSI(
|
||||
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_DELETE, \
|
||||
KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_UP,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_LEFT,KC_DOWN,KC_RGHT,KC_TRNS,KC_TRNS,KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS),
|
||||
/* Keymap _FL: Function Layer
|
||||
* ,-----------------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | RESET|
|
||||
* |-----------------------------------------------------------|
|
||||
* | | | | | | | | | | | |BL-|BL+|BL |
|
||||
* |-----------------------------------------------------------|
|
||||
* | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------|
|
||||
* | | RGB on|RGB step|Hue+|Hue- |Sat+|Sat-|Val+| Val-| | | |
|
||||
* |-----------------------------------------------------------|
|
||||
* | | | | | | | | |
|
||||
* `-----------------------------------------------------------'
|
||||
*/
|
||||
[_FL] = KEYMAP_ANSI(
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
_______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET, \
|
||||
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, BL_DEC,BL_INC, BL_TOGG, \
|
||||
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \
|
||||
_______,RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD,_______,_______,_______, \
|
||||
_______,_______,_______, _______, _______,_______,_______, _______),
|
||||
#else
|
||||
_______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET, \
|
||||
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, BL_DEC, BL_INC,BL_TOGG, \
|
||||
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \
|
||||
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \
|
||||
_______,_______,_______, _______, _______,_______,_______,_______),
|
||||
#endif
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 1.8 MiB |
Before Width: | Height: | Size: 2.0 MiB |
After Width: | Height: | Size: 2.4 MiB |
@ -0,0 +1,68 @@
|
||||
/*
|
||||
Copyright 2017 Priyadi Iman Nurcahyo
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <avr/interrupt.h>
|
||||
#include <avr/io.h>
|
||||
#include <timer.h>
|
||||
#include <fauxclicky.h>
|
||||
#include <stdbool.h>
|
||||
#include <musical_notes.h>
|
||||
|
||||
__attribute__ ((weak))
|
||||
float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_F3, 2);
|
||||
__attribute__ ((weak))
|
||||
float fauxclicky_released_note[2] = MUSICAL_NOTE(_A3, 2);
|
||||
__attribute__ ((weak))
|
||||
float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C3, 2);
|
||||
|
||||
bool fauxclicky_enabled = true;
|
||||
uint16_t note_start = 0;
|
||||
bool note_playing = false;
|
||||
uint16_t note_period = 0;
|
||||
|
||||
void fauxclicky_init()
|
||||
{
|
||||
// Set port PC6 (OC3A and /OC4A) as output
|
||||
DDRC |= _BV(PORTC6);
|
||||
|
||||
// TCCR3A / TCCR3B: Timer/Counter #3 Control Registers
|
||||
TCCR3A = (0 << COM3A1) | (0 << COM3A0) | (1 << WGM31) | (0 << WGM30);
|
||||
TCCR3B = (1 << WGM33) | (1 << WGM32) | (0 << CS32) | (1 << CS31) | (0 << CS30);
|
||||
}
|
||||
|
||||
void fauxclicky_stop()
|
||||
{
|
||||
FAUXCLICKY_DISABLE_OUTPUT;
|
||||
note_playing = false;
|
||||
}
|
||||
|
||||
void fauxclicky_play(float note[2]) {
|
||||
if (!fauxclicky_enabled) return;
|
||||
if (note_playing) fauxclicky_stop();
|
||||
FAUXCLICKY_TIMER_PERIOD = (uint16_t)(((float)F_CPU) / (note[0] * FAUXCLICKY_CPU_PRESCALER));
|
||||
FAUXCLICKY_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (note[0] * FAUXCLICKY_CPU_PRESCALER)) / 2);
|
||||
note_playing = true;
|
||||
note_period = (note[1] / 16) * (60 / (float)FAUXCLICKY_TEMPO) * 100; // check this
|
||||
note_start = timer_read();
|
||||
FAUXCLICKY_ENABLE_OUTPUT;
|
||||
}
|
||||
|
||||
void fauxclicky_check() {
|
||||
if (!note_playing) return;
|
||||
|
||||
if (timer_elapsed(note_start) > note_period) {
|
||||
fauxclicky_stop();
|
||||
}
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
/*
|
||||
Copyright 2017 Priyadi Iman Nurcahyo
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
#error "AUDIO_ENABLE and FAUXCLICKY_ENABLE cannot be both enabled"
|
||||
#endif
|
||||
|
||||
#include "musical_notes.h"
|
||||
#include "stdbool.h"
|
||||
|
||||
__attribute__ ((weak))
|
||||
float fauxclicky_pressed_note[2];
|
||||
__attribute__ ((weak))
|
||||
float fauxclicky_released_note[2];
|
||||
__attribute__ ((weak))
|
||||
float fauxclicky_beep_note[2];
|
||||
|
||||
bool fauxclicky_enabled;
|
||||
|
||||
//
|
||||
// tempo in BPM
|
||||
//
|
||||
|
||||
#ifndef FAUXCLICKY_TEMPO
|
||||
#define FAUXCLICKY_TEMPO TEMPO_DEFAULT
|
||||
#endif
|
||||
|
||||
// beep on press
|
||||
#define FAUXCLICKY_ACTION_PRESS fauxclicky_play(fauxclicky_pressed_note)
|
||||
|
||||
// beep on release
|
||||
#define FAUXCLICKY_ACTION_RELEASE fauxclicky_play(fauxclicky_released_note)
|
||||
|
||||
// general purpose beep
|
||||
#define FAUXCLICKY_BEEP fauxclicky_play(fauxclicky_beep_note)
|
||||
|
||||
// enable
|
||||
#define FAUXCLICKY_ON fauxclicky_enabled = true
|
||||
|
||||
// disable
|
||||
#define FAUXCLICKY_OFF do { \
|
||||
fauxclicky_enabled = false; \
|
||||
fauxclicky_stop(); \
|
||||
} while (0)
|
||||
|
||||
// toggle
|
||||
#define FAUXCLICKY_TOGGLE do { \
|
||||
if (fauxclicky_enabled) { \
|
||||
FAUXCLICKY_OFF; \
|
||||
} else { \
|
||||
FAUXCLICKY_ON; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
//
|
||||
// pin configuration
|
||||
//
|
||||
|
||||
#ifndef FAUXCLICKY_CPU_PRESCALER
|
||||
#define FAUXCLICKY_CPU_PRESCALER 8
|
||||
#endif
|
||||
|
||||
#ifndef FAUXCLICKY_ENABLE_OUTPUT
|
||||
#define FAUXCLICKY_ENABLE_OUTPUT TCCR3A |= _BV(COM3A1);
|
||||
#endif
|
||||
|
||||
#ifndef FAUXCLICKY_DISABLE_OUTPUT
|
||||
#define FAUXCLICKY_DISABLE_OUTPUT TCCR3A &= ~(_BV(COM3A1) | _BV(COM3A0));
|
||||
#endif
|
||||
|
||||
#ifndef FAUXCLICKY_TIMER_PERIOD
|
||||
#define FAUXCLICKY_TIMER_PERIOD ICR3
|
||||
#endif
|
||||
|
||||
#ifndef FAUXCLICKY_DUTY_CYCLE
|
||||
#define FAUXCLICKY_DUTY_CYCLE OCR3A
|
||||
#endif
|
||||
|
||||
//
|
||||
// definitions
|
||||
//
|
||||
|
||||
void fauxclicky_init(void);
|
||||
void fauxclicky_stop(void);
|
||||
void fauxclicky_play(float note[2]);
|
||||
void fauxclicky_check(void);
|
||||
|
@ -0,0 +1,133 @@
|
||||
#include "process_ucis.h"
|
||||
|
||||
qk_ucis_state_t qk_ucis_state;
|
||||
|
||||
void qk_ucis_start(void) {
|
||||
qk_ucis_state.count = 0;
|
||||
qk_ucis_state.in_progress = true;
|
||||
|
||||
qk_ucis_start_user();
|
||||
}
|
||||
|
||||
__attribute__((weak))
|
||||
void qk_ucis_start_user(void) {
|
||||
unicode_input_start();
|
||||
register_hex(0x2328);
|
||||
unicode_input_finish();
|
||||
}
|
||||
|
||||
static bool is_uni_seq(char *seq) {
|
||||
uint8_t i;
|
||||
|
||||
for (i = 0; seq[i]; i++) {
|
||||
uint16_t code;
|
||||
if (('1' <= seq[i]) && (seq[i] <= '0'))
|
||||
code = seq[i] - '1' + KC_1;
|
||||
else
|
||||
code = seq[i] - 'a' + KC_A;
|
||||
|
||||
if (i > qk_ucis_state.count || qk_ucis_state.codes[i] != code)
|
||||
return false;
|
||||
}
|
||||
|
||||
return (qk_ucis_state.codes[i] == KC_ENT ||
|
||||
qk_ucis_state.codes[i] == KC_SPC);
|
||||
}
|
||||
|
||||
__attribute__((weak))
|
||||
void qk_ucis_symbol_fallback (void) {
|
||||
for (uint8_t i = 0; i < qk_ucis_state.count - 1; i++) {
|
||||
uint8_t code = qk_ucis_state.codes[i];
|
||||
register_code(code);
|
||||
unregister_code(code);
|
||||
wait_ms(UNICODE_TYPE_DELAY);
|
||||
}
|
||||
}
|
||||
|
||||
void register_ucis(const char *hex) {
|
||||
for(int i = 0; hex[i]; i++) {
|
||||
uint8_t kc = 0;
|
||||
char c = hex[i];
|
||||
|
||||
switch (c) {
|
||||
case '0':
|
||||
kc = KC_0;
|
||||
break;
|
||||
case '1' ... '9':
|
||||
kc = c - '1' + KC_1;
|
||||
break;
|
||||
case 'a' ... 'f':
|
||||
kc = c - 'a' + KC_A;
|
||||
break;
|
||||
case 'A' ... 'F':
|
||||
kc = c - 'A' + KC_A;
|
||||
break;
|
||||
}
|
||||
|
||||
if (kc) {
|
||||
register_code (kc);
|
||||
unregister_code (kc);
|
||||
wait_ms (UNICODE_TYPE_DELAY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool process_ucis (uint16_t keycode, keyrecord_t *record) {
|
||||
uint8_t i;
|
||||
|
||||
if (!qk_ucis_state.in_progress)
|
||||
return true;
|
||||
|
||||
if (qk_ucis_state.count >= UCIS_MAX_SYMBOL_LENGTH &&
|
||||
!(keycode == KC_BSPC || keycode == KC_ESC || keycode == KC_SPC || keycode == KC_ENT)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!record->event.pressed)
|
||||
return true;
|
||||
|
||||
qk_ucis_state.codes[qk_ucis_state.count] = keycode;
|
||||
qk_ucis_state.count++;
|
||||
|
||||
if (keycode == KC_BSPC) {
|
||||
if (qk_ucis_state.count >= 2) {
|
||||
qk_ucis_state.count -= 2;
|
||||
return true;
|
||||
} else {
|
||||
qk_ucis_state.count--;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (keycode == KC_ENT || keycode == KC_SPC || keycode == KC_ESC) {
|
||||
bool symbol_found = false;
|
||||
|
||||
for (i = qk_ucis_state.count; i > 0; i--) {
|
||||
register_code (KC_BSPC);
|
||||
unregister_code (KC_BSPC);
|
||||
wait_ms(UNICODE_TYPE_DELAY);
|
||||
}
|
||||
|
||||
if (keycode == KC_ESC) {
|
||||
qk_ucis_state.in_progress = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
unicode_input_start();
|
||||
for (i = 0; ucis_symbol_table[i].symbol; i++) {
|
||||
if (is_uni_seq (ucis_symbol_table[i].symbol)) {
|
||||
symbol_found = true;
|
||||
register_ucis(ucis_symbol_table[i].code + 2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!symbol_found) {
|
||||
qk_ucis_symbol_fallback();
|
||||
}
|
||||
unicode_input_finish();
|
||||
|
||||
qk_ucis_state.in_progress = false;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
#ifndef PROCESS_UCIS_H
|
||||
#define PROCESS_UCIS_H
|
||||
|
||||
#include "quantum.h"
|
||||
#include "process_unicode_common.h"
|
||||
|
||||
#ifndef UCIS_MAX_SYMBOL_LENGTH
|
||||
#define UCIS_MAX_SYMBOL_LENGTH 32
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
char *symbol;
|
||||
char *code;
|
||||
} qk_ucis_symbol_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t count;
|
||||
uint16_t codes[UCIS_MAX_SYMBOL_LENGTH];
|
||||
bool in_progress:1;
|
||||
} qk_ucis_state_t;
|
||||
|
||||
extern qk_ucis_state_t qk_ucis_state;
|
||||
|
||||
#define UCIS_TABLE(...) {__VA_ARGS__, {NULL, NULL}}
|
||||
#define UCIS_SYM(name, code) {name, #code}
|
||||
|
||||
extern const qk_ucis_symbol_t ucis_symbol_table[];
|
||||
|
||||
void qk_ucis_start(void);
|
||||
void qk_ucis_start_user(void);
|
||||
void qk_ucis_symbol_fallback (void);
|
||||
void register_ucis(const char *hex);
|
||||
bool process_ucis (uint16_t keycode, keyrecord_t *record);
|
||||
|
||||
#endif
|
@ -0,0 +1,85 @@
|
||||
#include "process_unicode_common.h"
|
||||
|
||||
uint8_t mods;
|
||||
|
||||
void set_unicode_input_mode(uint8_t os_target)
|
||||
{
|
||||
input_mode = os_target;
|
||||
}
|
||||
|
||||
uint8_t get_unicode_input_mode(void) {
|
||||
return input_mode;
|
||||
}
|
||||
|
||||
__attribute__((weak))
|
||||
void unicode_input_start (void) {
|
||||
// save current mods
|
||||
mods = keyboard_report->mods;
|
||||
|
||||
// unregister all mods to start from clean state
|
||||
if (mods & MOD_BIT(KC_LSFT)) unregister_code(KC_LSFT);
|
||||
if (mods & MOD_BIT(KC_RSFT)) unregister_code(KC_RSFT);
|
||||
if (mods & MOD_BIT(KC_LCTL)) unregister_code(KC_LCTL);
|
||||
if (mods & MOD_BIT(KC_RCTL)) unregister_code(KC_RCTL);
|
||||
if (mods & MOD_BIT(KC_LALT)) unregister_code(KC_LALT);
|
||||
if (mods & MOD_BIT(KC_RALT)) unregister_code(KC_RALT);
|
||||
if (mods & MOD_BIT(KC_LGUI)) unregister_code(KC_LGUI);
|
||||
if (mods & MOD_BIT(KC_RGUI)) unregister_code(KC_RGUI);
|
||||
|
||||
switch(input_mode) {
|
||||
case UC_OSX:
|
||||
register_code(KC_LALT);
|
||||
break;
|
||||
case UC_LNX:
|
||||
register_code(KC_LCTL);
|
||||
register_code(KC_LSFT);
|
||||
register_code(KC_U);
|
||||
unregister_code(KC_U);
|
||||
unregister_code(KC_LSFT);
|
||||
unregister_code(KC_LCTL);
|
||||
break;
|
||||
case UC_WIN:
|
||||
register_code(KC_LALT);
|
||||
register_code(KC_PPLS);
|
||||
unregister_code(KC_PPLS);
|
||||
break;
|
||||
case UC_WINC:
|
||||
register_code(KC_RALT);
|
||||
unregister_code(KC_RALT);
|
||||
register_code(KC_U);
|
||||
unregister_code(KC_U);
|
||||
}
|
||||
wait_ms(UNICODE_TYPE_DELAY);
|
||||
}
|
||||
|
||||
__attribute__((weak))
|
||||
void unicode_input_finish (void) {
|
||||
switch(input_mode) {
|
||||
case UC_OSX:
|
||||
case UC_WIN:
|
||||
unregister_code(KC_LALT);
|
||||
break;
|
||||
case UC_LNX:
|
||||
register_code(KC_SPC);
|
||||
unregister_code(KC_SPC);
|
||||
break;
|
||||
}
|
||||
|
||||
// reregister previously set mods
|
||||
if (mods & MOD_BIT(KC_LSFT)) register_code(KC_LSFT);
|
||||
if (mods & MOD_BIT(KC_RSFT)) register_code(KC_RSFT);
|
||||
if (mods & MOD_BIT(KC_LCTL)) register_code(KC_LCTL);
|
||||
if (mods & MOD_BIT(KC_RCTL)) register_code(KC_RCTL);
|
||||
if (mods & MOD_BIT(KC_LALT)) register_code(KC_LALT);
|
||||
if (mods & MOD_BIT(KC_RALT)) register_code(KC_RALT);
|
||||
if (mods & MOD_BIT(KC_LGUI)) register_code(KC_LGUI);
|
||||
if (mods & MOD_BIT(KC_RGUI)) register_code(KC_RGUI);
|
||||
}
|
||||
|
||||
void register_hex(uint16_t hex) {
|
||||
for(int i = 3; i >= 0; i--) {
|
||||
uint8_t digit = ((hex >> (i*4)) & 0xF);
|
||||
register_code(hex_to_keycode(digit));
|
||||
unregister_code(hex_to_keycode(digit));
|
||||
}
|
||||
}
|
@ -0,0 +1,132 @@
|
||||
#ifndef PROCESS_UNICODE_COMMON_H
|
||||
#define PROCESS_UNICODE_COMMON_H
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
#ifndef UNICODE_TYPE_DELAY
|
||||
#define UNICODE_TYPE_DELAY 10
|
||||
#endif
|
||||
|
||||
__attribute__ ((unused))
|
||||
static uint8_t input_mode;
|
||||
|
||||
void set_unicode_input_mode(uint8_t os_target);
|
||||
uint8_t get_unicode_input_mode(void);
|
||||
void unicode_input_start(void);
|
||||
void unicode_input_finish(void);
|
||||
void register_hex(uint16_t hex);
|
||||
|
||||
#define UC_OSX 0 // Mac OS X
|
||||
#define UC_LNX 1 // Linux
|
||||
#define UC_WIN 2 // Windows 'HexNumpad'
|
||||
#define UC_BSD 3 // BSD (not implemented)
|
||||
#define UC_WINC 4 // WinCompose https://github.com/samhocevar/wincompose
|
||||
|
||||
#define UC_BSPC UC(0x0008)
|
||||
|
||||
#define UC_SPC UC(0x0020)
|
||||
|
||||
#define UC_EXLM UC(0x0021)
|
||||
#define UC_DQUT UC(0x0022)
|
||||
#define UC_HASH UC(0x0023)
|
||||
#define UC_DLR UC(0x0024)
|
||||
#define UC_PERC UC(0x0025)
|
||||
#define UC_AMPR UC(0x0026)
|
||||
#define UC_QUOT UC(0x0027)
|
||||
#define UC_LPRN UC(0x0028)
|
||||
#define UC_RPRN UC(0x0029)
|
||||
#define UC_ASTR UC(0x002A)
|
||||
#define UC_PLUS UC(0x002B)
|
||||
#define UC_COMM UC(0x002C)
|
||||
#define UC_DASH UC(0x002D)
|
||||
#define UC_DOT UC(0x002E)
|
||||
#define UC_SLSH UC(0x002F)
|
||||
|
||||
#define UC_0 UC(0x0030)
|
||||
#define UC_1 UC(0x0031)
|
||||
#define UC_2 UC(0x0032)
|
||||
#define UC_3 UC(0x0033)
|
||||
#define UC_4 UC(0x0034)
|
||||
#define UC_5 UC(0x0035)
|
||||
#define UC_6 UC(0x0036)
|
||||
#define UC_7 UC(0x0037)
|
||||
#define UC_8 UC(0x0038)
|
||||
#define UC_9 UC(0x0039)
|
||||
|
||||
#define UC_COLN UC(0x003A)
|
||||
#define UC_SCLN UC(0x003B)
|
||||
#define UC_LT UC(0x003C)
|
||||
#define UC_EQL UC(0x003D)
|
||||
#define UC_GT UC(0x003E)
|
||||
#define UC_QUES UC(0x003F)
|
||||
#define UC_AT UC(0x0040)
|
||||
|
||||
#define UC_A UC(0x0041)
|
||||
#define UC_B UC(0x0042)
|
||||
#define UC_C UC(0x0043)
|
||||
#define UC_D UC(0x0044)
|
||||
#define UC_E UC(0x0045)
|
||||
#define UC_F UC(0x0046)
|
||||
#define UC_G UC(0x0047)
|
||||
#define UC_H UC(0x0048)
|
||||
#define UC_I UC(0x0049)
|
||||
#define UC_J UC(0x004A)
|
||||
#define UC_K UC(0x004B)
|
||||
#define UC_L UC(0x004C)
|
||||
#define UC_M UC(0x004D)
|
||||
#define UC_N UC(0x004E)
|
||||
#define UC_O UC(0x004F)
|
||||
#define UC_P UC(0x0050)
|
||||
#define UC_Q UC(0x0051)
|
||||
#define UC_R UC(0x0052)
|
||||
#define UC_S UC(0x0053)
|
||||
#define UC_T UC(0x0054)
|
||||
#define UC_U UC(0x0055)
|
||||
#define UC_V UC(0x0056)
|
||||
#define UC_W UC(0x0057)
|
||||
#define UC_X UC(0x0058)
|
||||
#define UC_Y UC(0x0059)
|
||||
#define UC_Z UC(0x005A)
|
||||
|
||||
#define UC_LBRC UC(0x005B)
|
||||
#define UC_BSLS UC(0x005C)
|
||||
#define UC_RBRC UC(0x005D)
|
||||
#define UC_CIRM UC(0x005E)
|
||||
#define UC_UNDR UC(0x005F)
|
||||
|
||||
#define UC_GRV UC(0x0060)
|
||||
|
||||
#define UC_a UC(0x0061)
|
||||
#define UC_b UC(0x0062)
|
||||
#define UC_c UC(0x0063)
|
||||
#define UC_d UC(0x0064)
|
||||
#define UC_e UC(0x0065)
|
||||
#define UC_f UC(0x0066)
|
||||
#define UC_g UC(0x0067)
|
||||
#define UC_h UC(0x0068)
|
||||
#define UC_i UC(0x0069)
|
||||
#define UC_j UC(0x006A)
|
||||
#define UC_k UC(0x006B)
|
||||
#define UC_l UC(0x006C)
|
||||
#define UC_m UC(0x006D)
|
||||
#define UC_n UC(0x006E)
|
||||
#define UC_o UC(0x006F)
|
||||
#define UC_p UC(0x0070)
|
||||
#define UC_q UC(0x0071)
|
||||
#define UC_r UC(0x0072)
|
||||
#define UC_s UC(0x0073)
|
||||
#define UC_t UC(0x0074)
|
||||
#define UC_u UC(0x0075)
|
||||
#define UC_v UC(0x0076)
|
||||
#define UC_w UC(0x0077)
|
||||
#define UC_x UC(0x0078)
|
||||
#define UC_y UC(0x0079)
|
||||
#define UC_z UC(0x007A)
|
||||
|
||||
#define UC_LCBR UC(0x007B)
|
||||
#define UC_PIPE UC(0x007C)
|
||||
#define UC_RCBR UC(0x007D)
|
||||
#define UC_TILD UC(0x007E)
|
||||
#define UC_DEL UC(0x007F)
|
||||
|
||||
#endif
|
@ -0,0 +1,56 @@
|
||||
#include "process_unicodemap.h"
|
||||
#include "process_unicode_common.h"
|
||||
|
||||
__attribute__((weak))
|
||||
const uint32_t PROGMEM unicode_map[] = {
|
||||
};
|
||||
|
||||
void register_hex32(uint32_t hex) {
|
||||
bool onzerostart = true;
|
||||
for(int i = 7; i >= 0; i--) {
|
||||
if (i <= 3) {
|
||||
onzerostart = false;
|
||||
}
|
||||
uint8_t digit = ((hex >> (i*4)) & 0xF);
|
||||
if (digit == 0) {
|
||||
if (!onzerostart) {
|
||||
register_code(hex_to_keycode(digit));
|
||||
unregister_code(hex_to_keycode(digit));
|
||||
}
|
||||
} else {
|
||||
register_code(hex_to_keycode(digit));
|
||||
unregister_code(hex_to_keycode(digit));
|
||||
onzerostart = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
__attribute__((weak))
|
||||
void unicode_map_input_error() {}
|
||||
|
||||
bool process_unicode_map(uint16_t keycode, keyrecord_t *record) {
|
||||
uint8_t input_mode = get_unicode_input_mode();
|
||||
if ((keycode & QK_UNICODE_MAP) == QK_UNICODE_MAP && record->event.pressed) {
|
||||
const uint32_t* map = unicode_map;
|
||||
uint16_t index = keycode - QK_UNICODE_MAP;
|
||||
uint32_t code = pgm_read_dword_far(&map[index]);
|
||||
if (code > 0xFFFF && code <= 0x10ffff && input_mode == UC_OSX) {
|
||||
// Convert to UTF-16 surrogate pair
|
||||
code -= 0x10000;
|
||||
uint32_t lo = code & 0x3ff;
|
||||
uint32_t hi = (code & 0xffc00) >> 10;
|
||||
unicode_input_start();
|
||||
register_hex32(hi + 0xd800);
|
||||
register_hex32(lo + 0xdc00);
|
||||
unicode_input_finish();
|
||||
} else if ((code > 0x10ffff && input_mode == UC_OSX) || (code > 0xFFFFF && input_mode == UC_LNX)) {
|
||||
// when character is out of range supported by the OS
|
||||
unicode_map_input_error();
|
||||
} else {
|
||||
unicode_input_start();
|
||||
register_hex32(code);
|
||||
unicode_input_finish();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
#ifndef PROCESS_UNICODEMAP_H
|
||||
#define PROCESS_UNICODEMAP_H
|
||||
|
||||
#include "quantum.h"
|
||||
#include "process_unicode_common.h"
|
||||
|
||||
void unicode_map_input_error(void);
|
||||
bool process_unicode_map(uint16_t keycode, keyrecord_t *record);
|
||||
#endif
|