1
0
Fork 0

Merge pull request #1 from jackhumbert/master

Merging from base Repo
This commit is contained in:
Felix Uhl 2016-08-18 12:02:31 +02:00 committed by GitHub
commit ed6ecff292
115 changed files with 6985 additions and 1535 deletions

View file

@ -198,6 +198,11 @@ ifeq ($(strip $(AUDIO_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/audio/luts.c SRC += $(QUANTUM_DIR)/audio/luts.c
endif endif
ifeq ($(strip $(UCIS_ENABLE)), yes)
OPT_DEFS += -DUCIS_ENABLE
UNICODE_ENABLE = yes
endif
ifeq ($(strip $(UNICODE_ENABLE)), yes) ifeq ($(strip $(UNICODE_ENABLE)), yes)
OPT_DEFS += -DUNICODE_ENABLE OPT_DEFS += -DUNICODE_ENABLE
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c

View file

@ -113,7 +113,7 @@ Third party libraries like LUFA, PJRC and V-USB have their own license respectiv
Build Firmware and Program Controller Build Firmware and Program Controller
------------------------------------- -------------------------------------
See [doc/build.md](tmk_core/doc/build.md), or the readme in the particular keyboards/* folder. See [build environment setup](/readme.md#build-environment-setup), or the readme in the particular keyboards/* folder.

View file

@ -2,7 +2,7 @@ Keycode Symbol Table
==================== ====================
Keycodes are defined in `common/keycode.h`. Keycodes are defined in `common/keycode.h`.
Range of 00-A4 and E0-E7 are identical with HID Usage: Range of 00-A4 and E0-E7 are identical with HID Usage:
<http://www.usb.org/developers/devclass_docs/Hut1_11.pdf> <http://www.usb.org/developers/hidpage/Hut1_12v2.pdf>
Virtual keycodes are defined out of above range to support special actions. Virtual keycodes are defined out of above range to support special actions.

View file

@ -2,11 +2,11 @@
ifdef TEENSY2 ifdef TEENSY2
OPT_DEFS += -DATREUS_TEENSY2 OPT_DEFS += -DATREUS_TEENSY2
ATRUES_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex ATREUS_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex
else else
OPT_DEFS += -DATREUS_ASTAR OPT_DEFS += -DATREUS_ASTAR
OPT_DEFS += -DCATERINA_BOOTLOADER OPT_DEFS += -DCATERINA_BOOTLOADER
ATRUES_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \ ATREUS_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \
avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB) avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB)
endif endif
@ -84,5 +84,5 @@ endif
USB ?= /dev/cu.usbmodem1411 USB ?= /dev/cu.usbmodem1411
upload: build upload: build
$(ATRUES_UPLOAD_COMMAND) $(ATREUS_UPLOAD_COMMAND)

View file

@ -0,0 +1,89 @@
// This is the personal keymap of Ian Sterling (@xyverz). It is based on the keymap by
// Chris Gerber (@gerbercj), with the addition of persistent layers like the Planck and
// Preonic keyboards by Jack Humbert.
#include "atreus.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 _DV 0
#define _QW 1
#define _CM 2
#define _L1 3
#define _L2 4
// Macro name shortcuts
#define DVORAK M(_DV)
#define QWERTY M(_QW)
#define COLEMAK M(_CM)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_DV] = { /* Dvorak */
{KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_NO, KC_F, KC_G, KC_C, KC_R, KC_L },
{KC_A, KC_O, KC_E, KC_U, KC_I, KC_NO, KC_D, KC_H, KC_T, KC_N, KC_S },
{SFT_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, CTL_T(KC_DEL), KC_B, KC_M, KC_W, KC_V, SFT_T(KC_Z) },
{KC_ESC, KC_TAB, KC_LGUI, MO(_L2), KC_BSPC, ALT_T(KC_ENT), KC_SPC, MO(_L1), KC_MINS, KC_SLSH, KC_EQL}
},
[_QW] = { /* Qwerty */
{KC_Q, KC_W, KC_E, KC_R, KC_T, KC_NO, KC_Y, KC_U, KC_I, KC_O, KC_P },
{KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN},
{SFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, CTL_T(KC_DEL), KC_N, KC_M, KC_COMM, KC_DOT, SFT_T(KC_SLSH) },
{KC_ESC, KC_TAB, KC_LGUI, MO(_L2), KC_BSPC, ALT_T(KC_ENT), KC_SPC, MO(_L1), KC_MINS, KC_QUOT, KC_ENT}
},
[_CM] = { /* Colemak */
{KC_Q, KC_W, KC_F, KC_P, KC_G, KC_NO, KC_J, KC_L, KC_U, KC_Y, KC_SCLN},
{KC_A, KC_R, KC_S, KC_T, KC_D, KC_NO, KC_H, KC_N, KC_E, KC_I, KC_O },
{SFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, CTL_T(KC_DEL), KC_K, KC_M, KC_COMM, KC_DOT, SFT_T(KC_SLSH) },
{KC_ESC, KC_TAB, KC_LGUI, MO(_L2), KC_BSPC, ALT_T(KC_ENT), KC_SPC, MO(_L1), KC_MINS, KC_QUOT, KC_ENT}
},
[_L1] = { /* LAYER 1 */
{KC_1, KC_2, KC_3, KC_4, KC_5, KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0 },
{KC_TAB, KC_INS, KC_UP, KC_DEL, KC_HOME, KC_NO, KC_PGUP, KC_MUTE, KC_VOLD, KC_VOLU, KC_EQL },
{KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_LCTL, KC_PGDN, KC_MPRV, KC_MPLY, KC_MNXT, KC_BSLS},
{KC_TRNS, KC_GRV, KC_LGUI, KC_TRNS, KC_DEL, KC_LALT, KC_SPC, KC_TRNS, KC_LBRC, KC_RBRC, KC_ENT }
},
[_L2] = { /* LAYER 2 */
{KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_NO, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN},
{KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_NO, KC_TRNS, KC_F6, KC_F7, KC_F8, KC_PLUS},
{KC_TRNS, KC_TRNS, DVORAK, QWERTY, COLEMAK, KC_LCTL, KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12 },
{KC_TRNS, KC_TRNS, KC_LGUI, KC_TRNS, KC_BSPC, KC_LALT, KC_SPC, KC_TRNS, LSFT(KC_LBRC), LSFT(KC_RBRC), RESET}
}
};
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 _DV:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_DV);
}
break;
case _QW:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_QW);
}
break;
case _CM:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_CM);
}
break;
}
return MACRO_NONE;
};

View file

@ -90,7 +90,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options # Build Options
# comment out to disable the options. # change to no to disable the options.
# #
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) MOUSEKEY_ENABLE ?= no # Mouse keys(+4700)

View file

@ -29,9 +29,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* COL2ROW or ROW2COL */ /* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW #define DIODE_DIRECTION COL2ROW
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
/* Set 0 if debouncing isn't needed */ /* Set 0 if debouncing isn't needed */
#define DEBOUNCING_DELAY 5 #define DEBOUNCING_DELAY 5

View file

@ -66,19 +66,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `----------------------------------------------------------------------------------' * `----------------------------------------------------------------------------------'
*/ */
[_RS] = KEYMAP( [_RS] = KEYMAP(
#ifdef RGBLIGHT_ENABLE
KC_TRNS, KC_TRNS, 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,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, 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, \ 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, \ 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), 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),
#else
KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
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, 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, \
KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, 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_TRNS, KC_TRNS, KC_TRNS),
#endif
}; };
enum function_id { enum function_id {

View file

@ -0,0 +1,5 @@
# skullY's Clueboard Layout
This layout is what I (@skullydazed) use on my personal Clueboards. I mostly use it for programming, CAD, and general typing.
The most notable change from the default layout is putting Ctrl on the Capslock key. I also swap Alt and Cmd because I mostly use a Mac day to day.

View file

@ -1,4 +1,97 @@
Clueboard keyboard firmware Clueboard keyboard firmware
====================== ======================
TODO: to be updated. DIY/Assembled compact 66% keyboard by [Clueboard](http://clueboard.co).
For the full Quantum Mechanical Keyboard feature list, see [the parent readme.md](/readme.md).
## First Time Setup
Download or clone the whole firmware and navigate to the keyboards/clueboard directory. Once your dev env is setup, you'll be able to generate the default .hex:
```
$ make
```
You will see a lot of output and if everything worked correctly you will see something similar to this:
```
Size after:
text data bss dec hex filename
0 19992 0 19992 4e18 clueboard_rev2_default.hex
```
At this point you can press RESET on your Clueboard and flash your keyboard with this command:
```
$ make dfu
```
If you would like to use one of the alternative keymaps, or create your own, see below.
## Clueboard 1.0
If you have a first generation Clueboard (one with a black PCB) you will need to use the revision 1 code. To do so add `SUBPROJECT=rev1` to your make command, like this:
```
$ make SUBPROJECT=rev1
```
And when flashing your keyboard:
```
$ make SUBPROJECT=rev1 dfu
```
If you are flashing an alternative layout to your rev1, include both `SUBPROJECT=rev1` and `KEYMAP=<keymap>` in your command, for example when flashing max:
```
$ make SUBPROJECT=rev1 KEYMAP=max dfu
```
## Alternate Keymaps
There are many alternative and user-contributed layouts available in the [keymaps/](keymaps/) directory. To compile and flash an alternative you will want to add `KEYMAP=<keymap>` to your command:
```
$ make KEYMAP=skully
```
And when flashing your keyboard, put `KEYMAP=<keymap>` between "make" and "dfu":
```
$ make KEYMAP=skully dfu
```
### Notable Layouts
These layouts are notable for one reason or another. If you are looking for ideas or inspiration you should look at these first:
* [keymaps/default](keymaps/default) - The default Clueboard layout
* [keymaps/max](keymaps/max) - A maximised layout that makes use of every key and feature of the Clueboard 2.0 PCB.
* [keymaps/skully](keymaps/skully) - The layout that @skullydazed uses on his own Clueboards.
## Create Your Own Keymap
There are a lot of possibilities when creating your own keymap, and the primary documentation for doing that is [Customizing Your Keymap](/readme.md##customizing-your-keymap) in the main readme.md. As a way to get started, here is the procedure I recommend:
* Copy `[keymaps/default](keymaps/default/)` to `keymaps/<your_layout>`.
* Compile the firmware (`$ make KEYMAP=<your_layout>`)
* Flash the firmware (`$ make KEYMAP=<your_layout> dfu`)
* Make sure everything works like the default keyboard
* Modify `keymaps/<your_layout>/readme.md` to tell others about your layout.
* Modify `keymaps/<your_layout>/keymap.c` to reflect your desired layout.
* Compile your new custom firmware (`$ make KEYMAP=<your_layout>`)
** If you have warnings you may flash without fixing them, but something may not work right.
** If you have any errors you must fix them before continuing.
* Flash the firmware (`$ make KEYMAP=<your_layout> dfu`)
## Share Your Keymap
Got your layout dialed in? Please share it with the world so we can benefit from your work! Simply submit a pull request with your layout and we'll include it in the official repository. Please use the following guidelines when putting together your pull request:
* Include a readme.md that states what your primary keyboard use is, how your layout differs from the default, and highlights anything you think makes your layout particularly great.
* If your layout requires certain features (EG, RGB underlight or backlighting) ensure you have a Makefile and config.h that reflects that
* If your layout requires special hardware to be added, please describe that in the readme.md
TODO: Write up or link quick how-to on creating and submitting a PR. (Pull requests accepted. :)

View file

@ -1,63 +0,0 @@
#include "clueboard2.h"
void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
matrix_init_user();
led_init_ports();
// JTAG disable for PORT F. write JTD bit twice within four cycles.
MCUCR |= (1<<JTD);
MCUCR |= (1<<JTD);
};
void led_init_ports() {
// * Set our LED pins as output
DDRB |= (1<<4);
}
void led_set_kb(uint8_t usb_led) {
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
// Turn capslock on
PORTB |= (1<<4);
} else {
// Turn capslock off
PORTB &= ~(1<<4);
}
}
/* Clueboard 2.0 LED locations:
*
* Capslock: B4, pull high to turn on
* LCtrl: Shared with Capslock, DO NOT INSTALL LED'S IN BOTH
* Page Up: B7, pull high to turn on
* Escape: D6, pull high to turn on
* Arrows: D4, pull high to turn on
*/
void backlight_init_ports(void) {
print("init_backlight_pin()\n");
// Set our LED pins as output
DDRD |= (1<<6); // Esc
DDRB |= (1<<7); // Page Up
DDRD |= (1<<4); // Arrows
// Set our LED pins low
PORTD &= ~(1<<6); // Esc
PORTB &= ~(1<<7); // Page Up
PORTD &= ~(1<<4); // Arrows
}
void backlight_set(uint8_t level) {
if ( level == 0 ) {
// Turn off light
PORTD |= (1<<6); // Esc
PORTB |= (1<<7); // Page Up
PORTD |= (1<<4); // Arrows
} else {
// Turn on light
PORTD &= ~(1<<6); // Esc
PORTB &= ~(1<<7); // Page Up
PORTD &= ~(1<<4); // Arrows
}
}

View file

@ -0,0 +1,76 @@
# 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 ?= 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
RGBLIGHT_ENABLE ?= yes # Enable keyboard underlight functionality (+4870)
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality by default
MIDI_ENABLE ?= no # MIDI controls
UNICODE_ENABLE ?= no # Unicode
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE ?= yes # Audio output on port C6
ifndef QUANTUM_DIR
include ../../Makefile
endif

View file

@ -0,0 +1,98 @@
#include "cluecard.h"
#define BL_RED OCR1B
#define BL_GREEN OCR1A
#define BL_BLUE OCR1C
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);
}
void backlight_init_ports(void)
{
// Set B5, B6, and B7 as output
DDRB |= (1<<7)|(1<<6)|(1<<5);
// Setup PWM
ICR1 = 0xFFFF;
TCCR1A = 0b10101010;
TCCR1B = 0b00011001;
BL_RED = 0xFFFF;
BL_GREEN = 0xFFFF;
BL_BLUE = 0xFFFF;
}
void backlight_set(uint8_t level)
{
// Set the RGB color
switch (level)
{
case 0:
// Off
BL_RED = 0xFFFF;
BL_GREEN = 0xFFFF;
BL_BLUE = 0xFFFF;
break;
case 1:
// Red
BL_RED = 0x0000;
BL_GREEN = 0xFFFF;
BL_BLUE = 0xFFFF;
break;
case 2:
// Green
BL_RED = 0xFFFF;
BL_GREEN = 0x0000;
BL_BLUE = 0xFFFF;
break;
case 3:
// Blue
BL_RED = 0xFFFF;
BL_GREEN = 0xFFFF;
BL_BLUE = 0x0000;
break;
case 4:
// Magenta
BL_RED = 0x4000;
BL_GREEN = 0x4000;
BL_BLUE = 0x4000;
break;
case 5:
// Purple
BL_RED = 0x0000;
BL_GREEN = 0xFFFF;
BL_BLUE = 0x0000;
break;
case 6:
// Yellow
BL_RED = 0x0000;
BL_GREEN = 0x0000;
BL_BLUE = 0xFFFF;
break;
default:
xprintf("Unknown level: %d\n", level);
}
}

View file

@ -0,0 +1,22 @@
#ifndef CLUECARD_H
#define CLUECARD_H
#include "quantum.h"
// This a shortcut to help you visually see your layout.
// The first section contains all of the arguements
// The second converts the arguments into a two-dimensional array
#define KEYMAP( \
k00, k01, k02, \
k10, k12, \
k20, k21, k22, \
k11, \
k30, k31, k32 \
) { \
{ k00, k01, k02, }, \
{ k10, k11, k12, }, \
{ k20, k21, k22, }, \
{ k30, k31, k32, } \
}
#endif

167
keyboards/cluecard/config.h Normal file
View file

@ -0,0 +1,167 @@
/*
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 0xC1ED
#define PRODUCT_ID 0x2330
#define DEVICE_VER 0x0001
#define MANUFACTURER Clueboard
#define PRODUCT ATMEGA32U4 Firmware Dev Kit
#define DESCRIPTION A small board to help you hack on QMK.
/* key matrix size */
#define MATRIX_ROWS 4
#define MATRIX_COLS 3
/*
* 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, F4, B4 }
#define MATRIX_COL_PINS { F1, F7, F6 }
#define UNUSED_PINS
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION ROW2COL
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCING_DELAY 20
/* define if matrix has ghost (lacks anti-ghosting diodes) */
//#define MATRIX_HAS_GHOST
/* number of backlight levels */
#define BACKLIGHT_LEVELS 6
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
//#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
//#define LOCKING_RESYNC_ENABLE
/*
* 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
/* Underlight configuration
*/
#define RGB_DI_PIN E6
//#define RGBLIGHT_TIMER
#define RGBLED_NUM 4 // Number of LEDs
#define RGBLIGHT_HUE_STEP 10
#define RGBLIGHT_SAT_STEP 17
#define RGBLIGHT_VAL_STEP 17
/*
* Feature disable options
* These options are also useful to firmware size reduction.
*/
/* disable debug print */
//#define NO_DEBUG
/* disable print */
//#define NO_PRINT
/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
//#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION
#endif

View file

@ -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 = no # Mouse keys(+4700)
EXTRAKEY_ENABLE = no # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = yes # Audio output on port C6
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

View file

@ -0,0 +1,8 @@
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include "../../config.h"
// place overrides here
#endif

View file

@ -0,0 +1,63 @@
#include "cluecard.h"
#ifdef AUDIO_ENABLE
#include "audio.h"
#endif
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = KEYMAP(
RGB_TOG, RGB_SAI, RGB_VAI, \
RGB_HUD, RGB_HUI, \
RGB_MOD, RGB_SAD, RGB_VAD, \
BL_STEP, \
F(0), F(1), F(2) \
)
};
#ifdef AUDIO_ENABLE
float tone_startup[][2] = SONG(STARTUP_SOUND);
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
float tone_dvorak[][2] = SONG(DVORAK_SOUND);
float tone_colemak[][2] = SONG(COLEMAK_SOUND);
float tone_plover[][2] = SONG(PLOVER_SOUND);
float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND);
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
#endif
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_FUNCTION(0),
[1] = ACTION_FUNCTION(1),
[2] = ACTION_FUNCTION(2)
};
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
if (record->event.pressed) {
switch (id) {
case 0:
PLAY_NOTE_ARRAY(tone_startup, false, 0);
break;
case 1:
PLAY_NOTE_ARRAY(music_scale, false, 0);
break;
case 2:
PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
break;
}
}
};
void matrix_init_user(void) {
}
void matrix_scan_user(void) {
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
void led_set_user(uint8_t usb_led) {
}

View file

@ -0,0 +1 @@
# The default keymap for cluecard

View file

@ -0,0 +1,28 @@
cluecard keyboard firmware
======================
## Quantum MK Firmware
For the full Quantum feature list, see [the parent readme.md](/doc/readme.md).
## Building
Download or clone the whole firmware and navigate to the keyboards/cluecard folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file.
Depending on which keymap you would like to use, you will have to compile slightly differently.
### Default
To build with the default keymap, simply run `make`.
### Other Keymaps
Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files.
To build the firmware binary hex file with a keymap just do `make` with `keymap` option like:
```
$ make keymap=[default|jack|<name>]
```
Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/`

View file

@ -8,10 +8,17 @@ CONSOLE_ENABLE = no
TAP_DANCE_ENABLE = yes TAP_DANCE_ENABLE = yes
KEYLOGGER_ENABLE ?= yes KEYLOGGER_ENABLE ?= yes
ADORE_AUTOLOG ?= no
ifeq (${FORCE_NKRO},yes) ifeq (${FORCE_NKRO},yes)
OPT_DEFS += -DFORCE_NKRO OPT_DEFS += -DFORCE_NKRO
endif endif
ifeq (${ADORE_AUTOLOG},yes)
KEYLOGGER_ENABLE = yes
OPT_DEFS += -DADORE_AUTOLOG
endif
ifeq (${KEYLOGGER_ENABLE},yes) ifeq (${KEYLOGGER_ENABLE},yes)
OPT_DEFS += -DKEYLOGGER_ENABLE OPT_DEFS += -DKEYLOGGER_ENABLE
CONSOLE_ENABLE = yes CONSOLE_ENABLE = yes

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

View file

@ -23,8 +23,6 @@ enum {
APPSEL, APPSEL,
HUN, HUN,
NMDIA, NMDIA,
OHLFT,
OHRGT,
PLVR, PLVR,
}; };
@ -74,13 +72,6 @@ enum {
HU_UE, // Ü HU_UE, // Ü
HU_OEE, // Ő HU_OEE, // Ő
HU_UEE, // Ű HU_UEE, // Ű
// One-handed layout specials
OH_BSSPC,
OH_ENTSFT,
OH_BASE,
OH_LEFT,
OH_RIGHT,
}; };
/* Fn keys */ /* Fn keys */
@ -100,6 +91,8 @@ enum {
CT_CLN = 0, CT_CLN = 0,
CT_MNS, CT_MNS,
CT_TA, CT_TA,
CT_LBP,
CT_RBP
}; };
/* States & timers */ /* States & timers */
@ -108,17 +101,6 @@ uint16_t gui_timer = 0;
uint16_t kf_timers[12]; uint16_t kf_timers[12];
uint16_t oh_base_timer = 0;
uint16_t oh_bsspc_timer = 0;
uint16_t oh_entsft_timer = 0;
#define OH_BLINK_INTERVAL 500
uint8_t oh_left_blink = 0;
uint16_t oh_left_blink_timer = 0;
uint8_t oh_right_blink = 0;
uint16_t oh_right_blink_timer = 0;
#if KEYLOGGER_ENABLE #if KEYLOGGER_ENABLE
bool log_enable = false; bool log_enable = false;
#endif #endif
@ -132,9 +114,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap 0: Base Layer /* Keymap 0: Base Layer
* *
* ,-----------------------------------------------------. ,-----------------------------------------------------. * ,-----------------------------------------------------. ,-----------------------------------------------------.
* | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | Apps | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 | * | Next/Prev | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | Apps | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 |
* |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------|
* | Next/Prev | ' | , | . | P | Y | [ | | ] | F | G | C | R | L | \ | * | ~ | ' | , | . | P | Y | [ | | ] | F | G | C | R | L | \ |
* |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------|
* | Tab/ARROW | A | O | E | U | I |------| |------| D | H | T | N | S | = / Arrow | * | Tab/ARROW | A | O | E | U | I |------| |------| D | H | T | N | S | = / Arrow |
* |-----------+------+------+------+------+------| ( | | ) |------+------+------+------+------+-----------| * |-----------+------+------+------+------+------| ( | | ) |------+------+------+------+------+-----------|
@ -143,7 +125,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | : | | - | | | | | * | | | | | : | | - | | | | |
* `-----------------------------------' `-----------------------------------' * `-----------------------------------' `-----------------------------------'
* ,-------------. ,-------------. * ,-------------. ,-------------.
* | LAlt | GUI | | MDIA | 1HND | * | LAlt | GUI | | MDIA | Del |
* ,------|------|------| |------+------+------. * ,------|------|------| |------+------+------.
* | | | Ctrl | | LEAD | | | * | | | Ctrl | | LEAD | | |
* |Backsp|LShift|------| |------| Enter| Space| * |Backsp|LShift|------| |------| Enter| Space|
@ -152,8 +134,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/ */
[BASE] = KEYMAP( [BASE] = KEYMAP(
// left hand // left hand
KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR) M(A_MPN) ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR)
,M(A_MPN) ,KC_QUOT ,KC_COMM ,KC_DOT ,KC_P ,KC_Y ,KC_LBRC ,KC_GRV ,KC_QUOT ,KC_COMM ,KC_DOT ,KC_P ,KC_Y ,KC_LBRC
,TD(CT_TA) ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I ,TD(CT_TA) ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I
,KC_MPLY ,KC_SLSH ,KC_Q ,KC_J ,KC_K ,KC_X ,KC_LPRN ,KC_MPLY ,KC_SLSH ,KC_Q ,KC_J ,KC_K ,KC_X ,KC_LPRN
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,TD(CT_CLN) ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,TD(CT_CLN)
@ -169,7 +151,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
,KC_RPRN ,KC_B ,KC_M ,KC_W ,KC_V ,KC_Z ,KC_MSTP ,KC_RPRN ,KC_B ,KC_M ,KC_W ,KC_V ,KC_Z ,KC_MSTP
,TD(CT_MNS),KC_NO ,KC_NO ,KC_NO ,KC_NO ,TD(CT_MNS),KC_NO ,KC_NO ,KC_NO ,KC_NO
,OSL(NMDIA),M(OH_LEFT) ,OSL(NMDIA),KC_DEL
,KC_LEAD ,KC_LEAD
,F(F_HUN) ,KC_ENT ,KC_SPC ,F(F_HUN) ,KC_ENT ,KC_SPC
), ),
@ -177,46 +159,46 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap 1: Adore layer /* Keymap 1: Adore layer
* *
* ,-----------------------------------------------------. ,-----------------------------------------------------. * ,-----------------------------------------------------. ,-----------------------------------------------------.
* | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | Apps | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 | * | Play/Pause| 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | Apps | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 |
* |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------|
* | Next/Prev | , | . | L | W | M | [ | | ] | F | H | C | P | Y | \ | * | `~ | X | W | K | L | M | ( | | ) | F | H | C | P | Y | \ |
* |-----------+------+------+------+------+------| [ | | ] |------+------+------+------+------+-----------|
* | Tab/Arrow | A | O | E | I | U |------| |------| D | R | T | N | S | = |
* |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------|
* | Tab/Arrow | A | O | E | I | U |------| |------| D | R | T | N | S | = / Arrow | * | | Z | Q | ' | , | . | : | | - | B | G | V | J | / | |
* |-----------+------+------+------+------+------| ( | | ) |------+------+------+------+------+-----------|
* | Play/Pause| / | Z | ' | K | X | | | | B | G | V | J | Q | Stop |
* `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------'
* | | | | | : | | - | | | | | * | | | | | | | | | | | |
* `-----------------------------------' `-----------------------------------' * `-----------------------------------' `-----------------------------------'
* ,-------------. ,-------------. * ,-------------. ,-------------.
* | LAlt | GUI | | MDIA | 1HND | * | LAlt | GUI | | MDIA | Del |
* ,------|------|------| |------+------+------. * ,------|------|------| |------+------+------.
* | | | Ctrl | | LEAD | | | * | | | Ctrl | | HUN | | |
* |Backsp|LShift|------| |------| Enter| Space| * |Backsp|LShift|------| |------| Enter| Space|
* | | | ESC | | HUN | | | * | | | ESC | | LEAD | | |
* `--------------------' `--------------------' * `--------------------' `--------------------'
*/ */
[ADORE] = KEYMAP( [ADORE] = KEYMAP(
// left hand // left hand
KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR) KC_MPLY ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR)
,M(A_MPN) ,KC_COMM ,KC_DOT ,KC_L ,KC_W ,KC_M ,KC_LBRC ,KC_GRV ,KC_X ,KC_W ,KC_K ,KC_L ,KC_M ,TD(CT_LBP)
,TD(CT_TA) ,KC_A ,KC_O ,KC_E ,KC_I ,KC_U ,TD(CT_TA) ,KC_A ,KC_O ,KC_E ,KC_I ,KC_U
,KC_MPLY ,KC_SLSH ,KC_Z ,KC_QUOT,KC_K ,KC_X ,KC_LPRN ,KC_NO ,KC_Z ,KC_Q ,KC_QUOT,KC_COMM,KC_DOT ,TD(CT_CLN)
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,TD(CT_CLN) ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
,F(F_ALT),F(F_GUI) ,F(F_ALT),F(F_GUI)
,F(F_CTRL) ,F(F_CTRL)
,KC_BSPC,F(F_SFT),M(A_ESC) ,KC_BSPC,F(F_SFT),M(A_ESC)
// right hand // right hand
,KC_APP ,M(KF_6),M(KF_7) ,M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11 ,KC_APP ,M(KF_6),M(KF_7),M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11
,KC_RBRC ,KC_F ,KC_H ,KC_C ,KC_P ,KC_Y ,KC_BSLS ,TD(CT_RBP),KC_F ,KC_H ,KC_C ,KC_P ,KC_Y ,KC_BSLS
,KC_D ,KC_R ,KC_T ,KC_N ,KC_S ,KC_EQL ,KC_D ,KC_R ,KC_T ,KC_N ,KC_S ,KC_EQL
,KC_RPRN ,KC_B ,KC_G ,KC_V ,KC_J ,KC_Q ,KC_MSTP ,TD(CT_MNS),KC_B ,KC_G ,KC_V ,KC_J ,KC_SLSH ,KC_NO
,TD(CT_MNS),KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
,OSL(NMDIA),M(OH_LEFT) ,OSL(NMDIA),KC_DEL
,KC_LEAD ,F(F_HUN)
,F(F_HUN) ,KC_ENT ,KC_SPC ,KC_LEAD ,KC_ENT ,KC_SPC
), ),
/* Keymap 2: Arrow layer /* Keymap 2: Arrow layer
@ -236,7 +218,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | * | | | | | |
* ,------|------|------| |------+------+------. * ,------|------|------| |------+------+------.
* | | | | | | | | * | | | | | | | |
* | | |------| |------| PgUp | PgDn | * | Enter| |------| |------| PgUp | PgDn |
* | | | | | | | | * | | | | | | | |
* `--------------------' `--------------------' * `--------------------' `--------------------'
*/ */
@ -251,7 +233,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS
,KC_TRNS ,KC_TRNS
,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_ENT ,KC_TRNS ,KC_TRNS
// right hand // 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
@ -402,97 +384,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
,KC_MNXT ,KC_BTN1 ,KC_BTN2 ,KC_MNXT ,KC_BTN1 ,KC_BTN2
), ),
/* Keymap 6: One-handed, left side /* Keymap 6: Steno for Plover
*
* ,-----------------------------------------------------.
* | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 |A BSE|
* |-----------+------+------+------+------+-------------|
* | Tab | ' | , | . | P | Y | [ |
* |-----------+------+------+------+------+------| |
* | - | A | O | E | U | I |------|
* |-----------+------+------+------+------+------| ( |
* | Play/Pause| ; | Q | J | K | X | |
* `-----------+------+------+------+------+-------------'
* | Home | End | Down | Up | ESC |
* `-----------------------------------'
* ,-------------.
* | LAlt | GUI |
* ,------|------|------|
* |BackSp|LShift| Ctrl |
* | | |------|
* |Space |Enter |OTHER |
* `--------------------'
*/
[OHLFT] = KEYMAP(
// left hand
KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3) ,M(KF_4) ,M(KF_5) ,M(OH_BASE)
,KC_TAB ,KC_QUOT ,KC_COMM ,KC_DOT ,KC_P ,KC_Y ,KC_LBRC
,KC_MINS ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I
,KC_MPLY ,KC_SCLN ,KC_Q ,KC_J ,KC_K ,KC_X ,KC_LPRN
,KC_HOME ,KC_END ,KC_DOWN ,KC_UP ,M(A_ESC)
,KC_TRNS ,KC_TRNS
,KC_TRNS
,M(OH_BSSPC),M(OH_ENTSFT),M(OH_RIGHT)
// right hand
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
,KC_NO ,KC_NO
,KC_NO
,KC_NO ,KC_NO ,KC_NO
),
/* Keymap 7: One-handed, right side
*
* ,-----------------------------------------------------.
* | = F11 | 0 F10| 9 F9 | 8 F8 | 7 F7 | 6 F6 |A BSE|
* |-----------+------+------+------+------+-------------|
* | / | L | R | C | G | F | ] |
* |-----------+------+------+------+------+------| |
* | \ | S | N | T | H | D |------|
* |-----------+------+------+------+------+------| ) |
* | Stop | Z | V | W | M | B | |
* `-----------+------+------+------+------+-------------'
* | PgDn | PgUp | Right| Left | ESC |
* `-----------------------------------'
* ,-------------.
* | LAlt | GUI |
* ,------|------|------|
* |BackSp|LShift| Ctrl |
* | | |------|
* |Space |Enter |OTHER |
* `--------------------'
*/
[OHRGT] = KEYMAP(
// left hand
M(KF_11) ,M(KF_10) ,M(KF_9) ,M(KF_8) ,M(KF_7) ,M(KF_6) ,M(OH_BASE)
,KC_SLSH ,KC_L ,KC_R ,KC_C ,KC_G ,KC_F ,KC_RBRC
,KC_BSLS ,KC_S ,KC_N ,KC_T ,KC_H ,KC_D
,KC_MSTP ,KC_Z ,KC_V ,KC_W ,KC_M ,KC_B ,KC_RPRN
,KC_PGDN ,KC_PGUP ,KC_RGHT ,KC_LEFT ,M(A_ESC)
,KC_TRNS ,KC_TRNS
,KC_TRNS
,M(OH_BSSPC),M(OH_ENTSFT),M(OH_LEFT)
// right hand
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
,KC_NO ,KC_NO
,KC_NO
,KC_NO ,KC_NO ,KC_NO
),
/* Keymap 8: Steno for Plover
* *
* ,--------------------------------------------------. ,--------------------------------------------------. * ,--------------------------------------------------. ,--------------------------------------------------.
* | | | | | | | BASE | | | | | | | | | * | | | | | | | BASE | | | | | | | | |
@ -774,7 +666,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
return MACRODOWN(T(S), T(L), T(A), T(C), T(K), T(ENT), END); return MACRODOWN(T(S), T(L), T(A), T(C), T(K), T(ENT), END);
case APP_EMCS: case APP_EMCS:
return MACRODOWN(T(E), T(M), T(A), T(C), T(S), T(ENT), END); return MACRODOWN(T(G), T(N), T(U), T(SPC), T(E), T(M), T(A), T(C), T(S), T(SPC), T(2), T(4), T(ENT), END);
case APP_TERM: case APP_TERM:
return MACRODOWN(T(T), T(E), T(R), T(M), T(ENT), END); return MACRODOWN(T(T), T(E), T(R), T(M), T(ENT), END);
@ -789,65 +681,8 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
case KF_1 ... KF_11: case KF_1 ... KF_11:
ang_handle_kf (record, id); ang_handle_kf (record, id);
break; break;
/* 1HAND layout */
case OH_BASE:
if (record->event.pressed) {
oh_base_timer = timer_read ();
} else {
if (timer_elapsed (oh_base_timer) > TAPPING_TERM) {
layer_clear ();
} else {
return MACRO (T(APP), END);
}
}
break;
case OH_BSSPC:
if (record->event.pressed) {
oh_bsspc_timer = timer_read ();
} else {
if (timer_elapsed (oh_bsspc_timer) > TAPPING_TERM) {
return MACRO (T(BSPC), END);
} else {
return MACRO (T(SPC), END);
}
}
break;
case OH_ENTSFT:
if (record->event.pressed) {
oh_entsft_timer = timer_read ();
} else {
if (timer_elapsed (oh_entsft_timer) > TAPPING_TERM) {
if (keyboard_report->mods & MOD_BIT(KC_LSFT))
unregister_code (KC_LSFT);
else
register_code (KC_LSFT);
} else {
return MACRO (T(ENT), END);
}
}
break;
case OH_LEFT:
if (record->event.pressed) {
layer_move (OHLFT);
oh_left_blink = 1;
oh_left_blink_timer = timer_read ();
ergodox_right_led_1_on ();
}
break;
case OH_RIGHT:
if (record->event.pressed) {
layer_move (OHRGT);
oh_right_blink = 1;
oh_right_blink_timer = timer_read ();
ergodox_right_led_3_on ();
}
break;
} }
return MACRO_NONE; return MACRO_NONE;
}; };
@ -872,8 +707,12 @@ void matrix_init_user(void) {
if (!eeconfig_is_enabled()) if (!eeconfig_is_enabled())
eeconfig_init(); eeconfig_init();
dl = eeconfig_read_default_layer (); dl = eeconfig_read_default_layer ();
if (dl == (1UL << ADORE)) if (dl == (1UL << ADORE)) {
is_adore = 1; is_adore = 1;
#if ADORE_AUTOLOG
log_enable = true;
#endif
}
}; };
LEADER_EXTERNS(); LEADER_EXTERNS();
@ -896,10 +735,45 @@ void ang_tap (uint16_t codes[]) {
} }
} }
#define TAP_ONCE(code) \ #define TAP_ONCE(code) \
register_code (code); \ register_code (code); \
unregister_code (code) unregister_code (code)
void ang_tap_dance_bp_finished (qk_tap_dance_state_t *state, void *user_data) {
bool left, parens;
if (state->count > 2) {
state->count = 0;
return;
}
if (state->keycode == TD(CT_LBP))
left = true;
else
left = false;
if (state->count == 1)
parens = false;
else
parens = true;
if (parens) {
register_code (KC_RSFT);
if (left) {
TAP_ONCE(KC_9);
} else {
TAP_ONCE(KC_0);
}
unregister_code (KC_RSFT);
} else {
if (left) {
TAP_ONCE (KC_LBRC);
} else {
TAP_ONCE (KC_RBRC);
}
}
}
void ang_tap_dance_cln_finished (qk_tap_dance_state_t *state, void *user_data) { void ang_tap_dance_cln_finished (qk_tap_dance_state_t *state, void *user_data) {
if (state->count == 1) { if (state->count == 1) {
register_code (KC_RSFT); register_code (KC_RSFT);
@ -979,15 +853,21 @@ void ang_tap_dance_ta_reset (qk_tap_dance_state_t *state, void *user_data) {
td_ta->finished_once = false; td_ta->finished_once = false;
} }
const qk_tap_dance_action_t tap_dance_actions[] = { qk_tap_dance_action_t tap_dance_actions[] = {
[CT_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, ang_tap_dance_cln_finished, ang_tap_dance_cln_reset) [CT_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, ang_tap_dance_cln_finished, ang_tap_dance_cln_reset)
,[CT_MNS] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, ang_tap_dance_mns_finished, ang_tap_dance_mns_reset) ,[CT_MNS] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, ang_tap_dance_mns_finished, ang_tap_dance_mns_reset)
,[CT_TA] = { ,[CT_TA] = {
.fn = { NULL, ang_tap_dance_ta_finished, ang_tap_dance_ta_reset }, .fn = { NULL, ang_tap_dance_ta_finished, ang_tap_dance_ta_reset },
.user_data = (void *)&((td_ta_state_t) { false, false, false }) .user_data = (void *)&((td_ta_state_t) { false, false, false })
} }
,[CT_LBP] = ACTION_TAP_DANCE_FN (ang_tap_dance_bp_finished)
,[CT_RBP] = ACTION_TAP_DANCE_FN (ang_tap_dance_bp_finished)
}; };
static uint16_t uni[32];
static uint8_t unicnt;
static bool unimagic = false;
// Runs constantly in the background, in a loop. // Runs constantly in the background, in a loop.
void matrix_scan_user(void) { void matrix_scan_user(void) {
uint8_t layer = biton32(layer_state); uint8_t layer = biton32(layer_state);
@ -995,11 +875,6 @@ void matrix_scan_user(void) {
if (gui_timer && timer_elapsed (gui_timer) > TAPPING_TERM) if (gui_timer && timer_elapsed (gui_timer) > TAPPING_TERM)
unregister_code (KC_LGUI); unregister_code (KC_LGUI);
if (layer != OHLFT)
oh_left_blink = 0;
if (layer != OHRGT)
oh_right_blink = 0;
if (layer == HUN) { if (layer == HUN) {
ergodox_right_led_2_on(); ergodox_right_led_2_on();
ergodox_right_led_3_on(); ergodox_right_led_3_on();
@ -1018,39 +893,13 @@ void matrix_scan_user(void) {
ergodox_right_led_2_set (LED_BRIGHTNESS_HI); ergodox_right_led_2_set (LED_BRIGHTNESS_HI);
} }
if (layer == OHLFT || layer == OHRGT) {
ergodox_right_led_2_on();
if (oh_left_blink) {
if (timer_elapsed (oh_left_blink_timer) > OH_BLINK_INTERVAL) {
if ((keyboard_report->mods & MOD_BIT(KC_LSFT)) == 0)
ergodox_right_led_1_off ();
}
if (timer_elapsed (oh_left_blink_timer) > OH_BLINK_INTERVAL * 2) {
ergodox_right_led_1_on ();
oh_left_blink_timer = timer_read ();
}
}
if (oh_right_blink) {
if (timer_elapsed (oh_right_blink_timer) > OH_BLINK_INTERVAL) {
if ((keyboard_report->mods & MOD_BIT(KC_LCTRL)) == 0)
ergodox_right_led_3_off ();
}
if (timer_elapsed (oh_right_blink_timer) > OH_BLINK_INTERVAL * 2) {
ergodox_right_led_3_on ();
oh_right_blink_timer = timer_read ();
}
}
}
if (keyboard_report->mods & MOD_BIT(KC_LSFT) || if (keyboard_report->mods & MOD_BIT(KC_LSFT) ||
((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out())) { ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out())) {
ergodox_right_led_1_set (LED_BRIGHTNESS_HI); ergodox_right_led_1_set (LED_BRIGHTNESS_HI);
ergodox_right_led_1_on (); ergodox_right_led_1_on ();
} else { } else {
ergodox_right_led_1_set (LED_BRIGHTNESS_LO); ergodox_right_led_1_set (LED_BRIGHTNESS_LO);
if (layer != OHLFT && layer != NMDIA && layer != PLVR && layer != ADORE) if (layer != NMDIA && layer != PLVR && layer != ADORE)
ergodox_right_led_1_off (); ergodox_right_led_1_off ();
} }
@ -1060,7 +909,7 @@ void matrix_scan_user(void) {
ergodox_right_led_2_on (); ergodox_right_led_2_on ();
} else { } else {
ergodox_right_led_2_set (LED_BRIGHTNESS_LO); ergodox_right_led_2_set (LED_BRIGHTNESS_LO);
if (layer != OHRGT && layer != HUN && layer != OHLFT && layer != NMDIA && layer != PLVR && layer != ADORE) if (layer != HUN && layer != NMDIA && layer != PLVR && layer != ADORE)
ergodox_right_led_2_off (); ergodox_right_led_2_off ();
} }
@ -1070,7 +919,7 @@ void matrix_scan_user(void) {
ergodox_right_led_3_on (); ergodox_right_led_3_on ();
} else { } else {
ergodox_right_led_3_set (LED_BRIGHTNESS_LO); ergodox_right_led_3_set (LED_BRIGHTNESS_LO);
if (layer != OHRGT && layer != HUN && layer != PLVR && layer != ADORE) if (layer != HUN && layer != PLVR && layer != ADORE)
ergodox_right_led_3_off (); ergodox_right_led_3_off ();
} }
@ -1095,6 +944,14 @@ void matrix_scan_user(void) {
ang_do_unicode (); ang_do_unicode ();
} }
SEQ_TWO_KEYS (KC_LEAD, KC_U) {
unicnt = 0;
unimagic = true;
register_code(KC_RSFT);
TAP_ONCE(KC_U);
unregister_code(KC_RSFT);
}
SEQ_ONE_KEY (KC_V) { SEQ_ONE_KEY (KC_V) {
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ (" QMK_VERSION "/" KEYMAP_VERSION ")"); SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ (" QMK_VERSION "/" KEYMAP_VERSION ")");
} }
@ -1156,7 +1013,13 @@ void matrix_scan_user(void) {
ergodox_right_led_2_off (); ergodox_right_led_2_off ();
wait_ms (100); wait_ms (100);
ergodox_right_led_1_off (); ergodox_right_led_1_off ();
#if ADORE_AUTOLOG
log_enable = true;
#endif
} else { } else {
#if ADORE_AUTOLOG
log_enable = false;
#endif
is_adore = 0; is_adore = 0;
default_layer_and (0); default_layer_and (0);
default_layer_or (1UL << BASE); default_layer_or (1UL << BASE);
@ -1180,16 +1043,141 @@ void matrix_scan_user(void) {
static uint16_t last4[4]; static uint16_t last4[4];
bool is_uni_seq(char *seq) {
uint8_t i;
for (i = 0; seq[i]; i++) {
uint16_t code;
if (('1' <= seq[i]) && (seq[i] <= '9'))
code = seq[i] - '1' + KC_1;
else if (seq[i] == '0')
code = KC_0;
else
code = seq[i] - 'a' + KC_A;
if (i > unicnt)
return false;
if (uni[i] != code)
return false;
}
if (uni[i] == KC_ENT || uni[i] == KC_SPC)
return true;
return false;
}
uint16_t hex_to_keycode(uint8_t hex)
{
if (hex == 0x0) {
return KC_0;
} else if (hex < 0xA) {
return KC_1 + (hex - 0x1);
} else {
return KC_A + (hex - 0xA);
}
}
void register_hex(uint16_t hex) {
bool leading_zeros = true;
for(int i = 3; i >= 0; i--) {
uint8_t digit = ((hex >> (i*4)) & 0xF);
if (digit != 0)
leading_zeros = false;
else if (leading_zeros)
continue;
register_code(hex_to_keycode(digit));
unregister_code(hex_to_keycode(digit));
wait_ms(10);
}
}
typedef struct {
char *symbol;
uint16_t codes[4];
} qk_ucis_symbol_t;
static qk_ucis_symbol_t ucis_symbol_table[] = {
{"poop", {0x1, 0xf4a9, 0}},
{"rofl", {0x1, 0xf923, 0}},
{"kiss", {0x1, 0xf619, 0}},
{"snowman", {0x2603, 0}},
{NULL, {}}
};
bool process_record_ucis (uint16_t keycode, keyrecord_t *record) {
uint8_t i;
if (!unimagic)
return true;
if (!record->event.pressed)
return true;
uni[unicnt] = keycode;
unicnt++;
if (keycode == KC_BSPC) {
if (unicnt >= 2) {
unicnt-= 2;
return true;
} else {
unicnt--;
return false;
}
}
if (keycode == KC_ENT || keycode == KC_SPC) {
bool symbol_found = false;
for (i = unicnt; i > 0; i--) {
register_code (KC_BSPC);
unregister_code (KC_BSPC);
wait_ms(10);
}
ang_do_unicode();
wait_ms(10);
for (i = 0; ucis_symbol_table[i].symbol; i++) {
if (is_uni_seq (ucis_symbol_table[i].symbol)) {
symbol_found = true;
for (uint8_t j = 0; ucis_symbol_table[i].codes[j]; j++) {
register_hex(ucis_symbol_table[i].codes[j]);
}
break;
}
}
if (!symbol_found) {
for (i = 0; i < unicnt - 1; i++) {
uint8_t code;
if (uni[i] > KF_1)
code = uni[i] - KF_1 + KC_1;
else
code = uni[i];
TAP_ONCE(code);
wait_ms (10);
}
}
unimagic = false;
return true;
}
return true;
}
bool process_record_user (uint16_t keycode, keyrecord_t *record) { bool process_record_user (uint16_t keycode, keyrecord_t *record) {
#if KEYLOGGER_ENABLE #if KEYLOGGER_ENABLE
uint8_t layer = biton32(layer_state); if (log_enable) {
if (log_enable && layer == BASE) {
xprintf ("KL: col=%d, row=%d\n", record->event.key.col, xprintf ("KL: col=%d, row=%d\n", record->event.key.col,
record->event.key.row); record->event.key.row);
} }
#endif #endif
if (!process_record_ucis (keycode, record))
return false;
if (time_travel && !record->event.pressed) { if (time_travel && !record->event.pressed) {
uint8_t p; uint8_t p;

View file

@ -16,11 +16,12 @@ Some of the things in the layout only work when one uses Spacemacs and GNOME und
- [ADORE layer](#adore-layer) - [ADORE layer](#adore-layer)
- [Hungarian layer](#hungarian-layer) - [Hungarian layer](#hungarian-layer)
- [Navigation and media layer](#navigation-and-media-layer) - [Navigation and media layer](#navigation-and-media-layer)
- [One-handed layer](#one-handed-layer)
- [Steno layer](#steno-layer) - [Steno layer](#steno-layer)
- [LED states](#led-states) - [LED states](#led-states)
* [Tools](#tools) * [Tools](#tools)
- [Heatmap](#heatmap) - [Heatmap](#heatmap)
* [Special features](#special-features)
- [Unicode Symbol Input](#unicode-symbol-input)
* [Building](#building) * [Building](#building)
- [Using on Windows](#using-on-windows) - [Using on Windows](#using-on-windows)
* [Changelog](#changelog) * [Changelog](#changelog)
@ -38,7 +39,7 @@ At its core, this is a Dvorak layout, with some minor changes. The more interest
* The `Shift`, `Alt`, and `Control` modifiers are one-shot. When tapped, they are considered active for the next key press only. When double tapped, they toggle on, until a third, single tap sometime later. When held, they act as expected. My usual pattern is that I use these for the next keypress only, so this behaviour is perfect. If I need them held, I'll just double-tap. * The `Shift`, `Alt`, and `Control` modifiers are one-shot. When tapped, they are considered active for the next key press only. When double tapped, they toggle on, until a third, single tap sometime later. When held, they act as expected. My usual pattern is that I use these for the next keypress only, so this behaviour is perfect. If I need them held, I'll just double-tap.
* The `GUI` key is special, because when I double-tap it, it sends `GUI + w`, which pops up an application selector. It also switches to a one-shot layer, where the number row on the left half turns into app selector macros, for the most common things I usually want to switch to. Otherwise it behaves as on a normal layout. * The `GUI` key is special, because when I double-tap it, it sends `GUI + w`, which pops up an application selector. It also switches to a one-shot layer, where the number row on the left half turns into app selector macros, for the most common things I usually want to switch to. Otherwise it behaves as on a normal layout.
* The `ESC` key also doubles as a one-shot cancel key: if tapped while any of the one-shot modifiers are in-flight (as in, single-tapped, and not expired yet), it cancels all one-shot modifiers. It also cancels the **Hun** layer, if active. Otherwise it sends the usual keycode. * The `ESC` key also doubles as a one-shot cancel key: if tapped while any of the one-shot modifiers are in-flight (as in, single-tapped, and not expired yet), it cancels all one-shot modifiers. It also cancels the **Hun** layer, if active. Otherwise it sends the usual keycode.
* The **Media** and **Hun** layer keys are one-shot, the **1Hand** and **STENO** keys are toggles. * The **Media** and **Hun** layer keys are one-shot, the **STENO** key is a toggle.
* When holding any of the **Arrow** layer keys, the arrow layer activates while the layer key is held. Tapping the key produces the normal key. * When holding any of the **Arrow** layer keys, the arrow layer activates while the layer key is held. Tapping the key produces the normal key.
* Tapping the `:` key once yields `:`, tapping it twice yields `;`. * Tapping the `:` key once yields `:`, tapping it twice yields `;`.
* The **Lead** key allows me to type in a sequence of keys, and trigger some actions: * The **Lead** key allows me to type in a sequence of keys, and trigger some actions:
@ -51,6 +52,7 @@ At its core, this is a Dvorak layout, with some minor changes. The more interest
- `LEAD v` prints the firmware version, the keyboard and the keymap. - `LEAD v` prints the firmware version, the keyboard and the keymap.
- `LEAD d` toggles logging keypress positions to the HID console. - `LEAD d` toggles logging keypress positions to the HID console.
- `LEAD t` toggles time travel. Figuring out the current `date` is left as an exercise to the reader. - `LEAD t` toggles time travel. Figuring out the current `date` is left as an exercise to the reader.
- `LEAD LEAD u` enters the [Unicode symbol input][#unicode-symbol-input] mode.
## ADORE layer ## ADORE layer
@ -74,20 +76,6 @@ On this layer, the accented characters are at the same position as their base va
This layer is primarily for navigating with the cursor or the mouse, and some media things. This layer is primarily for navigating with the cursor or the mouse, and some media things.
## One-handed layer
[![One-handed layer](images/one-handed-layer.png)](http://www.keyboard-layout-editor.com/#/gists/edff2495135955b8963198dace7f7ece)
The one-handed layer is used in situations where the right hand is occupied, by mousing around, for example. Tapping the `OTHER` key switches which side is active. For the most part, keys remain in their usual position. When the right half is active, keys are mirrored to the left half.
The differences are as follows:
* The `ESC` key has been moved to the bottom row, so the `OTHER` key is easier to tap.
* Most keys on the thumb cluster now have dual uses, and these do not change when switching sides:
- The `Space`/`Backspace` key sends `Space` on tap, `Backspace` when held for longer than a normal tap.
- The `Enter`/`Shift` key sends `Enter` on short-tap, `Shift` on long-tap.
* The `Apps`/`BASE` key can be used to go back to the base layer, by long-tapping it. A short-tap will send the `App` key, as usual.
## Steno layer ## Steno layer
[![Steno layer for Plover](images/steno-layer.png)](http://www.keyboard-layout-editor.com/#/gists/401ef9a84369e47c57f9aedcf0a0d667) [![Steno layer for Plover](images/steno-layer.png)](http://www.keyboard-layout-editor.com/#/gists/401ef9a84369e47c57f9aedcf0a0d667)
@ -103,11 +91,25 @@ For the layers, the following rules apply:
* When the [ADORE layer](#adore-layer) is toggled on, LEDs will light up from left to right in a sequence, then turn off. When the layer is toggled off, the LEDs light up and turn off in the other direction. No LEDs are on while the layer is active. * When the [ADORE layer](#adore-layer) is toggled on, LEDs will light up from left to right in a sequence, then turn off. When the layer is toggled off, the LEDs light up and turn off in the other direction. No LEDs are on while the layer is active.
* When the [Hungarian layer](#hungarian-layer) is active, the *green* and *blue* LEDs are on. * When the [Hungarian layer](#hungarian-layer) is active, the *green* and *blue* LEDs are on.
* When the [Navigation and media layer](#navigation-and-media-layer) is active, the *red* and *green* ones are on. * When the [Navigation and media layer](#navigation-and-media-layer) is active, the *red* and *green* ones are on.
* When the [One-handed layer](#one-handed-layer) is active, the *green* LED is on and bright, and either the *red* or the *blue* one is going to slowly blink, depending on the currently active side.
* For the [Steno layer](#steno-layer), all LEDs will be turned on. * For the [Steno layer](#steno-layer), all LEDs will be turned on.
Unless noted otherwise, the layers use a dim light for the LEDs, while modifiers use a stronger one, and modifiers override any layer preferences. For example, when on the one-handed layer, with the left side active (*red* light blinking), if `Shift` is on, the *red* light will be constantly on. Unless noted otherwise, the layers use a dim light for the LEDs, while modifiers use a stronger one, and modifiers override any layer preferences. For example, when on the one-handed layer, with the left side active (*red* light blinking), if `Shift` is on, the *red* light will be constantly on.
# Special features
## Unicode Symbol Input
Once in the Unicode Symbol Input mode, one is able to type in symbol names, press `Enter` or `Space`, and get the Unicode symbol itself back. When in the mode, a capital `U` is printed first. Once the sequence is finished, all of it is erased by sending enough `Backspace` taps, and the firmware starts the OS-specific unicode input sequence. Then, it looks up the symbol name, and enters the associated code. If it is not found, it will just replay the pressed keycodes.
The currently supported symbols are:
- `snowman`: ☃
- `kiss`: 😙
- `rofl`: 🤣
- `poop`: 💩
This is an experimental feature, and may or may not work reliably.
# Tools # Tools
## Heatmap ## Heatmap
@ -133,14 +135,14 @@ To make my workflow easier, this layout is maintained in [its own repository][al
$ git clone https://github.com/jackhumbert/qmk_firmware.git $ git clone https://github.com/jackhumbert/qmk_firmware.git
$ cd qmk_firmware $ cd qmk_firmware
$ git clone https://github.com/algernon/ergodox-layout.git \ $ git clone https://github.com/algernon/ergodox-layout.git \
keyboards/ergodox_ez/keymaps/algernon-master keyboards/ergodox/keymaps/algernon-master
$ make KEYBOARD=ergodox_ez KEYMAP=algernon-master $ make keyboard=ergodox keymap=algernon-master
``` ```
From time to time, updates may be submitted back to the QMK repository. If you are reading it there, you can build the firmware like any other firmware included with it (assuming you are in the root directory of the firmware): From time to time, updates may be submitted back to the QMK repository. If you are reading it there, you can build the firmware like any other firmware included with it (assuming you are in the root directory of the firmware):
``` ```
$ make KEYBOARD=ergodox_ez KEYMAP=algernon $ make keyboard=ergodox keymap=algernon
``` ```
## Using on Windows ## Using on Windows
@ -149,6 +151,16 @@ The keymap default to forcing NKRO, which seems to upset Windows, and except the
# Changelog # Changelog
## v1.5 - 2016-08-12
* The **1HAND** layer has been removed.
* A `Delete` key is now available on the right thumb cluster.
* The [ADORE](#adore-layer) layer received a major update, see the layout image above.
* It is now possible to enable automatic logging for the [ADORE](#adore-layer) layer, by setting the `ADORE_AUTOLOG` makefile variable to `yes` when compiling the keymap. It is off by default.
* The `~` key and the `Media Next/Prev` key have been swapped on the [base layer](#base-layer).
* On the **ARROW** layer, `Backspace` has been replaced by `Enter`.
* There is some experimental support for entering Unicode symbols.
## v1.4 - 2016-07-29 ## v1.4 - 2016-07-29
* When toggling the key logging on or off, the LEDs will do a little dance. * When toggling the key logging on or off, the LEDs will do a little dance.

View file

@ -0,0 +1,311 @@
/*
* The Dvorak layout shown herestems from my early Kinesis years, using the Contour PS/2 with a Dvorak
* software layout. Because of this, the RBRC and LBRC were on opposite sides of the board in the corner
* keys. I've decided to continue using this layout with my ErgoDox.
*
* The QWERTY layout shown here is based entirely on the Kinesis Advantage layout, with the additional
* keys as shown in the diagrams. The Colemak layout is merely an adaptation of that.
*
* I've enabled persistent keymaps for Qwerty, Dvorak and Colemak layers, similar to the default Planck
* layouts.
*
* For a better explanation of the layout matrices shown below, take a look at ../../ez/ez.h where the
* keymap is defined, beginning on line 81.
*
*/
#include "ergodox.h"
#include "debug.h"
#include "action_layer.h"
#include "eeconfig.h"
extern keymap_config_t keymap_config;
#define _DV 0 // Dvorak layer
#define _QW 1 // Qwerty layer
#define _CM 2 // Colemak layer
#define _MD 3 // Media Layer
#define _KP 4 // Keypad Layer
// Macro name shortcuts
#define DVORAK M(_DV)
#define QWERTY M(_QW)
#define COLEMAK M(_CM)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap 0: Dvorak layer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | ] | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | [ |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | Tab | ' | , | . | Y | Y | | | | F | G | C | R | L | \ |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | CapsLk | A | O | E | U | I |------| |------| D | H | T | N | S | - |
* |--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------|
* | LShift | Z | X | C | V | X | | | | B | M | W | V | Z | RShift |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | LGUI | ` | INS | Left | Rght | | Up | Dn | / | = | RGUI |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | LCtr | LAlt | | Ralt | RCtr |
* ,------|------|------| |------+------+------.
* | | | Home | | PgUp | | |
* | BkSp | Del |------| |------| Enter| Space|
* | | | End | | PgDn | | |
* `--------------------' `--------------------'
*
*/
// If it accepts an argument (i.e, is a function), it doesn't need KC_.
// Otherwise, it needs KC_*
[_DV] = { // layer 0 : Dvorak
// left hand
{KC_RBRC, KC_TAB, KC_CAPS, KC_LSFT, KC_LGUI, KC_NO },
{KC_1, KC_QUOT, KC_A, KC_SCLN, KC_GRV, KC_END },
{KC_2, KC_COMM, KC_O, KC_Q, KC_INS, KC_DEL },
{KC_3, KC_DOT, KC_E, KC_J, KC_LEFT, KC_BSPC},
{KC_4, KC_P, KC_U, KC_K, KC_RGHT, KC_HOME},
{KC_5, KC_Y, KC_I, KC_X, KC_NO, KC_LCTL},
{KC_ESC, KC_NO, KC_NO, MO(_MD), KC_NO, KC_LALT},
// right hand
{KC_ESC, KC_NO, KC_NO, MO(_KP), KC_NO, KC_RALT},
{KC_6, KC_F, KC_D, KC_B, KC_NO, KC_RCTL},
{KC_7, KC_G, KC_H, KC_M, KC_UP, KC_PGUP},
{KC_8, KC_C, KC_T, KC_W, KC_DOWN, KC_SPC },
{KC_9, KC_R, KC_N, KC_V, KC_SLSH, KC_ENT },
{KC_0, KC_L, KC_S, KC_Z, KC_EQL, KC_PGDN},
{KC_LBRC, KC_BSLS, KC_MINS, KC_RSFT, KC_RGUI, KC_NO }
},
/* Keymap 1: QWERTY layer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | = | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | - |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | Tab | Q | W | E | R | T | | | | Y | U | I | O | P | \ |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | CapsLk | A | S | D | F | G |------| |------| H | J | K | L | ; | ' |
* |--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------|
* | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | LGUI | ` | INS | Left | Rght | | Up | Dn | [ | ] | RGUI |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | LCtr | LAlt | | Ralt | RCtr |
* ,------|------|------| |------+------+------.
* | | | Home | | PgUp | | |
* | BkSp | Del |------| |------| Enter| Space|
* | | | End | | PgDn | | |
* `--------------------' `--------------------'
*/
// If it accepts an argument (i.e, is a function), it doesn't need KC_.
// Otherwise, it needs KC_*
[_QW] = { // layer 1 : QWERTY
// left hand
{KC_EQL, KC_TAB, KC_CAPS, KC_LSFT, KC_LGUI, KC_NO },
{KC_1, KC_Q, KC_A, KC_Z, KC_GRV, KC_END },
{KC_2, KC_W, KC_S, KC_X, KC_INS, KC_DEL },
{KC_3, KC_E, KC_D, KC_C, KC_LEFT, KC_BSPC},
{KC_4, KC_R, KC_F, KC_V, KC_RGHT, KC_HOME},
{KC_5, KC_T, KC_G, KC_B, KC_NO, KC_LCTL},
{KC_ESC, KC_NO, KC_NO, MO(_MD), KC_NO, KC_LALT},
// right hand
{KC_ESC, KC_NO, KC_NO, MO(_KP), KC_NO, KC_RALT},
{KC_6, KC_Y, KC_H, KC_N, KC_NO, KC_RCTL},
{KC_7, KC_U, KC_J, KC_M, KC_UP, KC_PGUP},
{KC_8, KC_I, KC_K, KC_COMM, KC_DOWN, KC_SPC },
{KC_9, KC_O, KC_L, KC_DOT, KC_LBRC, KC_ENT },
{KC_0, KC_P, KC_SCLN, KC_SLSH, KC_RBRC, KC_PGDN},
{KC_MINS, KC_BSLS, KC_QUOT, KC_RSFT, KC_RGUI, KC_NO }
},
/* Keymap 2: Colemak layer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | = | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | - |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | Tab | Q | W | F | P | G | | | | J | L | U | Y | ; | \ |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | BkSpc | A | R | S | T | D |------| |------| H | N | E | I | O | ' |
* |--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------|
* | LShift | Z | X | C | V | B | | | | K | M | , | . | / | RShift |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | LGUI | ` | INS | Left | Rght | | Up | Dn | [ | ] | RGUI |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | LCtr | LAlt | | Ralt | RCtr |
* ,------|------|------| |------+------+------.
* | | | Home | | PgUp | | |
* | BkSp | Del |------| |------| Enter| Space|
* | | | End | | PgDn | | |
* `--------------------' `--------------------'
*/
// If it accepts an argument (i.e, is a function), it doesn't need KC_.
// Otherwise, it needs KC_*
[_CM] = { // layer 2 : Colemak
// left hand
{KC_EQL, KC_TAB, KC_BSPC, KC_LSFT, KC_LGUI, KC_NO },
{KC_1, KC_Q, KC_A, KC_Z, KC_GRV, KC_END },
{KC_2, KC_W, KC_R, KC_X, KC_INS, KC_DEL },
{KC_3, KC_F, KC_S, KC_C, KC_LEFT, KC_BSPC},
{KC_4, KC_P, KC_T, KC_V, KC_RGHT, KC_HOME},
{KC_5, KC_G, KC_D, KC_B, KC_NO, KC_LCTL},
{KC_ESC, KC_NO, KC_NO, MO(_MD), KC_NO, KC_LALT},
// right hand
{KC_ESC, KC_NO, KC_NO, MO(_KP), KC_NO, KC_RALT},
{KC_6, KC_J, KC_H, KC_K, KC_NO, KC_RCTL},
{KC_7, KC_L, KC_N, KC_M, KC_UP, KC_PGUP},
{KC_8, KC_U, KC_E, KC_COMM, KC_DOWN, KC_SPC },
{KC_9, KC_Y, KC_I, KC_DOT, KC_LBRC, KC_ENT },
{KC_0, KC_SCLN, KC_O, KC_SLSH, KC_RBRC, KC_PGDN},
{KC_MINS, KC_BSLS, KC_QUOT, KC_RSFT, KC_RGUI, KC_NO }
},
/* Keymap 3: Symbol Layer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | TEENSY | F1 | F2 | F3 | F4 | F5 | F11 | | F12 | F6 | F7 | F8 | F9 | F10 | |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | | | PrSc | ScLk | Paus | | FN4 | | FN5 | | Mute | Vol- | Vol+ | | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | | | | | | |------| |------| Stop | Prev | Play | Next | Sel | |
* |--------+------+------+------+------+------| FN4 | | FN5 |------+------+------+------+------+--------|
* | | |Dvorak|Qwerty|Colemk| | | | | | | | | | |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | | | | | | | | |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------|------| |------+------+------.
* | | | | | | | |
* | | |------| |------| | |
* | | | | | | | |
* `--------------------' `--------------------'
*/
// Media Layer
[_MD] = { // layer 3 : Media layer
// left hand
{RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO },
{KC_F1, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS},
{KC_F2, KC_PSCR, KC_TRNS, DVORAK, KC_TRNS, KC_TRNS},
{KC_F3, KC_SLCK, KC_TRNS, QWERTY, KC_TRNS, KC_TRNS},
{KC_F4, KC_PAUS, KC_TRNS, COLEMAK, KC_TRNS, KC_TRNS},
{KC_F5, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS},
{KC_F11, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_TRNS},
// right hand
{KC_F12, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_TRNS},
{KC_F6, KC_TRNS, KC_MSTP, KC_TRNS, KC_NO, KC_TRNS},
{KC_F7, KC_MUTE, KC_MPRV, KC_TRNS, KC_TRNS, KC_TRNS},
{KC_F8, KC_VOLD, KC_MPLY, KC_TRNS, KC_TRNS, KC_TRNS},
{KC_F9, KC_VOLU, KC_MNXT, KC_TRNS, KC_TRNS, KC_TRNS},
{KC_F10, KC_TRNS, KC_MSEL, KC_TRNS, KC_TRNS, KC_TRNS},
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO }
},
/* Keymap 4: Keypad layer
*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | Power | | | | | | | | | | NmLk | KP / | KP * | KP - | |
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | Sleep | | | | | | FN5 | | FN4 | | KP 7 | KP 8 | KP 9 | KP + | |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | Wake | | | | | |------| |------| | KP 4 | KP 5 | KP 6 | KP + | |
* |--------+------+------+------+------+------| FN5 | | FN4 |------+------+------+------+------+--------|
* | | | | | | | | | | | KP 1 | KP 2 | KP 3 |KP Ent| |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | | | | | | | KP 0 | | KP . |KP Ent| |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | | | | | |
* ,------|------|------| |------+------+------.
* | | | | | | | |
* | | |------| |------| | |
* | | | | | | | |
* `--------------------' `--------------------'
*/
// Keypad Layer
[_KP] = { // layer 4 : Keypad layer
// left hand
{KC_PWR, KC_SLEP, KC_WAKE, KC_TRNS, KC_TRNS, KC_NO },
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS},
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS},
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS},
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS},
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS},
{KC_TRNS, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_TRNS},
// right hand
{KC_TRNS, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_TRNS},
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS},
{KC_NLCK, KC_P7, KC_P4, KC_P1, KC_P0, KC_TRNS},
{KC_PSLS, KC_P8, KC_P5, KC_P2, KC_NO, KC_TRNS},
{KC_PAST, KC_P9, KC_P6, KC_P3, KC_PDOT, KC_TRNS},
{KC_PMNS, KC_PPLS, KC_PPLS, KC_PENT, KC_PENT, KC_TRNS},
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO }
},
};
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 _DV:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_DV);
}
break;
case _QW:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_QW);
}
break;
case _CM:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_CM);
}
break;
}
return MACRO_NONE;
};
// Runs just one time when the keyboard initializes.
void matrix_init_user(void) {
};
// Runs constantly in the background, in a loop.
void matrix_scan_user(void) {
uint8_t layer = biton32(layer_state);
ergodox_board_led_off();
ergodox_right_led_1_off();
ergodox_right_led_2_off();
ergodox_right_led_3_off();
switch (layer) {
// TODO: Make this relevant to the ErgoDox EZ.
case 1:
ergodox_right_led_1_on();
break;
case 2:
ergodox_right_led_2_on();
break;
default:
// none
break;
}
};

View file

@ -0,0 +1,71 @@
# 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=512
# 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 ?= yes # 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 ?= yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
ifndef QUANTUM_DIR
include ../../../Makefile
endif

View file

@ -0,0 +1,80 @@
/*
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 0x6660
#define DEVICE_VER 0x0001
#define MANUFACTURER ME
#define PRODUCT MinOrca
#define DESCRIPTION Tiny Whale
/* key matrix size */
#define MATRIX_ROWS 4
#define MATRIX_COLS 12
/* MinOrca PCB default pin-out */
#define MATRIX_COL_PINS { D4, D6, D7, B4, B5, B6, F7, F6, F5, F4, F1, F0 }
#define MATRIX_ROW_PINS { B0, B1, B2, B3 }
#define UNUSED_PINS
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
/* number of backlight levels */
#define BACKLIGHT_LEVELS 3
/* Set 0 if debouncing isn't needed */
#define DEBOUNCING_DELAY 5
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE
/* key combination for command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
/*
* 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

View file

@ -0,0 +1,25 @@
# Build Options
# change to "no" to disable the options, or define them in the Makefile in
# the appropriate keymap folder that will get included automatically
#
BOOTMAGIC_ENABLE = yes # 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.
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
ifndef QUANTUM_DIR
include ../../../../../Makefile
endif

View file

@ -0,0 +1,12 @@
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include "../../config.h"
/* bootmagic salt key */
#define BOOTMAGIC_KEY_SALT KC_ESC
/* skip bootmagic and eeconfig */
#define BOOTMAGIC_KEY_SKIP KC_SPACE
#endif

View file

@ -0,0 +1,44 @@
// 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 "minorca.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.
// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = { /* Base */
{KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC },
{KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, XXXXXXX, KC_ENT },
{KC_LCTRL,XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_QUOT, KC_FN1, KC_FN0 },
{KC_NO, XXXXXXX, KC_NO, KC_LALT, KC_SPC, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, KC_DOT, KC_SLSH, KC_NO }
},
[1] = { /* First */
{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELT },
{KC_TAB, KC_MPRV, KC_MPLY, KC_MNXT, KC_PGUP, KC_HOME, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, XXXXXXX, KC_LGUI },
{KC_LCTRL,XXXXXXX, KC_Z, KC_X, KC_C, KC_PGDN, KC_END, KC_L, KC_SCLN, KC_UP, KC_FN1, KC_FN0 },
{KC_NO, XXXXXXX, KC_NO, KC_LALT, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_DOWN, KC_RIGHT,KC_NO }
},
[2] = { /* Second */
{KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DELT },
{KC_TAB, KC_MUTE, KC_VOLD, KC_VOLU, KC_TILD, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, XXXXXXX, KC_ENT },
{KC_CAPS, XXXXXXX, KC_LSFT, KC_RSFT, KC_PAUSE,KC_F10, KC_F11, KC_F12, KC_NO, KC_UP, KC_FN1, KC_FN0 },
{KC_NO, XXXXXXX, KC_NO, KC_LALT, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_DOWN, KC_RIGHT,KC_NO }
},
};
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1), // to First overlay
[1] = ACTION_LAYER_MOMENTARY(2), // to Second overlay
};

View file

@ -0,0 +1,5 @@
# The Default Minorca Layout
Copied from https://github.com/pancinteractive/qmk_firmware/blob/master/keyboard/minorca_mkV/keymaps/default/keymap.c
It looks incomplete.

View file

@ -0,0 +1,23 @@
# How to add your own keymap
Folders can be named however you'd like (will be approved upon merging), or should follow the format with a preceding `_`:
_[ISO 3166-1 alpha-2 code*]_[layout variant]_[layout name/author]
\* See full list: https://en.wikipedia.org/wiki/ISO_3166-1#Officially_assigned_code_elements
and contain the following files:
* `keymap.c`
* `readme.md` *recommended*
* `config.h` *optional*, found automatically when compiling
* `Makefile` *optional*, found automatically when compling
When adding your keymap to this list, keep it organised alphabetically (select list, edit->sort lines), and use this format:
* **folder_name** description
# List of Minorca keymaps
* **default** default Minorca layout
* **rgb** layout with WS2812b control

View file

@ -0,0 +1,25 @@
# Build Options
# change to "no" to disable the options, or define them in the Makefile in
# the appropriate keymap folder that will get included automatically
#
BOOTMAGIC_ENABLE = yes # 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
ifndef QUANTUM_DIR
include ../../../../../Makefile
endif

View file

@ -0,0 +1,20 @@
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include "../../config.h"
/* bootmagic salt key */
#define BOOTMAGIC_KEY_SALT KC_ESC
/* skip bootmagic and eeconfig */
#define BOOTMAGIC_KEY_SKIP KC_SPACE
/* ws2812 RGB LED */
#define RGB_DI_PIN D5
#define RGBLIGHT_TIMER
#define RGBLED_NUM 13 // Number of LEDs
#define RGBLIGHT_HUE_STEP 10
#define RGBLIGHT_SAT_STEP 17
#define RGBLIGHT_VAL_STEP 17
#endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

View file

@ -0,0 +1,65 @@
// 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 "minorca.h"
#include "action_layer.h"
#include "eeconfig.h"
extern keymap_config_t keymap_config;
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _QWERTY 0
#define _LOWER 1
#define _RAISE 2
#define _TB 3
// Macro name shortcuts
#define QWERTY M(_QWERTY)
#define LOWER M(_LOWER)
#define RAISE M(_RAISE)
// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = { /* Qwerty */
{KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
{FUNC(0), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, XXXXXXX, KC_QUOT},
{KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, FUNC(1)},
{KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, FUNC(2), XXXXXXX, XXXXXXX, FUNC(3), XXXXXXX, KC_RALT, KC_APP, KC_RCTL}
},
[_RAISE] = {
{S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_BSPC},
{KC_TRNS, KC_TRNS, KC_TRNS, KC_PAUSE, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), XXXXXXX, S(KC_BSLS)},
{KC_TRNS, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_ENT},
{KC_TRNS, XXXXXXX, KC_TRNS, KC_TRNS, KC_TRNS, XXXXXXX, XXXXXXX, KC_TRNS, XXXXXXX, KC_MNXT, KC_MUTE, KC_MPLY}
},
[_LOWER] = {
{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELETE},
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, XXXXXXX, KC_BSLS},
{KC_TRNS, XXXXXXX, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_PGUP, KC_ENT},
{KC_TRNS, XXXXXXX, KC_TRNS, KC_TRNS, KC_TRNS, XXXXXXX, XXXXXXX, KC_TRNS, XXXXXXX, KC_HOME, KC_PGDN, KC_END}
},
[_TB] = { /* Tab */
{KC_ESC, KC_CALC, KC_WHOM, KC_MAIL, KC_MYCM, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_TRNS},
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, XXXXXXX, KC_TRNS},
{KC_TRNS, XXXXXXX, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_UP, KC_ENT},
{BL_STEP, XXXXXXX, KC_TRNS, KC_TRNS, KC_TRNS, XXXXXXX, XXXXXXX, KC_TRNS, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT}
}
};
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_TAP_KEY(_TB, KC_TAB),
[1] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT),
[2] = ACTION_LAYER_TAP_KEY(_RAISE, KC_SPC),
[3] = ACTION_LAYER_TAP_KEY(_LOWER, KC_SPC),
};

View file

@ -0,0 +1,25 @@
#RGB backlight for MinOrca
![wiring](example.jpg)
Example of adding WS2812b LEDs to a MinOrca.
http://www.40percent.club/2016/08/tiny-whale.html
The keymap is a work in progress. The RGB functions are accessed by holding down the TAB key.
* Tab + Z Toggle on/off
* Tab + X Mode
* Tab + C Hue+
* Tab + V Hue-
* Tab + B Saturation+
* Tab + N Saturation-
* Tab + M Brightness+
* Tab + , Brightness-
Example wiring:
WS2812 data pin is connected to D5
![wiring](wiring1.jpg)
![wiring closeup](wiring2.jpg)

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

View file

@ -0,0 +1,6 @@
#include "minorca.h"
void matrix_init_kb(void) {
matrix_init_user();
}

View file

@ -0,0 +1,6 @@
#ifndef MINORCA_H
#define MINORCA_H
#include "quantum.h"
#endif

View file

@ -0,0 +1,33 @@
minorca keyboard firmware
======================
Handwired 40% keyboard
http://www.panc.co/blog/minorcasebright-information-page
## Quantum MK Firmware
For the full Quantum feature list, see [the parent readme.md](/readme.md).
## Building
Download or clone the whole firmware and navigate to the keyboards/planck folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use `make dfu` to program your PCB once you hit the reset button.
Depending on which keymap you would like to use, you will have to compile slightly differently.
### Default
To build with the default keymap, simply run `make`.
### Other Keymaps
Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `<name>.c` in the keymaps folder, and see keymap document (you can find in top readme.md) and existent keymap files.
To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like:
```
$ make KEYMAP=[default|jack|<name>]
```
Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.
### Notable forks (which some of the keymap files are from)
- [Shane's Fork](https://github.com/shanecelis/tmk_keyboard/tree/master/keyboard/planck)
- [Pierre's Fork](https://github.com/pcarrier/tmk_keyboard/blob/pcarrier/planck/keyboard/gh60/keymap_planck.c)
- [Nathan's Fork](https://github.com/nathanrosspowell/tmk_keyboard/tree/planck-jack/keyboard/planck)
- [Matthew's Fork](https://github.com/pepers/tmk_keyboard/tree/master/keyboard/planck_grid)

View file

@ -0,0 +1 @@
SRC += action_pseudo_lut.c

View file

@ -0,0 +1,142 @@
#include "quantum.h"
#include "action_pseudo_lut.h"
static uint8_t send_key_shift_bit[SHIFT_BIT_SIZE];
/*
* Pseudo layout action.
* This action converts a keycode in order to output the character according to the keymap you specified
* still your keyboard layout recognized wrongly on your OS.
* Memo: Using other layer keymap to get keycode
*/
void action_pseudo_lut(keyrecord_t *record, uint8_t base_keymap_id, const uint16_t (*keymap)[2]) {
static uint8_t prev_shift;
uint16_t keycode;
uint16_t pseudo_keycode;
/* get keycode from keymap you specified */
keycode = keymap_key_to_keycode(base_keymap_id, record->event.key);
prev_shift = keyboard_report->mods & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT));
if (record->event.pressed) {
/* when magic commands entered, keycode does not converted */
if (IS_COMMAND()) {
if (prev_shift) {
add_shift_bit(keycode);
}
register_code(keycode);
return;
}
if (prev_shift) {
pseudo_keycode = convert_keycode(keymap, keycode, true);
dprintf("pressed: %02X, converted: %04X\n", keycode, pseudo_keycode);
add_shift_bit(keycode);
if (IS_LSFT(pseudo_keycode)) {
register_code(QK_LSFT ^ pseudo_keycode);
} else {
/* delete shift mod temporarily */
del_mods(prev_shift);
send_keyboard_report();
register_code(pseudo_keycode);
add_mods(prev_shift);
send_keyboard_report();
}
} else {
pseudo_keycode = convert_keycode(keymap, keycode, false);
dprintf("pressed: %02X, converted: %04X\n", keycode, pseudo_keycode);
if (IS_LSFT(pseudo_keycode)) {
add_weak_mods(MOD_BIT(KC_LSFT));
send_keyboard_report();
register_code(QK_LSFT ^ pseudo_keycode);
/* on Windows, prevent key repeat to avoid unintended output */
unregister_code(QK_LSFT ^ pseudo_keycode);
del_weak_mods(MOD_BIT(KC_LSFT));
send_keyboard_report();
} else {
register_code(pseudo_keycode);
}
}
} else {
if (get_shift_bit(keycode)) {
del_shift_bit(keycode);
pseudo_keycode = convert_keycode(keymap, keycode, true);
} else {
pseudo_keycode = convert_keycode(keymap, keycode, false);
}
dprintf("released: %02X, converted: %04X\n", keycode, pseudo_keycode);
if (IS_LSFT(pseudo_keycode)) {
unregister_code(QK_LSFT ^ pseudo_keycode);
} else {
unregister_code(pseudo_keycode);
}
}
}
uint16_t convert_keycode(const uint16_t (*keymap)[2], uint16_t keycode, bool shift_modded)
{
uint16_t pseudo_keycode;
switch (keycode) {
case KC_A ... KC_CAPSLOCK:
#if defined(__AVR__)
if (shift_modded) {
pseudo_keycode = pgm_read_word(&keymap[keycode][1]);
} else {
pseudo_keycode = pgm_read_word(&keymap[keycode][0]);
}
#else
if (shift_modded) {
pseudo_keycode = keymap[keycode][1];
} else {
pseudo_keycode = keymap[keycode][0];
}
#endif
/* if undefined, use got keycode as it is */
if (pseudo_keycode == 0x00) {
if (shift_modded) {
pseudo_keycode = S(keycode);
} else {
pseudo_keycode = keycode;
}
}
break;
default:
if (shift_modded) {
pseudo_keycode = S(keycode);
} else {
pseudo_keycode = keycode;
}
break;
}
return pseudo_keycode;
}
uint8_t get_shift_bit(uint16_t keycode) {
if ((keycode >> 3) < SHIFT_BIT_SIZE) {
return send_key_shift_bit[keycode >> 3] & (1 << (keycode & 7));
} else {
dprintf("get_shift_bit: Can't get shift bit. keycode: %02X\n", keycode);
return 0;
}
}
void add_shift_bit(uint16_t keycode) {
if ((keycode >> 3) < SHIFT_BIT_SIZE) {
send_key_shift_bit[keycode >> 3] |= (1 << (keycode & 7));
} else {
dprintf("add_shift_bit: Can't add shift bit. keycode: %02X\n", keycode);
}
}
void del_shift_bit(uint16_t keycode) {
if ((keycode >> 3) < SHIFT_BIT_SIZE) {
send_key_shift_bit[keycode >> 3] &= ~(1 << (keycode & 7));
} else {
dprintf("del_shift_bit: Can't delete shift bit. keycode: %02X\n", keycode);
}
}

View file

@ -0,0 +1,15 @@
#ifndef ACTION_PSEUDO_LUT_H
#define ACTION_PSEUDO_LUT_H
#define SHIFT_BIT_SIZE (0xE7 / 8 + 1) // 1bit per 1key
#define IS_LSFT(kc) ((QK_LSFT & (kc)) == QK_LSFT)
void action_pseudo_lut(keyrecord_t *, uint8_t, const uint16_t (*)[2]);
uint16_t convert_keycode(const uint16_t (*)[2], uint16_t, bool);
uint8_t get_shift_bit(uint16_t);
void add_shift_bit(uint16_t);
void del_shift_bit(uint16_t);
#endif

View file

@ -0,0 +1,12 @@
#ifndef CONFIG_SHELA_H
#define CONFIG_SHELA_H
#include "../../config.h"
#undef TAPPING_TERM
#define TAPPING_TERM 230
#define ONESHOT_TAP_TOGGLE 2
#define ONESHOT_TIMEOUT 2000
#endif

View file

@ -0,0 +1,179 @@
/*
* HHKB Pro 2 US Layout for shela
*/
#include "hhkb.h"
#include "keymap_jis2us.h"
#include "action_pseudo_lut.h"
enum keymap_layout {
BASE = 0,
PSEUDO_US,
DVORAK,
MOUSE,
TENKEY,
HHKB,
SPACE_FN,
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Layer 0: Default Layer
* ,-----------------------------------------------------------------------------------------.
* | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | ` | BSp |
* |-----------------------------------------------------------------------------------------|
* | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ |
* |-----------------------------------------------------------------------------------------|
* | Control | A | S | D | F | G | H | J | K | L | ; | ' | Enter |
* |-----------------------------------------------------------------------------------------|
* | Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Fn0 |
* `-----------------------------------------------------------------------------------------'
* |LAlt | LGui | SpaceFN | RGui |RAlt |
* `-----------------------------------------------------------------'
*/
[BASE] =
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_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, \
OSM(MOD_LSFT),KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT,KC_FN0, \
KC_LALT,KC_LGUI, KC_FN2, KC_RGUI,KC_RALT),
/* Layer 1: Pseudo US Layout Layer */
[PSEUDO_US] =
KEYMAP(KC_ESC, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_BSPC, \
KC_TAB, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, \
KC_LCTL,KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_ENT, \
OSM(MOD_LSFT),KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_RSFT,KC_FN0, \
KC_LGUI,KC_FN3, KC_FN2, KC_FN4 ,KC_RGUI),
/* Layer 2: Dvorak Layer
* ,-----------------------------------------------------------------------------------------.
* | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | [ | ] | ` | BSp |
* |-----------------------------------------------------------------------------------------|
* | Tab | ' | , | . | P | Y | F | G | C | R | L | / | = | \ |
* |-----------------------------------------------------------------------------------------|
* | Control | A | O | E | U | I | D | H | T | N | S | - | Enter |
* |-----------------------------------------------------------------------------------------|
* | Shift | ; | Q | J | K | X | B | M | W | V | Z | Shift | Fn0 |
* `-----------------------------------------------------------------------------------------'
* |LAlt | LGui | SpaceFN | RGui |RAlt |
* `-----------------------------------------------------------------'
*/
[DVORAK] =
KEYMAP(KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC,KC_RBRC,KC_GRV, KC_BSPC, \
KC_TAB, KC_QUOT,KC_COMM,KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH,KC_EQL, KC_BSLS, \
KC_LCTL,KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS,KC_ENT, \
KC_LSFT,KC_SCLN,KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT,KC_FN0, \
KC_LALT,KC_LGUI, KC_FN2, KC_RGUI,KC_RALT),
/* Layer 3: Mouse layer
* ,-----------------------------------------------------------------------------------------.
* | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | |
* |-----------------------------------------------------------------------------------------|
* | | | | | | | MwL | MwD | MwU | MwR | | | | |
* |-----------------------------------------------------------------------------------------|
* | | | | | | | McL | McD | McU | McR | | | |
* |-----------------------------------------------------------------------------------------|
* | | | | | | | Mb1 | Mb2 | Mb3 | | | | Fn0 |
* `-----------------------------------------------------------------------------------------'
* | | | Mb1 | | |
* `-----------------------------------------------------------------'
*/
[MOUSE] =
KEYMAP(KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_TRNS, \
KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_WH_L,KC_WH_D,KC_WH_U,KC_WH_R,KC_NO, KC_NO, KC_NO, KC_NO, \
KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MS_L,KC_MS_D,KC_MS_U,KC_MS_R,KC_NO, KC_NO, KC_TRNS, \
KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_BTN1,KC_BTN2,KC_BTN3,KC_NO, KC_NO, KC_TRNS,KC_FN0, \
KC_TRNS,KC_TRNS, KC_BTN1, KC_TRNS,KC_TRNS),
/* Layer 4: Tenkey layer
* ,-----------------------------------------------------------------------------------------.
* | Esc | | | | | | | | | | / | * | - | | BSp |
* |-----------------------------------------------------------------------------------------|
* | | | | | | | | | | 7 | 8 | 9 | + | |
* |-----------------------------------------------------------------------------------------|
* | | | | | | | | | | 4 | 5 | 6 | Enter |
* |-----------------------------------------------------------------------------------------|
* | | | | | | | | | 1 | 2 | 3 | + | Fn0 |
* `-----------------------------------------------------------------------------------------'
* | | | SpaceFN | 0 | . |
* `-----------------------------------------------------------------'
*/
[TENKEY] =
KEYMAP(KC_ESC, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PSLS,KC_PAST,KC_PMNS,KC_NO, KC_BSPC, \
KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_KP_7,KC_KP_8,KC_KP_9,KC_PPLS,KC_NO, \
KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_KP_4,KC_KP_5,KC_KP_6,KC_PENT, \
KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_KP_1,KC_KP_2,KC_KP_3,KC_PPLS,KC_FN0, \
KC_TRNS,KC_TRNS, KC_FN2, KC_KP_0,KC_PDOT),
/* Layer 5: HHKB mode (HHKB Fn)
* ,-----------------------------------------------------------------------------------------.
* | Pwr | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del |
* |-----------------------------------------------------------------------------------------|
* | Caps | Fn5 | Fn6 | Fn7 | Fn8 | Fn9 | | | Psc | Slk | Pus | Up | | BSp |
* |-----------------------------------------------------------------------------------------|
* | | VoD | VoU | Mut | | | * | / | Hom | PgU | Lef | Rig | Enter |
* |-----------------------------------------------------------------------------------------|
* | | | | | | | + | - | End | PgD | Dow | | |
* `-----------------------------------------------------------------------------------------'
* | | | | | |
* `-----------------------------------------------------------------'
*/
[HHKB] =
KEYMAP(KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \
KC_CAPS,KC_FN5, KC_FN6, KC_FN7, KC_FN8, KC_FN9, KC_TRNS,KC_TRNS,KC_PSCR,KC_SLCK,KC_PAUS,KC_UP, KC_TRNS,KC_BSPC, \
KC_TRNS,KC_VOLD,KC_VOLU,KC_MUTE,KC_TRNS,KC_TRNS,KC_PAST,KC_PSLS,KC_HOME,KC_PGUP,KC_LEFT,KC_RGHT,KC_PENT, \
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PPLS,KC_PMNS,KC_END, KC_PGDN,KC_DOWN,KC_TRNS,KC_TRNS, \
KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS),
/* Layer 6: SpaceFN
* ,-----------------------------------------------------------------------------------------.
* | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | Del |
* |-----------------------------------------------------------------------------------------|
* | | End | Up | Hom | | | | Hom | Up | End | Psc | Slk | Pau | Ins |
* |-----------------------------------------------------------------------------------------|
* | | Lef | Dow | Rig | PgU | | PgU | Lef | Dow | Rig | | | |
* |-----------------------------------------------------------------------------------------|
* | | | | PgD | | Spc | PgD | ` | ~ | | | | |
* `-----------------------------------------------------------------------------------------'
* | | | | | |
* `-----------------------------------------------------------------'
*/
[SPACE_FN] =
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_NO, KC_DEL, \
KC_TRNS,KC_END, KC_UP, KC_HOME,KC_NO, KC_NO, KC_NO, KC_HOME,KC_UP, KC_END, KC_PSCR,KC_SLCK,KC_PAUS,KC_INS, \
KC_TRNS,KC_LEFT,KC_DOWN,KC_RGHT,KC_PGUP,KC_NO, KC_PGUP,KC_LEFT,KC_DOWN,KC_RGHT,KC_NO, KC_NO, KC_TRNS, \
KC_TRNS,KC_NO, KC_NO, KC_PGDN,KC_NO, KC_SPC, KC_PGDN,KC_GRV, KC_TILD,KC_NO, KC_NO, KC_TRNS,KC_NO, \
KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS),
};
/*
* user defined action function
*/
enum function_id {
PSEUDO_US_FUNCTION,
};
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
switch (id) {
case PSEUDO_US_FUNCTION:
action_pseudo_lut(record, BASE, keymap_jis2us);
break;
}
}
/*
* Fn action definition
*/
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(HHKB),
[1] = ACTION_FUNCTION(PSEUDO_US_FUNCTION),
[2] = ACTION_LAYER_TAP_KEY(SPACE_FN, KC_SPACE),
[3] = ACTION_MODS_TAP_KEY(MOD_LALT, KC_MHEN),
[4] = ACTION_MODS_TAP_KEY(MOD_RALT, KC_KANA),
[5] = ACTION_DEFAULT_LAYER_SET(BASE),
[6] = ACTION_DEFAULT_LAYER_SET(PSEUDO_US),
[7] = ACTION_DEFAULT_LAYER_SET(MOUSE),
[8] = ACTION_DEFAULT_LAYER_SET(TENKEY),
[9] = ACTION_DEFAULT_LAYER_SET(DVORAK),
};

View file

@ -0,0 +1,32 @@
#ifndef KEYMAP_JIS2US_H
#define KEYMAP_JIS2US_H
/* keymap for convert from JIS to US */
const uint16_t PROGMEM keymap_jis2us[][2] = {
[KC_A ... KC_CAPS] = { 0x00, 0x00 }, /* default value */
[KC_1] = { KC_1, KC_EXLM }, /* 1 and ! -> 1 and ! */
[KC_2] = { KC_2, KC_LBRC }, /* 2 and " -> 2 and @ */
[KC_3] = { KC_3, KC_HASH }, /* 3 and # -> 3 and # */
[KC_4] = { KC_4, KC_DLR }, /* 4 and $ -> 4 and $ */
[KC_5] = { KC_5, KC_PERC }, /* 5 and % -> 5 and % */
[KC_6] = { KC_6, KC_EQL }, /* 6 and & -> 6 and ^ */
[KC_7] = { KC_7, KC_CIRC }, /* 7 and ' -> 7 and & */
[KC_8] = { KC_8, KC_DQT }, /* 8 and ( -> 8 and * */
[KC_9] = { KC_9, KC_ASTR }, /* 9 and ) -> 9 and ( */
[KC_0] = { KC_0, KC_LPRN }, /* 0 and (no assign) -> 0 and ) */
[KC_MINS] = { KC_MINS, S(KC_RO) }, /* - and = -> - and _ */
[KC_EQL] = { KC_UNDS, KC_COLN }, /* ^ and ~ -> = and + */
[KC_LBRC] = { KC_RBRC, KC_RCBR }, /* @ and ` -> [ and { */
[KC_RBRC] = { KC_BSLS, KC_PIPE }, /* [ and { -> ] and } */
[KC_BSLS] = { KC_JYEN, S(KC_JYEN) }, /* ] and } -> / and | */
[KC_NUHS] = { KC_NUHS, S(KC_NUHS) }, /* (no assign) */
[KC_SCLN] = { KC_SCLN, KC_QUOT }, /* ; and + -> ; and : */
[KC_QUOT] = { KC_AMPR, KC_AT }, /* : and * -> ' and " */
[KC_GRV] = { KC_LCBR, KC_PLUS }, /* (no assign) -> ` and ~ */
[KC_COMM] = { KC_COMM, KC_LT }, /* , and < -> , and < */
[KC_DOT] = { KC_DOT, KC_GT }, /* . and > -> . and > */
[KC_SLSH] = { KC_SLSH, KC_QUES }, /* / and ? -> / and ? */
};
#endif

View file

@ -0,0 +1,14 @@
# Shela's HHKB Layout
Layer 0: US Layout
Layer 1: Pseudo US Layout
Layer 2: Dvorak Layout
Layer 3: Mouse
Layer 4: Tenkey
Layer 5: HHKB Fn Key
Layer 6: SpaceFN
## Pseudo US Layout
On japanese Windows, HHKB Professional 2 US layout model recognized wrongly as JIS layout without changing OS settings.
But, you can use HHKB like a US layout keyboard as it is.

View file

@ -0,0 +1,104 @@
#include "phantom.h"
#include "action_layer.h"
#include "eeconfig.h"
extern keymap_config_t keymap_config;
// 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 _QW 0
#define _DV 1
#define _CM 2
#define _FL 3
// Macro name shortcuts
#define QWERTY M(_QW)
#define DVORAK M(_DV)
#define COLEMAK M(_CM)
// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QW] = { /* Layer 0: Qwerty */
{KC_ESC, 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_PSCR, KC_SLCK, KC_PAUS},
{KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, XXXXXXX, KC_BSPC, KC_INS, KC_HOME, 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_DEL, KC_END, 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, XXXXXXX, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX},
{KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, XXXXXXX, KC_RSFT, XXXXXXX, KC_UP, XXXXXXX},
{KC_LCTL, KC_LGUI, KC_LALT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, XXXXXXX, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT}
},
[_DV] = { /* Layer 1: Dvorak */
{KC_ESC, 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_PSCR, KC_SLCK, KC_PAUS},
{KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, XXXXXXX, KC_BSPC, KC_INS, KC_HOME, KC_PGUP},
{KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, KC_DEL, KC_END, KC_PGDN},
{KC_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, XXXXXXX, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX},
{KC_LSFT, XXXXXXX, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, XXXXXXX, KC_RSFT, XXXXXXX, KC_UP, XXXXXXX},
{KC_LCTL, KC_LGUI, KC_LALT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, XXXXXXX, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT}
},
[_CM] = { /* Layer 2: Colemak */
{KC_ESC, 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_PSCR, KC_SLCK, KC_PAUS},
{KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, XXXXXXX, KC_BSPC, KC_INS, KC_HOME, KC_PGUP},
{KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN},
{KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, XXXXXXX, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX},
{KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, XXXXXXX, KC_RSFT, XXXXXXX, KC_UP, XXXXXXX},
{KC_LCTL, KC_LGUI, KC_LALT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, XXXXXXX, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT}
},
[_FL] = { /* Layer 3: Functions */
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, RESET, KC_MPRV, KC_MPLY, KC_MNXT},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX},
{_______, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, _______, XXXXXXX, _______, XXXXXXX},
{QWERTY, DVORAK, COLEMAK, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, _______, _______},
},
};
enum function_id {
SHIFT_ESC,
};
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 _DV:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_DV);
}
break;
case _QW:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_QW);
}
break;
case _CM:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_CM);
}
break;
}
return MACRO_NONE;
};

View file

@ -71,7 +71,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |-----------------------------------------------------------------------------------. * |-----------------------------------------------------------------------------------.
* | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | * | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------| * |------+------+------+------+------+-------------+------+------+------+------+------|
* | | ~ | | | + | [ | { | } | ] | = | \ | ` | | * | | ~ | ` | + | = | | | \ | [ | ] | { | } | |
* |------+------+------+------+------+------+------+------+------+------+------+------| * |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | | | * | | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------'
@ -79,7 +79,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_SYMB] = { [_SYMB] = {
{KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_ESC }, {KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_ESC },
{KC_DEL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL }, {KC_DEL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL },
{_______, KC_TILD, KC_PIPE, KC_PLUS, KC_LBRC, KC_LCBR, KC_RCBR, KC_RBRC, KC_EQL, KC_BSLS, KC_GRV, _______}, {_______, KC_TILD, KC_GRV, KC_PLUS, KC_EQL, KC_PIPE, KC_BSLS, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
}, },

View file

@ -31,9 +31,9 @@ On *macOS* I recommend using [Karabiner](https://pqrs.org/osx/karabiner/) and ti
None of the modifiers are overwritten so that `shift-alt-arrows` etc work as expected. None of the modifiers are overwritten so that `shift-alt-arrows` etc work as expected.
## The `SYMB` layer ## The `SYMB` layer
![](http://i.imgur.com/iuU144Y.png) ![](http://i.imgur.com/thh1ne2.png)
The symbol layer has all the numbers and their usual corresponding symbols in the first two rows, with the symbols on the home row since I use them more frequently than the numbers. The third row contains all the remaining symbols, with brackets in the centre; then normally shifted symbols to the left, and non shifted to the right, in order of most to least used. The symbol layer has all the numbers and their usual corresponding symbols in the first two rows, with the symbols on the home row since I use them more frequently than the numbers. The third row contains all the remaining symbols, arranged roughly so that the most used symbols are accessible with the strongest fingers.
`esc` and `del` are repeated here since I wanted to be able to reach either, one handed, with either hand. `esc` and `del` are repeated here since I wanted to be able to reach either, one handed, with either hand.

View file

@ -0,0 +1,25 @@
# Build Options
# change to "no" to disable the options, or define them in the makefile.mk in
# the appropriate keymap folder that will get included automatically
#
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = no # 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.
TAP_DANCE_ENABLE = yes # Enables the double-tap functionality of keys
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

View file

@ -0,0 +1,44 @@
##Design goals:
1. Arrow keys always available.
2. As close to a to my US layout 107-key QWERTY keyboard as I could manage, (i.e. as few arbitrary decisions as possible).
3. Togglable DVORAK keyboard.
4. most frequently used things in the easiest to reach places.
5. Ability to game on it, just for fun.
My layout differs from most in the placement the ARROW keys, `ESC`, VOL keys, use of double-tap `CAPS`, and the GAME LOCK function.
I put the layer buttons in the usual spots. I originally wanted only function/symbols layer, but that proved detrimental. I use some timed press actions to save some space, but this has been accounted for, (see GAME LOCK below). I'm not fully satisfied with the current product (see NOTES below), so it may change in the future.
##Effective layers:
* Default later is obviously your letters and modifiers.
* Lower layer [NUMBER] is your numbers and punctuation.
* Upper layer [ACTION] is your symbols and actions.
* Function layer is the infrequently used function keys, layout toggle, game lock, and reset.
There is also a toggle for the DVORAK/QWERTY layers, but in normal typing this is not of concern.
###Special keys:
* `RSHFT` and `ENTER` are combined. Tap once for `ENTER` and hold for `RSHFT`. `ENTER` will be registered on release if released within 200 ms, else `RSHFT` is registered starting at 201 ms until release.
* If for some reason, this interferes with the normal usage of the `ENTER` key in any way, (some problem that may never happen), I have added a regular non-modified `ENTER` key on the same key in the [ACTION] layer.
* `LSHFT` and `CAPS` are also combined. The key works like a normal `LSHFT` unless double-tapped, in which case it counts as `CAPS`. This functionality unfortunately delays all key presses by at most 200 ms, but I have added ways to disable this both temporarily or permanently, described below.
* A failsafe `CAPS` key is on the same key in the [ACTION] layer.
* There are `UNDO`, `CUT`, `COPY`, and `PASTE` keys. This was intended to be a universal way to use these commands since in macOS cut is `⌘ + C` but in Windows it is `⌃ + C`. Unfortunately these special keys only work in Windows. ¯\\\_(ツ)\_/¯
##Game lock:
**TL;DR** the game lock toggle disables the double-tap `CAPS`, and disables `GUI` keys (WINDOWS key).
I wished for this keyboard to be fully usable in the most demanding of games. The most demanding game I know of is ARMA 3 which has a binding to practically every individual key of a 107-key keyboard. This means I need to have pretty much every key possible somewhere. I also wanted the keyboard to be responsive in games for every critical keypress. This means having a way to disable features that introduce an inherent delay to registering keys, such as double-tap.
I do not expect to see this used by the pros, but I enjoyed making it. As for use in ARMA 3, I got a little ways into the APEX campaign, but I found a few flaws. For Example, I cannot enable my HUD GPS since that requires `RCTRL`+`M` but `RCTRL` is not bound. The obvious fix is to rebind the action to a new key, but I still take this as a shortcoming of my layout.
###If you wish to disable double-tap
####Disable it temporarily
Turn on the game lock. While on, it registers as normal `LSHFT` and has no delay. Whether in game mode or not, `CAPS` is on the same key in the [ACTION] layer.
####Disable it permanently
Open the `Makefile` and set `TAP_DANCE_ENABLE = no`. I wrote the layout to compensate for this change, and no further changes to the code should be necessary. Whether or not it's disabled, `CAPS` is on the same key in the [ACTION] layer.
##Notes:
* `ALT` and `GUI` are reversed compared to the normal US layout. I will also be using my Planck on my mac, and that's the standard in the Apple ecosystem. I may add a special compiler flag in the future to swap the two.
* The DVORAK `Z` key is to the right of the `S` key instead of under it as part of a compromise I made to keep the ARROW keys available on the default layer. I prioritize the ARROW keys, so the DVORAK layout is the one to suffer.
* I also support the little tones that the default Planck layout features, identical to them too, (minus those for layouts I don't support). To enable it, open the `Makefile` and set `AUDIO_ENABLE = yes`.

View file

@ -0,0 +1,91 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONFIG_H
#define CONFIG_H
#include "config_common.h"
/* Tap-dance interval definition */
#define TAPPING_TERM 200
/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x6060
#define MANUFACTURER Ortholinear Keyboards
#define PRODUCT The Planck Keyboard
#define DESCRIPTION A compact ortholinear keyboard
/* key matrix size */
#define MATRIX_ROWS 4
#define MATRIX_COLS 12
/* Planck PCB default pin-out */
#define MATRIX_ROW_PINS { D0, D5, B5, B6 }
#define MATRIX_COL_PINS { F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 }
#define UNUSED_PINS
#define BACKLIGHT_PIN B7
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
/* number of backlight levels */
#define BACKLIGHT_LEVELS 3
/* Set 0 if debouncing isn't needed */
#define DEBOUNCING_DELAY 5
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE
/* key combination for command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
/*
* 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
#ifdef SUBPROJECT_rev3
#include "rev3/config.h"
#endif
#ifdef SUBPROJECT_rev4
#include "rev4/config.h"
#endif
#endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

View file

@ -0,0 +1,258 @@
// Layout picture at http://www.keyboard-layout-editor.com/#/gists/125febfad6960add078e6f14256539b6
#include "planck.h"
#include "action_layer.h"
#ifdef AUDIO_ENABLE
#include "audio.h"
#endif
#include "eeconfig.h"
extern keymap_config_t keymap_config;
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _QWERTY 0
#define _DVORAK 1
#define _LOCKED 2
#define _NUMBER 3
#define _ACTION 4
#define _FUNCTN 5
enum planck_keycodes {
QWERTY = SAFE_RANGE,
DVORAK,
NUMBER,
ACTION
};
// Key code names
#define SFT_ENT FUNC(0) // Tap for enter, hold for right shift
#define LOCK FUNC(1)
#define KC_PSTE KC_PASTE
#define _______ KC_TRNS
#define XXXXXXX KC_NO
#ifdef TAP_DANCE_ENABLE
#define SFT_CAP TD(0) // Left shift, double tap for caps
#endif
#ifndef TAP_DANCE_ENABLE
#define SFT_CAP KC_LSFT // Regular left shift
#endif
// Tap Dance Definitions
#ifdef TAP_DANCE_ENABLE
const qk_tap_dance_action_t tap_dance_actions[] = {
[0] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS)
};
#endif
// Function definitions
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT),
[1] = ACTION_LAYER_TOGGLE(_LOCKED)
};
// Layout definitions
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* QWERTY
* ,-----------------------------------------------------------------------------------.
* | Esc | Q | W | E | R | T | Y | U | I | O | P | BKSP |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Tab | A | S | D | F | G | H | J | K | L | ; | ' |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* |*Shift| Z | X | C | V | B | N | M | , | . | Up |SftEnt|
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Ctrl | Alt | Cmd | Vol- | ACTN | Space | NUMS | Vol+ | Left | Down | Left |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = {
{KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
{KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
{SFT_CAP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, SFT_ENT},
{KC_LCTL, KC_LALT, KC_LGUI, KC_VOLD, ACTION, KC_SPC, KC_SPC, NUMBER, KC_VOLU, KC_LEFT, KC_DOWN, KC_RGHT}
},
/* DVORAK
* ,-----------------------------------------------------------------------------------.
* | | ' | , | . | P | Y | F | G | C | R | L | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | A | O | E | U | I | D | H | T | N | S | Z |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | ; | Q | J | K | X | B | M | W | V | | |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_DVORAK] = {
{_______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______},
{_______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_Z },
{_______, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
},
/* LOCK
* ,-----------------------------------------------------------------------------------.
* | | | | | | | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Shift| | | | | | | | | | | |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | NULL | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_LOCKED] = {
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______}
},
/* NUMBERS
* ,-----------------------------------------------------------------------------------.
* | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | ~ | NULL | NULL | NULL | | | _ | + | { | } | ? | / |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | ` | NULL | NULL | NULL | \ | - | = | [ | ] | | |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | | | | NULL | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_NUMBER] = {
{_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______},
{_______, KC_TILD, XXXXXXX, XXXXXXX, XXXXXXX, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_QUES, KC_SLSH},
{_______, KC_GRV, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSLS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, _______},
{_______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______}
},
/* ACTIONS
* ,-----------------------------------------------------------------------------------.
* | | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | CAPS | Undo | Cut | Copy | Paste| NULL | NULL | NULL | NULL | NULL | PgUp | Enter|
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | | Mute | | NULL | | NULL | Home | PgDn | End |
* `-----------------------------------------------------------------------------------'
*/
[_ACTION] = {
{_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL },
{_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX},
{KC_CAPS, KC_UNDO, KC_CUT, KC_COPY, KC_PSTE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGUP, KC_ENT },
{_______, _______, _______, KC_MUTE, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_HOME, KC_PGDN, KC_END }
},
/* FUNCTIONS
* ,-----------------------------------------------------------------------------------.
* | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | F21 | F22 | F23 | F24 |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | NULL | NULL | NULL | NULL | NULL |QWERTY|DVORAK| NULL | NULL | NULL | NULL | NULL |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Reset| NULL | Lock | NULL | | NULL | | NULL | NULL | NULL | NULL |
* `-----------------------------------------------------------------------------------'
*/
[_FUNCTN] = {
{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_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24 },
{XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, QWERTY, DVORAK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX},
{RESET, XXXXXXX, LOCK, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}
}
};
#ifdef AUDIO_ENABLE
float tone_startup[][2] = SONG(STARTUP_SOUND);
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
float tone_dvorak[][2] = SONG(DVORAK_SOUND);
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
#endif
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
if (IS_LAYER_ON(_DVORAK)) {
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif
layer_off(_DVORAK);
}
}
return false;
break;
case DVORAK:
if (record->event.pressed) {
if (!IS_LAYER_ON(_DVORAK)) {
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
#endif
layer_on(_DVORAK);
}
}
return false;
break;
case NUMBER:
if (record->event.pressed) {
layer_on(_NUMBER);
update_tri_layer(_NUMBER, _ACTION, _FUNCTN);
} else {
layer_off(_NUMBER);
update_tri_layer(_NUMBER, _ACTION, _FUNCTN);
}
return false;
break;
case ACTION:
if (record->event.pressed) {
layer_on(_ACTION);
update_tri_layer(_NUMBER, _ACTION, _FUNCTN);
} else {
layer_off(_ACTION);
update_tri_layer(_NUMBER, _ACTION, _FUNCTN);
}
return false;
break;
}
return true;
}
void matrix_init_user(void) {
#ifdef AUDIO_ENABLE
startup_user();
#endif
}
#ifdef AUDIO_ENABLE
void startup_user()
{
_delay_ms(20); // gets rid of tick
PLAY_NOTE_ARRAY(tone_startup, false, 0);
}
void shutdown_user()
{
PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
_delay_ms(150);
stop_all_notes();
}
void music_on_user(void)
{
music_scale_user();
}
void music_scale_user(void)
{
PLAY_NOTE_ARRAY(music_scale, false, 0);
}
#endif

View file

@ -21,9 +21,10 @@ extern keymap_config_t keymap_config;
#define _RAISE 4 #define _RAISE 4
#define _PLOVER 5 #define _PLOVER 5
#define _TOUCHCURSOR 6 #define _TOUCHCURSOR 6
#define _MOUSE 7 #define _MOUSECURSOR 7
#define _ADJUST 16 #define _ADJUST 16
// Keycodes
enum planck_keycodes { enum planck_keycodes {
QWERTY = SAFE_RANGE, QWERTY = SAFE_RANGE,
COLEMAK, COLEMAK,
@ -35,24 +36,60 @@ enum planck_keycodes {
EXT_PLV EXT_PLV
}; };
enum macro_keycodes {
KC_ALT_TAB,
KC_CMD_TAB,
KC_CTL_TAB,
KC_CMD_SLSH,
KC_AG_FIND,
KC_AG_AGAIN,
KC_AG_UNDO,
KC_AG_CUT,
KC_AG_COPY,
KC_AG_PASTE,
KC_AG_DESK_L,
KC_AG_DESK_R,
KC_AG_TAB_C,
KC_AG_TAB_N,
KC_AG_TAB_R,
};
// Fillers to make layering more clear // Fillers to make layering more clear
#define _______ KC_TRNS #define _______ KC_TRNS
#define XXXXXXX KC_NO #define XXXXXXX KC_NO
// Custom macros // Custom macros
#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl #define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl
#define LT_TC LT(_TOUCHCURSOR, KC_SPC) // L-ayer T-ap T-ouch C-ursor
// ^-- Requires KC_TRNS / _______ for the trigger key in the destination layer
#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift #define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift
#define LT_ML LT(_MOUSE, KC_A) // L-ayer T-ap M-ouse C-ursor (on A) #define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper
#define GUI_SEM GUI_T(KC_SCLN) // Tap for Semicolon, hold for GUI
#define ALT_QUO ALT_T(KC_QUOT) // Tap for Quote, hold for Alt
// Requires KC_TRNS/_______ for the trigger key in the destination layer
#define LT_TC LT(_TOUCHCURSOR, KC_SPC) // L-ayer T-ap T-ouch C-ursor
#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor
#define ALT_TAB M(KC_ALT_TAB) // Macro for Alt-Tab
#define CMD_TAB M(KC_CMD_TAB) // Macro for Cmd-Tab
#define CTL_TAB M(KC_CTL_TAB) // Macro for Ctl-Tab
#define CMD_SLSH M(KC_CMD_SLSH) // Macro for Cmd-Slash (personal shortcut to toggle iTerm2 visibility)
#define AG_FIND M(KC_AG_FIND) // Macros for Cmd-[x] vs Ctrl-[x] based on current AG_NORM or AG_SWAP settings
#define AG_AGAIN M(KC_AG_AGAIN)
#define AG_UNDO M(KC_AG_UNDO)
#define AG_CUT M(KC_AG_CUT)
#define AG_COPY M(KC_AG_COPY)
#define AG_PASTE M(KC_AG_PASTE)
#define AG_D_L M(KC_AG_DESK_L) // For Virtual Desktop Switching: Left, and
#define AG_D_R M(KC_AG_DESK_R) // Right
#define AG_T_C M(KC_AG_TAB_C) // For Chrome, etc. Tab Close,
#define AG_T_N M(KC_AG_TAB_N) // Tab New, and
#define AG_T_R M(KC_AG_TAB_R) // Tab Reopen Closed
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty /* Qwerty
* ,-----------------------------------------------------------------------------------------. * ,-----------------------------------------------------------------------------------------.
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | * | Hyper/Tab| Q | W | E | R | T | Y | U | I | O | P | Bksp |
* |----------+------+------+------+------+-------------+------+------+------+------+--------| * |----------+------+------+------+------+-------------+------+------+------+------+--------|
* | Ctrl/Esc | ML/A | S | D | F | G | H | J | K | L | ; | " | * | Ctrl/Esc | A | S | MC/D | F | G | H | J | K | L |GUI/; | Alt/" |
* |----------+------+------+------+------+------|------+------+------+------+------+--------| * |----------+------+------+------+------+------|------+------+------+------+------+--------|
* | Shift | Z | X | C | V | B | N | M | , | . | / |Sft/Ent | * | Shift | Z | X | C | V | B | N | M | , | . | / |Sft/Ent |
* |----------+------+------+------+------+------+------+------+------+------+------+--------| * |----------+------+------+------+------+------+------+------+------+------+------+--------|
@ -60,17 +97,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----------------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------------'
*/ */
[_QWERTY] = { [_QWERTY] = {
{KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, {HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
{CTL_ESC, LT_ML, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, {CTL_ESC, KC_A, KC_S, LT_MC(KC_D),KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, GUI_SEM, ALT_QUO},
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT},
{KC_PSCR, KC_RGUI, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} {KC_PSCR, KC_RGUI, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
}, },
/* Colemak /* Colemak
* ,-----------------------------------------------------------------------------------------. * ,-----------------------------------------------------------------------------------------.
* | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | * | Hyper/Tab| Q | W | F | P | G | J | L | U | Y | ; | Bksp |
* |----------+------+------+------+------+-------------+------+------+------+------+--------| * |----------+------+------+------+------+-------------+------+------+------+------+--------|
* | Ctrl/Esc | ML/A | R | S | T | D | H | N | E | I | O | " | * | Ctrl/Esc | A | R | MC/S | T | D | H | N | E | I | O | " |
* |----------+------+------+------+------+------|------+------+------+------+------+--------| * |----------+------+------+------+------+------|------+------+------+------+------+--------|
* | Shift | Z | X | C | V | B | K | M | , | . | / |Sft/Ent | * | Shift | Z | X | C | V | B | K | M | , | . | / |Sft/Ent |
* |----------+------+------+------+------+------+------+------+------+------+------+--------| * |----------+------+------+------+------+------+------+------+------+------+------+--------|
@ -78,17 +115,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----------------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------------'
*/ */
[_COLEMAK] = { [_COLEMAK] = {
{KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, {HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC},
{CTL_ESC, LT_ML, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, {CTL_ESC, KC_A, KC_R, LT_MC(KC_S),KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT},
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT},
{KC_PSCR, KC_RGUI, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} {KC_PSCR, KC_RGUI, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
}, },
/* Dvorak /* Dvorak
* ,-----------------------------------------------------------------------------------------. * ,-----------------------------------------------------------------------------------------.
* | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | * | Hyper/Tab| " | , | . | P | Y | F | G | C | R | L | Bksp |
* |----------+------+------+------+------+-------------+------+------+------+------+--------| * |----------+------+------+------+------+-------------+------+------+------+------+--------|
* | Ctrl/Esc | ML/A | O | E | U | I | D | H | T | N | S | / | * | Ctrl/Esc | A | O | MC/E | U | I | D | H | T | N | S | / |
* |----------+------+------+------+------+------|------+------+------+------+------+--------| * |----------+------+------+------+------+------|------+------+------+------+------+--------|
* | Shift | ; | Q | J | K | X | B | M | W | V | Z |Sft/Ent | * | Shift | ; | Q | J | K | X | B | M | W | V | Z |Sft/Ent |
* |----------+------+------+------+------+------+------+------+------+------+------+--------| * |----------+------+------+------+------+------+------+------+------+------+------+--------|
@ -96,8 +133,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----------------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------------'
*/ */
[_DVORAK] = { [_DVORAK] = {
{KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, {HPR_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC},
{CTL_ESC, LT_ML, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, {CTL_ESC, KC_A, KC_O, LT_MC(KC_E),KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH},
{KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT}, {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT},
{KC_PSCR, KC_RGUI, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} {KC_PSCR, KC_RGUI, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
}, },
@ -124,27 +161,27 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* ,-----------------------------------------------------------------------------------. * ,-----------------------------------------------------------------------------------.
* | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------| * |------+------+------+------+------+-------------+------+------+------+------+------|
* | $ | 4 | 5 | 6 | . | + | * | 4 | 5 | 6 | - | | | * | $ | 4 | 5 | 6 | . | + | . | 4 | 5 | 6 | * | | |
* |------+------+------+------+------+------|------+------+------+------+------+------| * |------+------+------+------+------+------|------+------+------+------+------+------|
* | = | 7 | 8 | 9 | 0 | - | / | 1 | 2 | 3 | . | \ | * | = | 7 | 8 | 9 | 0 | - | . | 1 | 2 | 3 | / | \ |
* |------+------+------+------+------+------+------+------+------+------+------+------| * |------+------+------+------+------+------+------+------+------+------+------+------|
* |Brite | | | | | | | Prev | Stop | Slct | Mute | * |Brite | | | | | | | Prev | Stop | Slct | Mute |
* `-----------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------'
*/ */
[_RAISE] = { [_RAISE] = {
{KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, {KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
{KC_DLR, KC_4, KC_5, KC_6, KC_DOT, KC_PLUS, KC_ASTR, KC_4, KC_5, KC_6, KC_MINS, KC_PIPE}, {KC_DLR, KC_4, KC_5, KC_6, KC_DOT, KC_PLUS, KC_DOT, KC_4, KC_5, KC_6, KC_ASTR, KC_PIPE},
{KC_EQL, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_SLSH, KC_1, KC_2, KC_3, KC_DOT, KC_BSLS}, {KC_EQL, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_DOT, KC_1, KC_2, KC_3, KC_SLSH, KC_BSLS},
{BACKLIT, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MSTP, KC_MSEL, KC_MUTE} {BACKLIT, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MSTP, KC_MSEL, KC_MUTE}
}, },
/* TouchCursor layer (http://martin-stone.github.io/touchcursor/) plus personal customizations /* TouchCursor layer (http://martin-stone.github.io/touchcursor/) plus personal customizations
* ,-----------------------------------------------------------------------------------. * ,-----------------------------------------------------------------------------------.
* | | | |Shift | GUI | ~ |Insert| Home | Up | End | Bksp | | * |AltTab|CmdTab|CtlTab| GUI |Shift | ~ |Insert| Home | Up | End | Bksp | |
* |------+------+------+------+------+-------------+------+------+------+------+------| * |------+------+------+------+------+-------------+------+------+------+------+------|
* | | Alt |Space | | Find |Again | PgUp | Left | Down |Right | | | * | | Alt |Space |Tab_C | Find |Again | PgUp | Left | Down |Right |Desk_L|Desk_R|
* |------+------+------+------+------+------|------+------+------+------+------+------| * |------+------+------+------+------+------|------+------+------+------+------+------|
* | | Undo | Cut | Copy |Paste | ` | PgDn | Del | | | | | * | | Undo | Cut | Copy |Paste | ` | PgDn | Del |Tab_N |Tab_R |iTerm2| |
* |------+------+------+------+------+------+------+------+------+------+------+------| * |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | | * | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------'
@ -154,28 +191,28 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/ */
[_TOUCHCURSOR] = { [_TOUCHCURSOR] = {
{_______, _______, _______, KC_LSFT, KC_LGUI, KC_TILD, KC_INS, KC_HOME, KC_UP, KC_END, KC_BSPC, _______}, {ALT_TAB, CMD_TAB, CTL_TAB, KC_LGUI, KC_LSFT, KC_TILD, KC_INS, KC_HOME, KC_UP, KC_END, KC_BSPC, _______},
{_______, KC_LALT, KC_SPC, _______, KC_FIND,KC_AGAIN, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______}, {_______, KC_LALT, KC_SPC, AG_T_C, AG_FIND,AG_AGAIN, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, AG_D_L, AG_D_R },
{_______, KC_UNDO, KC_CUT, KC_COPY, KC_PASTE,KC_GRV, KC_PGDN, KC_DEL, _______, _______, _______, _______}, {_______, AG_UNDO, AG_CUT, AG_COPY, AG_PASTE,KC_GRV, KC_PGDN, KC_DEL, AG_T_N, AG_T_R, CMD_SLSH,_______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
}, },
/* Mouse Layer /* Mouse Layer
* ,-----------------------------------------------------------------------------------. * ,-----------------------------------------------------------------------------------.
* | | |ACCL0 |ACCL1 |ACCL2 |ACCL2 | |WHL_L | Up |WHL_R | BTN2 | | * | | |ACCL0 | | | | |WHL_L | Up |WHL_R | BTN2 | |
* |------+------+------+------+------+-------------+------+------+------+------+------| * |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | | BTN3 | BTN1 | BTN4 |WHL_Up| Left | Down |Right | | | * | |ACCL2 | BTN2 | | BTN1 |ACCL1 |WHL_Up| Left | Down |Right | BTN4 | BTN5 |
* |------+------+------+------+------+------|------+------+------+------+------+------| * |------+------+------+------+------+------|------+------+------+------+------+------|
* | | | | | BTN2 | BTN5 |WHL_Dn| BTN1 | | | | | * | | | | | BTN3 | |WHL_Dn| BTN1 | | | BTN3 | |
* |------+------+------+------+------+------+------+------+------+------+------+------| * |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | | * | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------'
*/ */
[_MOUSE] = { [_MOUSECURSOR] = {
{_______, _______, KC_ACL0, KC_ACL1, KC_ACL2, KC_ACL2, _______, KC_WH_L, KC_MS_U, KC_WH_R, KC_BTN2, _______}, {_______, _______, KC_ACL0, _______, _______, _______, _______, KC_WH_L, KC_MS_U, KC_WH_R, KC_BTN2, _______},
{_______, _______, _______, KC_BTN3, KC_BTN1, KC_BTN4, KC_WH_U, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______}, {_______, KC_ACL2, KC_BTN2, _______, KC_BTN1, KC_ACL1, KC_WH_U, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN4, KC_BTN5},
{_______, _______, _______, _______, KC_BTN2, KC_BTN5, KC_WH_D, KC_BTN1, _______, _______, _______, _______}, {_______, _______, _______, _______, KC_BTN3, _______, KC_WH_D, KC_BTN1, _______, _______, KC_BTN3, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
}, },
@ -330,6 +367,64 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true; return true;
} }
/*
* Macro definition
*/
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
if (!eeconfig_is_enabled()) {
eeconfig_init();
}
bool use_cmd = true; // Use, for example, Cmd-Tab, Cmd-C, Cmd-V, etc.
// Compare to MAGIC_SWAP_ALT_GUI and MAGIC_UNSWAP_ALT_GUI configs, set in:
// quantum/quantum.c
if(keymap_config.swap_lalt_lgui == 1 && keymap_config.swap_ralt_rgui == 1) {
use_cmd = false; // ... or, Alt-Tab, Ctrl-C, Ctrl-V, etc.
}
switch (id) {
case KC_ALT_TAB:
if(use_cmd) { return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); }
else { return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); }
case KC_CMD_TAB:
if(use_cmd) { return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); }
else { return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); }
case KC_CTL_TAB:
return (record->event.pressed ? MACRO( D(LCTRL), D(TAB), END ) : MACRO( U(TAB), END ));
case KC_CMD_SLSH:
return (record->event.pressed ? MACRO( D(LGUI), D(SLSH),END ) : MACRO( U(SLSH),END ));
case KC_AG_FIND:
return use_cmd ? MACRODOWN( D(LGUI), T(F), END ) : MACRODOWN( D(LCTRL), T(F), END );
case KC_AG_AGAIN:
return use_cmd ? MACRODOWN( D(LGUI), T(G), END ) : MACRODOWN( D(LCTRL), T(G), END );
case KC_AG_UNDO:
return use_cmd ? MACRODOWN( D(LGUI), T(Z), END ) : MACRODOWN( D(LCTRL), T(Z), END );
case KC_AG_CUT:
return use_cmd ? MACRODOWN( D(LGUI), T(X), END ) : MACRODOWN( D(LCTRL), T(X), END );
case KC_AG_COPY:
return use_cmd ? MACRODOWN( D(LGUI), T(C), END ) : MACRODOWN( D(LCTRL), T(C), END );
case KC_AG_PASTE:
return use_cmd ? MACRODOWN( D(LGUI), T(V), END ) : MACRODOWN( D(LCTRL), T(V), END );
case KC_AG_DESK_L:
return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(SCLN), END ) : MACRODOWN( D(LALT), D(LCTRL), T(SCLN), END );
case KC_AG_DESK_R:
return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(QUOT), END ) : MACRODOWN( D(LALT), D(LCTRL), T(QUOT), END );
case KC_AG_TAB_C:
return use_cmd ? MACRODOWN( D(LGUI), T(W), END ) : MACRODOWN( D(LCTRL), T(W), END );
case KC_AG_TAB_N:
return use_cmd ? MACRODOWN( D(LGUI), T(T), END ) : MACRODOWN( D(LCTRL), T(T), END );
case KC_AG_TAB_R:
return use_cmd ? MACRODOWN( D(LGUI), D(LSHIFT), T(T), END ) : MACRODOWN( D(LCTRL), D(LSHIFT), T(T), END );
}
return MACRO_NONE;
}
void matrix_init_user(void) { void matrix_init_user(void) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
startup_user(); startup_user();

View file

@ -7,23 +7,34 @@ the exact changes. The diagrams in this README shows the highlights of the
changes from the default mappings. changes from the default mappings.
I also decided to change all calls to `persistant_default_layer_set()` to I also decided to change all calls to `persistant_default_layer_set()` to
`update_tri_layer()` since this is my personal perference. `default_layer_set()` since this is my personal perference.
## Macros
```
#define ALT_TAB M(KC_ALT_TAB)
```
## Base Layers (Qwerty/Colemak/Dvorak) ## Base Layers (Qwerty/Colemak/Dvorak)
These base layers are mostly the same as the default mappings. The interesting These base layers are mostly the same as the default mappings. The interesting
changes are shown below. The `Ctrl/Esc`, mapped using `CTL_T(KC_ESC)` will emit changes are shown below.
an `Escape` when tapped, and act as a `Control` key when held. A `TODO` item is
to see if it can also act as a `CapsLock` when double-tapped. The right shift - The `Ctrl/Esc`, will emit an `Escape` when tapped, and act as a `Control` key when held,
key acts as `Enter` when tapped, and as a `Shift` key when held. The arrow - `GUI/;` as `;` and `GUI`,
keys, which have been moved to the - `Alt/"` as `"` and `Alt`,
- `Sft/Ent` as `Enter` and `Shift`, and
- `Hyper/Tab` as `Tab` and `Hyper`
A `TODO` item is to see if it can also act as a `CapsLock` when double-tapped.
The arrow keys, which have been moved to the
[TouchCursor](http://martin-stone.github.io/touchcursor/) layer, have been [TouchCursor](http://martin-stone.github.io/touchcursor/) layer, have been
replaced with the Media keys as shown. The `ML/A` key activates the Mouse layer replaced with the Media keys as shown. The `MC/kc` key activates the
when held, and emits an `A` when tapped. `MouseCursor` layer when held, and emits the corresponding `kc` for its layer,
when tapped.
``` ```
,-----------------------------------------------------------------------------------------. ,-----------------------------------------------------------------------------------------.
| | | | | | | | | | | | | | Hyper/Tab| | | | | | | | | | | |
|----------+------+------+------+------+-------------+------+------+------+------+--------| |----------+------+------+------+------+-------------+------+------+------+------+--------|
| Ctrl/Esc | ML/A | | | | | | | | | | | | Ctrl/Esc | | |MC/kc | | | | | | |GUI/; | Alt/" |
|----------+------+------+------+------+------|------+------+------+------+------+--------| |----------+------+------+------+------+------|------+------+------+------+------+--------|
| | | | | | | | | | | |Sft/Ent | | | | | | | | | | | | |Sft/Ent |
|----------+------+------+------+------+------+------+------+------+------+------+--------| |----------+------+------+------+------+------+------+------+------+------+------+--------|
@ -56,9 +67,9 @@ keys at the far left are for quick access to beginning and end of line in vim.
,-----------------------------------------------------------------------------------. ,-----------------------------------------------------------------------------------.
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
|------+------+------+------+------+-------------+------+------+------+------+------| |------+------+------+------+------+-------------+------+------+------+------+------|
| $ | 4 | 5 | 6 | . | + | * | 4 | 5 | 6 | - | | | | $ | 4 | 5 | 6 | . | + | . | 4 | 5 | 6 | * | | |
|------+------+------+------+------+------|------+------+------+------+------+------| |------+------+------+------+------+------|------+------+------+------+------+------|
| = | 7 | 8 | 9 | 0 | - | / | 1 | 2 | 3 | . | \ | | = | 7 | 8 | 9 | 0 | - | . | 1 | 2 | 3 | / | \ |
|------+------+------+------+------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------+------+------+------+------|
|Brite | | | | | | | Prev | Stop | Slct | Mute | |Brite | | | | | | | Prev | Stop | Slct | Mute |
`-----------------------------------------------------------------------------------' `-----------------------------------------------------------------------------------'
@ -69,18 +80,27 @@ keys at the far left are for quick access to beginning and end of line in vim.
as the modifier, with the `IJKL` home row keys representing the inverted-T of as the modifier, with the `IJKL` home row keys representing the inverted-T of
the arrow keys. All of the default TouchCursor keymappings for the right hand the arrow keys. All of the default TouchCursor keymappings for the right hand
are represented below. My personalizations include all of the keys shown for are represented below. My personalizations include all of the keys shown for
the left hand. Having the `Alt` and `Shift` keys readily accessible from the the left hand. Having the `Alt` and `Shift` keys (as well as the `Control` key
home row allows quick word jumps and highlighting when used in conjunction with from the base layers) readily accessible from the home row allows quick word
the arrow keys. The `KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND,` and jumps and highlighting when used in conjunction with the arrow keys. The
`KC_AGAIN` keycodes have been mapped but they don't seem to work on Mac. `Alt-Tab` macro is not only useful under Windows, but also under Mac when used
Presumably they'll work under Windows. with alternative switchers like [HyperSwitch](https://bahoom.com/hyperswitch).
The `Cmd-Tab` and `Ctrl-Tab` sequences are duplicated for easy access while in
this layer. The `KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND,` and `KC_AGAIN`
keycodes do not seem to work. There are macros in place that'll "automatically"
choose the correct version (`Cmd-Tab` vs. `Alt-Tab`, `Cmd-C` vs. `Ctrl-C`,
etc.) depending on which layout you've currently selected (`AG_NORM` or
`AG_SWAP`) in the `_ADJUST` layer. The `Desk_L` and `Desk_R` macros are what I
use to switch between Virtual Desktops Left/Right. The `Tab_C`, `Tab_N` and
`Tab_R` are for "Close Tab," "New Tab" and "Reopen Closed Tab" for apps such as
Google Chrome.
``` ```
,-----------------------------------------------------------------------------------. ,-----------------------------------------------------------------------------------.
| | | |Shift | GUI | ~ |Insert| Home | Up | End | Bksp | | |AltTab|CmdTab|CtlTab| GUI |Shift | ~ |Insert| Home | Up | End | Bksp | |
|------+------+------+------+------+-------------+------+------+------+------+------| |------+------+------+------+------+-------------+------+------+------+------+------|
| | Alt |Space | | Find |Again | PgUp | Left | Down |Right | | | | | Alt |Space |Tab_C | Find |Again | PgUp | Left | Down |Right |Desk_L|Desk_R|
|------+------+------+------+------+------|------+------+------+------+------+------| |------+------+------+------+------+------|------+------+------+------+------+------|
| | Undo | Cut | Copy |Paste | ` | PgDn | Del | | | | | | | Undo | Cut | Copy |Paste | ` | PgDn | Del |Tab_N |Tab_R |iTerm2| |
|------+------+------+------+------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------+------+------+------+------|
| | | | | | | | | | | | | | | | | | | | | | | |
`-----------------------------------------------------------------------------------' `-----------------------------------------------------------------------------------'
@ -88,19 +108,19 @@ Presumably they'll work under Windows.
## Mouse Layer ## Mouse Layer
The Mouse layer, closely mimics the layout/behaviour of the TouchCursor layer. The Mouse layer, closely mimics the layout/behaviour of the TouchCursor layer.
The `A` key is used to activate this layer. All 16 keycodes for the mouse from The `D` key (on QWERTY) is used to activate this layer. All 16 keycodes for the
the `doc/keycode.txt` file are represented, and logically located, IMHO. The mouse from the `doc/keycode.txt` file are represented, and logically located,
left and right click buttons are duplicated; on the right hand side, for a IMHO. The left and right click buttons are duplicated; on the right hand side,
quick click here and there, and again on the left hand side for when the for a quick click here and there, and again on the left hand side for when the
buttons need to be held for dragging things or highlighting text, thus allowing buttons need to be held for dragging things or highlighting text, thus allowing
the right hand to be free to use the up/down/left/right actions. the right hand to be free to use the up/down/left/right actions.
``` ```
,-----------------------------------------------------------------------------------. ,-----------------------------------------------------------------------------------.
| | |ACCL0 |ACCL1 |ACCL2 |ACCL2 | |WHL_L | Up |WHL_R | BTN2 | | | | |ACCL0 | | | | |WHL_L | Up |WHL_R | BTN2 | |
|------+------+------+------+------+-------------+------+------+------+------+------| |------+------+------+------+------+-------------+------+------+------+------+------|
| | | | BTN3 | BTN1 | BTN4 |WHL_Up| Left | Down |Right | | | | |ACCL2 | BTN2 | | BTN1 |ACCL1 |WHL_Up| Left | Down |Right | BTN4 | BTN5 |
|------+------+------+------+------+------|------+------+------+------+------+------| |------+------+------+------+------+------|------+------+------+------+------+------|
| | | | | BTN2 | BTN5 |WHL_Dn| BTN1 | | | | | | | | | | BTN3 | |WHL_Dn| BTN1 | | | BTN3 | |
|------+------+------+------+------+------+------+------+------+------+------+------| |------+------+------+------+------+------+------+------+------+------+------+------|
| | | | | | | | | | | | | | | | | | | | | | | |
`-----------------------------------------------------------------------------------' `-----------------------------------------------------------------------------------'

View file

@ -0,0 +1,25 @@
# Build Options
# change to "no" to disable the options, or define them in the Makefile in
# the appropriate keymap folder that will get included automatically
#
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = yes # Audio output on port C6
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

View file

@ -0,0 +1,231 @@
// 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"
#endif
#include "eeconfig.h"
extern keymap_config_t keymap_config;
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _QWERTY 0
#define _COLEMAK 1
#define _DVORAK 2
#define _LOWER 3
#define _RAISE 4
#define _PLOVER 5
#define _ADJUST 16
enum planck_keycodes {
QWERTY = SAFE_RANGE,
COLEMAK,
DVORAK,
PLOVER,
LOWER,
RAISE,
BACKLIT,
EXT_PLV
};
// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = {
{KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_DEL, KC_Y, KC_U, KC_I, KC_O, KC_P },
{KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_TAB, KC_H, KC_J, KC_K, KC_L, KC_SCLN},
{KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH},
{KC_LGUI, _______, _______, KC_LALT, LOWER, KC_SPC, KC_ENT, KC_SPC, RAISE, KC_RALT, _______, KC_RGUI}
},
[_COLEMAK] = {
{KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC},
{KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT},
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT },
{BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
},
[_DVORAK] = {
{KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC},
{KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH},
{KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT },
{BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
},
[_LOWER] = {
{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, _______, KC_6, KC_7, KC_8, KC_9, KC_0},
{_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, KC_F6, KC_HOME, KC_PGDN, KC_PGUP, KC_END },
{_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, KC_F12, KC_PLUS, KC_PIPE, KC_LCBR, KC_RCBR},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
},
[_RAISE] = {
{KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN},
{_______, _______, _______, KC_QUOT, KC_MINS, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT},
{_______, KC_TILD, KC_GRV, KC_PLUS, KC_EQL, KC_PIPE, _______, KC_BSLS, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MPLY}
},
[_PLOVER] = {
{KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 },
{XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC},
{XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
{EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX}
},
[_ADJUST] = {
{_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL},
{_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______},
{_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
}
};
#ifdef AUDIO_ENABLE
float tone_startup[][2] = SONG(STARTUP_SOUND);
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
float tone_dvorak[][2] = SONG(DVORAK_SOUND);
float tone_colemak[][2] = SONG(COLEMAK_SOUND);
float tone_plover[][2] = SONG(PLOVER_SOUND);
float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND);
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
#endif
void persistant_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif
persistant_default_layer_set(1UL<<_QWERTY);
}
return false;
break;
case COLEMAK:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif
persistant_default_layer_set(1UL<<_COLEMAK);
}
return false;
break;
case DVORAK:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
#endif
persistant_default_layer_set(1UL<<_DVORAK);
}
return false;
break;
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case RAISE:
if (record->event.pressed) {
layer_on(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case BACKLIT:
if (record->event.pressed) {
register_code(KC_RSFT);
#ifdef BACKLIGHT_ENABLE
backlight_step();
#endif
} else {
unregister_code(KC_RSFT);
}
return false;
break;
case PLOVER:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
stop_all_notes();
PLAY_NOTE_ARRAY(tone_plover, false, 0);
#endif
layer_off(_RAISE);
layer_off(_LOWER);
layer_off(_ADJUST);
layer_on(_PLOVER);
if (!eeconfig_is_enabled()) {
eeconfig_init();
}
keymap_config.raw = eeconfig_read_keymap();
keymap_config.nkro = 1;
eeconfig_update_keymap(keymap_config.raw);
}
return false;
break;
case EXT_PLV:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_plover_gb, false, 0);
#endif
layer_off(_PLOVER);
}
return false;
break;
}
return true;
}
void matrix_init_user(void) {
#ifdef AUDIO_ENABLE
startup_user();
#endif
}
#ifdef AUDIO_ENABLE
void startup_user()
{
_delay_ms(20); // gets rid of tick
PLAY_NOTE_ARRAY(tone_startup, false, 0);
}
void shutdown_user()
{
PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
_delay_ms(150);
stop_all_notes();
}
void music_on_user(void)
{
music_scale_user();
}
void music_scale_user(void)
{
PLAY_NOTE_ARRAY(music_scale, false, 0);
}
#endif

View file

@ -0,0 +1,4 @@
# Split Layout
Inspired by TECK
[Layout](http://www.keyboard-layout-editor.com/##@_switchMount=cherry&switchBrand=gateron&switchType=KS-3-Tea&pcb:true%3B&@_c=%23e6e6e6&t=%23757575&a:7&fa@:5%3B%3B&=Esc&_a:4&fa@:5&:0&:0&:0&:0&:0&:0&:0&:0&:5%3B%3B&=%0A%0A!%0A1%0A%0A%0A%0A%0A%0AQ&=%0A%0A%2F@%0A2%0A%0A%0A%0A%0A%0AW&=%0A%0A%23%0A3%0A%0A%0A%0A%0A%0AE&=%0A%0A$%0A4%0A%0A%0A%0A%0A%0AR&=%0A%0A%25%0A5%0A%0A%0A%0A%0A%0AT&_c=%23e3b02d&a:7%3B&=Del&_c=%23e6e6e6&a:4%3B&=%0A%0A%5E%0A6%0A%0A%0A%0A%0A%0AY&=%0A%0A%2F&%0A7%0A%0A%0A%0A%0A%0AU&=%0A%0A*%0A8%0A%0A%0A%0A%0A%0AI&=%0A%0A(%0A9%0A%0A%0A%0A%0A%0AO&=%0A%0A)%0A0%0A%0A%0A%0A%0A%0AP%3B&@_a:7%3B&=Shift&_a:4%3B&=%0A%0A%0AF1%0A%0A%0A%0A%0A%0AA&=%0A%0A%0AF2%0A%0A%0A%0A%0A%0AS&=%0A%0A'%0AF3%0A%0A%0A%0A%0A%0AD&_c=%23e3b02d&n:true%3B&=%0A%0A-%0AF4%0A%0A%0A%0A%0A%0AF&_c=%23e6e6e6%3B&=%0A%0A%0AF5%0A%0A%0A%0A%0A%0AG&_c=%23e3b02d&a:7%3B&=Tab&_c=%23e6e6e6&a:4%3B&=%0A%0A%0AF6%0A%0A%0A%0A%0A%0AH&_c=%23e3b02d&n:true%3B&=%0A%0A%2F&larr%2F%3B%0AHom%0A%0A%0A%0A%0A%0AJ&_c=%23e6e6e6%3B&=%0A%0A%2F&darr%2F%3B%0APgD%0A%0A%0A%0A%0A%0AK&=%0A%0A%2F&uarr%2F%3B%0APgU%0A%0A%0A%0A%0A%0AL&=%0A%0A%2F&rarr%2F%3B%0AEnd%0A%0A%0A%0A%0A%0A%2F%3B%3B&@_a:7%3B&=Ctrl&_a:4%3B&=%0A%0A~%0AF7%0A%0A%0A%0A%0A%0AZ&=%0A%0A%60%0AF8%0A%0A%0A%0A%0A%0AX&=%0A%0A+%0AF9%0A%0A%0A%0A%0A%0AC&=%0A%0A%2F=%0AF10%0A%0A%0A%0A%0A%0AV&=%0A%0A%7C%0AF11%0A%0A%0A%0A%0A%0AB&_c=%23e3b02d&a:7%3B&=BSp&_c=%23e6e6e6&a:4%3B&=%0A%0A%5C%0AF12%0A%0A%0A%0A%0A%0AN&=%0A%0A%5B%0A%0A%0A%0A%0A%0A%0AM&=%0A%0A%5D%0A%0A%0A%0A%0A%0A%0A,&=%0A%0A%7B%0A%0A%0A%0A%0A%0A%0A.&=%0A%0A%7D%0A%0A%0A%0A%0A%0A%0A%2F%2F%3B&@_a:7%3B&=&=&=&=Alt&_c=%23e3b02d%3B&=%2F&dArr%2F%3B&_c=%23e6e6e6%3B&=spc&_c=%23e3b02d%3B&=%2F&crarr%2F%3B&_c=%23e6e6e6%3B&=spc&_c=%23e3b02d%3B&=%2F&uArr%2F%3B&_c=%23e6e6e6%3B&=Alt&=&=)

View file

@ -0,0 +1,314 @@
// 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"
#endif
#include "eeconfig.h"
extern keymap_config_t keymap_config;
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _QWERTY 0
#define _COLEMAK 1
#define _DVORAK 2
#define _LOWER 3
#define _RAISE 4
#define _PLOVER 5
#define _ADJUST 16
enum planck_keycodes {
QWERTY = SAFE_RANGE,
COLEMAK,
DVORAK,
PLOVER,
LOWER,
RAISE,
BACKLIT,
EXT_PLV
};
// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
* ,-----------------------------------------------------------------------------------.
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | S | D | F | G | H | J | K | L | ; | " |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = {
{KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
{KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT },
{BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
},
/* Colemak
* ,-----------------------------------------------------------------------------------.
* | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | R | S | T | D | H | N | E | I | O | " |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_COLEMAK] = {
{KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC},
{KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT},
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT },
{BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
},
/* Dvorak
* ,-----------------------------------------------------------------------------------.
* | Tab | " | , | . | P | Y | F | G | C | R | L | / |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | O | E | U | I | D | H | T | N | S | - |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| ; | Q | J | K | X | B | M | W | V | Z | Shift|
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Ctrl | Alt | Left |Right |Lower | Bksp |Space |Raise | Up | Down | GUI |Enter |
* `-----------------------------------------------------------------------------------'
*/
[_DVORAK] = {
{KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH},
{KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS},
{KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_T(KC_ENT)},
{KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, KC_BSPC, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT }
},
/* Lower
* ,-----------------------------------------------------------------------------------.
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Caps | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 | | Mute | Vol- | Vol+ | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Brite| | Home | End | | Del | Ins | | PgUp | PgDN | |Enter |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = {
{KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______},
{KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
{_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______},
{BACKLIT, _______, KC_HOME, KC_END, _______, KC_DEL, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______}
},
/* Raise
* ,-----------------------------------------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Caps | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 | | Prev | Play | Next | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Brite| | Home | End | | Del | Ins | | PgUp | PgDN | |Enter |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = {
{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______},
{KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
{_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______},
{BACKLIT, _______, KC_HOME, KC_END, _______, KC_DEL, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______}
},
/* Plover layer (http://opensteno.org)
* ,-----------------------------------------------------------------------------------.
* | # | # | # | # | # | # | # | # | # | # | # | # |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | S | T | P | H | * | * | F | P | L | T | D |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* |TogOut| S | K | W | R | * | * | R | B | G | S | Z |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Exit | | | A | O | | E | U | | | |
* `-----------------------------------------------------------------------------------'
*/
[_PLOVER] = {
{KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 },
{XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC},
{XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
{EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX}
},
/* Adjust (Lower + Raise)
* ,-----------------------------------------------------------------------------------.
* | | Reset| | | | | | | | | | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = {
{_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL},
{_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______},
{_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
}
};
#ifdef AUDIO_ENABLE
float tone_startup[][2] = SONG(STARTUP_SOUND);
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
float tone_dvorak[][2] = SONG(DVORAK_SOUND);
float tone_colemak[][2] = SONG(COLEMAK_SOUND);
float tone_plover[][2] = SONG(PLOVER_SOUND);
float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND);
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
#endif
void persistant_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif
persistant_default_layer_set(1UL<<_QWERTY);
}
return false;
break;
case COLEMAK:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif
persistant_default_layer_set(1UL<<_COLEMAK);
}
return false;
break;
case DVORAK:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
#endif
persistant_default_layer_set(1UL<<_DVORAK);
}
return false;
break;
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case RAISE:
if (record->event.pressed) {
layer_on(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case BACKLIT:
if (record->event.pressed) {
register_code(KC_RSFT);
#ifdef BACKLIGHT_ENABLE
backlight_step();
#endif
} else {
unregister_code(KC_RSFT);
}
return false;
break;
case PLOVER:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
stop_all_notes();
PLAY_NOTE_ARRAY(tone_plover, false, 0);
#endif
layer_off(_RAISE);
layer_off(_LOWER);
layer_off(_ADJUST);
layer_on(_PLOVER);
if (!eeconfig_is_enabled()) {
eeconfig_init();
}
keymap_config.raw = eeconfig_read_keymap();
keymap_config.nkro = 1;
eeconfig_update_keymap(keymap_config.raw);
}
return false;
break;
case EXT_PLV:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_plover_gb, false, 0);
#endif
layer_off(_PLOVER);
}
return false;
break;
}
return true;
}
void matrix_init_user(void) {
#ifdef AUDIO_ENABLE
startup_user();
#endif
}
#ifdef AUDIO_ENABLE
void startup_user()
{
_delay_ms(20); // gets rid of tick
PLAY_NOTE_ARRAY(tone_startup, false, 0);
}
void shutdown_user()
{
PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
_delay_ms(150);
stop_all_notes();
}
void music_on_user(void)
{
music_scale_user();
}
void music_scale_user(void)
{
PLAY_NOTE_ARRAY(music_scale, false, 0);
}
#endif

View file

@ -0,0 +1,25 @@
# Build Options
# change to "no" to disable the options, or define them in the Makefile in
# the appropriate keymap folder that will get included automatically
#
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = yes # Audio output on port C6
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

View file

@ -0,0 +1,20 @@
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 = yes # Audio output on port C6
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

View file

@ -0,0 +1,8 @@
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include "../../config.h"
#define FORCE_NKRO 1
#endif

View file

@ -0,0 +1,215 @@
#include "preonic.h"
#include "action_layer.h"
#include "eeconfig.h"
#include "keymap_nordic.h"
#ifdef AUDIO_ENABLE
#include "audio.h"
#endif
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _QWERTY 0
#define _LOWER 3
#define _RAISE 4
#define _ADJUST 16
enum preonic_keycodes {
QWERTY = SAFE_RANGE,
LOWER,
RAISE,
BACKLIT
};
// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
* ,-----------------------------------------------------------------------------------.
* | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | + | Bksp |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Esc | Q | W | E | R | T | Y | U | I | O | P | Å |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Tab | A | S | D | F | G | H | J | K | L | Ö | Ä |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| < | Z | X | C | V | B | N | M | . | , | - |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Ctrl | GUI | Alt |AltGr |Lower | Space| Enter|Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = {
{KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, NO_PLUS, KC_BSPC},
{KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, NO_AM },
{KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, NO_AE, NO_OSLH},
{KC_LSFT, NO_LESS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_DOT, KC_COMM, NO_MINS},
{KC_LCTL, KC_LGUI, KC_LALT, NO_ALGR, LOWER, KC_SPC, KC_ENT, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
},
/* Lower
* ,-----------------------------------------------------------------------------------.
* | | @ | £ | $ | | | { | [ | ] | } | \ | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | | | | | | |VolUp | | | ~ |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | | | | | |LastS |PauseP|NextS | | * |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | | | | | | | | |VolDwn| | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | |Bspc | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = {
{_______, NO_AT, NO_PND, NO_DLR, _______, _______, NO_LCBR, NO_LBRC, NO_RBRC, NO_RCBR, NO_BSLS, KC_DEL},
{_______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, _______, _______, NO_TILD},
{_______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, LSFT(KC_BSLS)},
{_______, NO_PIPE, _______, _______, _______, _______, _______, _______, KC_VOLD, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, KC_BSPC, _______, _______, _______, _______, _______}
},
/* Raise
* ,-----------------------------------------------------------------------------------.
* | ! | " | # | ¤ | % | & | / | ( | ) | = | ? | Ins |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | |Mouse^| | | | |ScrlUp| | | ^ |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | |Mouse<|MouseV|Mouse>| | |MLC |MMC |MRC | ' | " |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | > | | | | | | |ScrlDown| : | ; | _ |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | |Bspc | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = {
{LSFT(KC_1),NO_QUO2,LSFT(KC_3), NO_BULT,LSFT(KC_5), NO_AMPR, NO_SLSH, NO_LPRN, NO_RPRN, NO_EQL, NO_QUES, KC_INS},
{_______, _______, _______, KC_MS_U, _______, _______, _______, _______, KC_WH_U, _______, _______, NO_CIRC},
{_______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, KC_BTN1, KC_BTN3, KC_BTN2, NO_APOS, NO_QUOT},
{_______, NO_GRTR, _______, _______, _______, _______, _______, _______, KC_WH_D, NO_COLN, NO_SCLN, NO_UNDS},
{_______, _______, _______, _______, _______, KC_BSPC, _______, _______, _______, _______, _______, _______}
},
/* Adjust (Lower + Raise)
* ,-----------------------------------------------------------------------------------.
* | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | Reset| | | | | | | | |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | | | | | | | | | |Rsft |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | |MusOn |MusOff| | | | | | | | | Reset|
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = {
{KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12},
{_______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RSFT},
{_______, MU_ON, MU_OFF, _______, _______, _______, _______, _______, _______, _______, _______, RESET },
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
}
};
#ifdef AUDIO_ENABLE
float tone_startup[][2] = {
{NOTE_B5, 20},
{NOTE_B6, 8},
{NOTE_DS6, 20},
{NOTE_B6, 8}
};
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
#endif
void persistant_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif
persistant_default_layer_set(1UL<<_QWERTY);
}
return false;
break;
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case RAISE:
if (record->event.pressed) {
layer_on(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case BACKLIT:
if (record->event.pressed) {
register_code(KC_RSFT);
#ifdef BACKLIGHT_ENABLE
backlight_step();
#endif
} else {
unregister_code(KC_RSFT);
}
return false;
break;
}
return true;
};
void matrix_init_user(void) {
#ifdef AUDIO_ENABLE
startup_user();
#endif
}
#ifdef AUDIO_ENABLE
void startup_user()
{
_delay_ms(20); // gets rid of tick
PLAY_NOTE_ARRAY(tone_startup, false, 0);
}
void shutdown_user()
{
PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
_delay_ms(150);
stop_all_notes();
}
void music_on_user(void)
{
music_scale_user();
}
void music_scale_user(void)
{
PLAY_NOTE_ARRAY(music_scale, false, 0);
}
#endif

View file

@ -0,0 +1,3 @@
# Jacwib's preonic keymap.
Designed for use with a swedish language.

View file

@ -0,0 +1,27 @@
# Build Options
# change to "no" to disable the options, or define them in the Makefile in
# the appropriate keymap folder that will get included automatically
#
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = yes # Audio output on port C6
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
TAP_DANCE_ENABLE = yes
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

View file

@ -0,0 +1,92 @@
/*
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 0x6061
#define DEVICE_VER 0x0001
#define MANUFACTURER Ortholinear Keyboards
#define PRODUCT The Preonic Keyboard
#define DESCRIPTION A compact ortholinear keyboard
/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 12
/* Planck PCB default pin-out */
#define MATRIX_ROW_PINS { D2, D5, B5, B6, D3 }
#define MATRIX_COL_PINS { F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 }
#define UNUSED_PINS
#define BACKLIGHT_PIN B7
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
/* number of backlight levels */
#define BACKLIGHT_LEVELS 3
/* Set 0 if debouncing isn't needed */
#define DEBOUNCING_DELAY 5
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE
/* key combination for command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
/* ws2812 RGB LED */
#define RGB_DI_PIN D1
#define RGBLIGHT_TIMER
#define RGBLED_NUM 28 // Number of LEDs
#define RGBLIGHT_HUE_STEP 10
#define RGBLIGHT_SAT_STEP 17
#define RGBLIGHT_VAL_STEP 17
/*
* Feature disable options
* These options are also useful to firmware size reduction.
*/
#define TAPPING_TERM 200
/* 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

View file

@ -0,0 +1,144 @@
#include "preonic.h"
#include "action_layer.h"
#include "eeconfig.h"
#ifdef AUDIO_ENABLE
#include "audio.h"
#endif
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _QWERTY 0
#define _FN 1
#define _ULCK 2
// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
#define HYP_TIC ALL_T(KC_GRV)
#define EQ_LOCK TD(TD_EQ_LOCK)
#define MIN_ULK TD(TD_MIN_ULOCK)
//Tap Dance Declarations
enum {
TD_EQ_LOCK = 0,
TD_MIN_ULOCK
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
* ,-----------------------------------------------------------------------------------.
* | = | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Tab | Q | W | E | R | T | Y | U | I | O | P | \ |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Ctrl | A | S | D | F | G | H | J | K | L | ; | " |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | N | M | , | . | / |Shift |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | FN | ` | Alt | LGUI | Back | ESC |ENTER | SPCE | RGUI | [ | ] | FN |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = {
{EQ_LOCK, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, MIN_ULK },
{KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, 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_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC },
{MO(_FN), HYP_TIC, KC_LALT, KC_LGUI, KC_BSPC, KC_ESC, KC_ENT, KC_SPC, KC_RGUI, KC_LBRC, KC_RBRC, MO(_FN) }
},
/* Fn
* ,-----------------------------------------------------------------------------------.
* | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | VOL- | VOL+ | MUTE |BLtogg| | LEFT | DOWN | UP | RGHT | | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | BL- | BL+ |Aud on|AudOff|AGnorm|AGswap| | | | | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | |Voice-|Voice+|Mus on|MusOff| | |PLY/PS| | PREV | NEXT | |
* `-----------------------------------------------------------------------------------'
*/
[_FN] = {
{_______, 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_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______ },
{_______, KC_VOLD, KC_VOLU, KC_MUTE, BL_TOGG, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______ },
{_______, BL_DEC, BL_INC, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______ },
{_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, _______, _______, KC_MPLY, _______, KC_MPRV, KC_MNXT, _______ }
}
};
float tone_startup[][2] = {
{NOTE_B5, 20},
{NOTE_B6, 8},
{NOTE_DS6, 20},
{NOTE_B6, 8}
};
float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
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) {*/
/*return true;*/
/*[>switch (keycode) {<]*/
/*[>case QWERTY:<]*/
/*[>return true;<]*/
/*[>}<]*/
/*};*/
void matrix_init_user(void) {
startup_user();
}
void startup_user()
{
_delay_ms(20); // gets rid of tick
PLAY_NOTE_ARRAY(tone_startup, false, 0);
}
void shutdown_user()
{
PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
_delay_ms(150);
stop_all_notes();
}
void music_on_user(void)
{
music_scale_user();
}
void music_scale_user(void)
{
PLAY_NOTE_ARRAY(music_scale, false, 0);
}
qk_tap_dance_action_t tap_dance_actions[] = {
//Tap once for equal, twice for hyper + X (alfred lock)
[TD_EQ_LOCK] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, HYPR(KC_X)),
//Tap once for minus, twice for time.heals.nothing
[TD_MIN_ULOCK] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, M(_ULCK))
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
switch(id) {
case _ULCK:
if (record->event.pressed) {
/* time.heals.nothing */
return MACRO( I(220), T(T), T(I), T(M), T(E), T(DOT), T(H), T(E), T(A), T(L), T(S), T(DOT), T(N), T(O), T(T), T(H), T(I), T(N), T(G), END);
}
break;
}
return MACRO_NONE;
};

View file

@ -0,0 +1 @@
# The default Preonic layout - largely based on the Planck's

View file

@ -0,0 +1,342 @@
#include "preonic.h"
#include "action_layer.h"
#include "eeconfig.h"
#ifdef AUDIO_ENABLE
#include "audio.h"
#endif
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _QWERTY 0
#define _COLEMAK 1
#define _DVORAK 2
#define _LOWER 3
#define _RAISE 4
#define _MUSIC 5
#define _ADJUST 16
// Macro name shortcuts
#define QWERTY M(_QWERTY)
#define COLEMAK M(_COLEMAK)
#define DVORAK M(_DVORAK)
#define LOWER M(_LOWER)
#define RAISE M(_RAISE)
#define M_BL 5
#define AUD_OFF M(6)
#define AUD_ON M(7)
#define MUS_OFF M(8)
#define MUS_ON M(9)
#define VC_IN M(10)
#define VC_DE M(11)
// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
* ,-----------------------------------------------------------------------------------.
* | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | - | A | S | D | F | G | H | J | K | L | ; | " |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | N | M | , | . | / | Shift|
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Ctrl | Alt | Left |Right |Lower | Space |Raise | Up | Down | GUI |Enter |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = {
{KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
{KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL},
{KC_MINS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT},
{KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, KC_SPC, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT }
},
/* Colemak
* ,-----------------------------------------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | R | S | T | D | H | N | E | I | O | " |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_COLEMAK] = {
{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
{KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL},
{KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT},
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT },
{M(M_BL), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
},
/* Dvorak
* ,-----------------------------------------------------------------------------------.
* | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Tab | " | , | . | P | Y | F | G | C | R | L | / |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | O | E | U | I | D | H | T | N | S | - |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| ; | Q | J | K | X | B | M | W | V | Z | Shift|
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Ctrl | Alt | Left |Right |Lower | Space |Raise | Up | Down | GUI |Enter |
* `-----------------------------------------------------------------------------------'
*/
[_DVORAK] = {
{KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
{KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH},
{KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS},
{KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT},
{KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, KC_SPC, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT }
},
/* Lower
* ,-----------------------------------------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Caps | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 | | Mute | Vol- | Vol+ | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Brite| | Home | End | | Ins | | PgUp | PgDN | |Enter |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = {
{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
{KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL},
{KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
{_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______},
{M(M_BL), _______, KC_HOME, KC_END, _______, KC_INS, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______}
},
/* Raise
* ,-----------------------------------------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Caps | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 | | Prev | Play | Next | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Brite| | Home | End | | Ins | | PgUp | PgDN | |Enter |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = {
{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
{KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL},
{KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
{_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______},
{M(M_BL), _______, KC_HOME, KC_END, _______, KC_INS, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______}
},
/* Music (reserved for process_action_user)
*
*/
[_MUSIC] = {
{XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX},
{XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX},
{XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX},
{XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX},
{XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, LOWER, XXXXXXX, XXXXXXX, RAISE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}
},
/* Adjust (Lower + Raise)
* ,-----------------------------------------------------------------------------------.
* | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | Reset| | | | | | | | | | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | |Audoff|Aud on|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | |Voice-|Voice+|Musoff|Mus on| | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = {
{KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12},
{_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL},
{_______, _______, _______, AUD_ON, AUD_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______},
{_______, VC_DE, VC_IN, MUS_ON, MUS_OFF, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
}
};
const uint16_t PROGMEM fn_actions[] = {
};
#ifdef AUDIO_ENABLE
float start_up[][2] = {
{440.0*pow(2.0,(14)/12.0), 20},
{440.0*pow(2.0,(26)/12.0), 8},
{440.0*pow(2.0,(18)/12.0), 20},
{440.0*pow(2.0,(26)/12.0), 8}
};
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
float tone_dvorak[][2] = SONG(DVORAK_SOUND);
float tone_colemak[][2] = SONG(COLEMAK_SOUND);
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
float goodbye[][2] = SONG(GOODBYE_SOUND);
#endif
void persistant_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
switch(id) {
case _QWERTY:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
#endif
persistant_default_layer_set(1UL<<_QWERTY);
}
break;
case _COLEMAK:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_colemak, false, 0);
#endif
persistant_default_layer_set(1UL<<_COLEMAK);
}
break;
case _DVORAK:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
#endif
persistant_default_layer_set(1UL<<_DVORAK);
}
break;
case _LOWER:
if (record->event.pressed) {
layer_on(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
break;
case _RAISE:
if (record->event.pressed) {
layer_on(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
break;
case M_BL:
if (record->event.pressed) {
register_code(KC_RSFT);
#ifdef BACKLIGHT_ENABLE
backlight_step();
#endif
} else {
unregister_code(KC_RSFT);
}
break;
case 6:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
audio_off();
#endif
}
break;
case 7:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
audio_on();
PLAY_NOTE_ARRAY(start_up, false, 0);
#endif
}
break;
case 8:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
layer_off(_MUSIC);
stop_all_notes();
#endif
}
break;
case 9:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(music_scale, false, 0);
layer_on(_MUSIC);
#endif
}
break;
case 10:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
voice_iterate();
PLAY_NOTE_ARRAY(music_scale, false, 0);
#endif
}
break;
case 11:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
voice_deiterate();
PLAY_NOTE_ARRAY(music_scale, false, 0);
#endif
}
break;
}
return MACRO_NONE;
};
void matrix_init_user(void) {
#ifdef AUDIO_ENABLE
_delay_ms(20); // gets rid of tick
PLAY_NOTE_ARRAY(start_up, false, 0);
#endif
}
#ifdef AUDIO_ENABLE
uint8_t starting_note = 0x0C;
int offset = 7;
void process_action_user(keyrecord_t *record) {
if (IS_LAYER_ON(_MUSIC)) {
if (record->event.pressed) {
play_note(((double)220.0)*pow(2.0, -4.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row)), 0xF);
} else {
stop_note(((double)220.0)*pow(2.0, -4.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row)));
}
}
}
void play_goodbye_tone()
{
PLAY_NOTE_ARRAY(goodbye, false, 0);
_delay_ms(150);
}
#endif

View file

@ -0,0 +1 @@
AUDIO_ENABLE = yes

View file

@ -0,0 +1,20 @@
# Build Options
# comment out to disable the options.
#
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE ?= no # Mouse keys(+4700)
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
CONSOLE_ENABLE ?= yes # Console for debug(+400)
COMMAND_ENABLE ?= yes # Commands for debug and configuration
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
RGBLIGHT_ENABLE ?= no # Enable keyboard underlight functionality (+4870)
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality (+1150)
MIDI_ENABLE ?= no # MIDI controls
AUDIO_ENABLE ?= no
UNICODE_ENABLE ?= no # Unicode
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

View file

@ -0,0 +1,12 @@
# denolfe's Layout
Customized Satan keymap
![Layout](keyboard-layout.png "Practical Keymap")
## Programming Instructions:
`cd` into keymap directory, `make dfu`
## Features
- Movement keys with <kbd>CapsLock</kbd> + <kbd>h</kbd>, <kbd>j</kbd>, <kbd>k</kbd>, <kbd>l</kbd>
- Media Keys
- Backlight control

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View file

@ -0,0 +1,171 @@
#include "satan.h"
#ifdef RGBLIGHT_ENABLE
#include "rgblight.h"
#endif
// Used for SHIFT_ESC
#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _BL 0
#define _FL 1
#define _SL 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| -| =|Backsp |
* |-----------------------------------------------------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |
* |-----------------------------------------------------------|
* |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |
* |-----------------------------------------------------------|
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |
* |-----------------------------------------------------------|
* |Ctrl|Gui |Alt | Space |Alt |Gui |FN |Ctrl |
* `-----------------------------------------------------------'
*/
[_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_BSPC, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \
MO(_FL), 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, \
KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RGUI, KC_RCTL),
/* Keymap _FL: Function Layer
* ,-----------------------------------------------------------.
* | | | | | | | | | | | | | | RESET|
* |-----------------------------------------------------------|
* | | | | | | | | | | | |BL-|BL+|BL |
* |-----------------------------------------------------------|
* | | | | | | | | | | | | |
* |-----------------------------------------------------------|
* | | F1|F2 | F3|F4 | F5| F6| F7| F8| | | |
* |-----------------------------------------------------------|
* | | | | | | | | |
* `-----------------------------------------------------------'
*/
[_FL] = KEYMAP(
#ifdef RGBLIGHT_ENABLE
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_TRNS, RESET, \
KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_INC, BL_TOGG, \
KC_TRNS,KC_TRNS,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(1), F(2), F(3), F(4), F(5), F(6), F(7), F(8), KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
#else
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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_PGUP, KC_TRNS, KC_END, KC_MPRV, KC_MNXT, KC_MPLY, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, KC_HOME, LCTL(KC_LEFT), LCTL(KC_END), LCTL(KC_RIGHT), KC_TRNS, RESET, \
KC_TRNS, KC_TRNS, F(9), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
#endif
[_SL] = 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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_PGUP, KC_TRNS, LSFT(KC_END), KC_MPRV, KC_MNXT, KC_MPLY, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LSFT(KC_LEFT), LSFT(KC_DOWN), LSFT(KC_UP), LSFT(KC_RIGHT), KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, LSFT(KC_HOME), LCTL(LSFT(KC_LEFT)), LCTL(LSFT(KC_END)), LCTL(LSFT(KC_RIGHT)), KC_TRNS, RESET, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
};
enum function_id {
SHIFT_ESC,
#ifdef RGBLIGHT_ENABLE
RGBLED_TOGGLE,
RGBLED_STEP_MODE,
RGBLED_INCREASE_HUE,
RGBLED_DECREASE_HUE,
RGBLED_INCREASE_SAT,
RGBLED_DECREASE_SAT,
RGBLED_INCREASE_VAL,
RGBLED_DECREASE_VAL
#endif
};
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_FUNCTION(SHIFT_ESC),
#ifdef RGBLIGHT_ENABLE
[1] = ACTION_FUNCTION(RGBLED_TOGGLE),
[2] = ACTION_FUNCTION(RGBLED_STEP_MODE),
[3] = ACTION_FUNCTION(RGBLED_INCREASE_HUE),
[4] = ACTION_FUNCTION(RGBLED_DECREASE_HUE),
[5] = ACTION_FUNCTION(RGBLED_INCREASE_SAT),
[6] = ACTION_FUNCTION(RGBLED_DECREASE_SAT),
[7] = ACTION_FUNCTION(RGBLED_INCREASE_VAL),
[8] = ACTION_FUNCTION(RGBLED_DECREASE_VAL),
#endif
[9] = ACTION_LAYER_MODS(2, MOD_LSFT)
};
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;
//led operations
#ifdef RGBLIGHT_ENABLE
case RGBLED_TOGGLE:
if (record->event.pressed) {
rgblight_toggle();
}
break;
case RGBLED_INCREASE_HUE:
if (record->event.pressed) {
rgblight_increase_hue();
}
break;
case RGBLED_DECREASE_HUE:
if (record->event.pressed) {
rgblight_decrease_hue();
}
break;
case RGBLED_INCREASE_SAT:
if (record->event.pressed) {
rgblight_increase_sat();
}
break;
case RGBLED_DECREASE_SAT:
if (record->event.pressed) {
rgblight_decrease_sat();
}
break;
case RGBLED_INCREASE_VAL:
if (record->event.pressed) {
rgblight_increase_val();
}
break;
case RGBLED_DECREASE_VAL:
if (record->event.pressed) {
rgblight_decrease_val();
}
break;
case RGBLED_STEP_MODE:
if (record->event.pressed) {
rgblight_step();
}
break;
#endif
}
}

View file

@ -0,0 +1,3 @@
updatemerge.sh
clear_flash.hex
resetboard.sh

Binary file not shown.

After

Width:  |  Height:  |  Size: 775 KiB

View file

@ -0,0 +1,16 @@
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality (+4870)
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality (+1150)
MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = no
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

View file

@ -0,0 +1,42 @@
#!/bin/bash
# adjust for cpu
# -j 16 gave best result on a hyperthreaded quad core core i7
LIMIT=10
THREADS="-j 16"
KMAP=iso_split_rshift
echo "We need sudo later"
sudo ls 2>&1 /dev/null
function wait_bootloader {
echo "Waiting for Bootloader..."
local STARTTIME=$(date +"%s")
local REMIND=0
local EXEC=dfu-programmer
local TARGET=atmega32u4
while true
do
sudo $EXEC $TARGET get > /dev/null 2>&1
[ $? -eq 0 ] && break
ENDTIME=$(date +"%s")
DURATION=$(($ENDTIME-$STARTTIME))
if [ $REMIND -eq 0 -a $DURATION -gt $LIMIT ]
then
echo "Did you forget to press the reset button?"
REMIND=1
fi
sleep 1
done
}
make clean
make KEYMAP=${KMAP} ${THREADS}
if [[ $? -eq 0 ]]
then
echo "please trigger flashing!"
wait_bootloader
sudo make KEYMAP=${KMAP} dfu ${THREADS}
else
echo "make failed"
exit 77
fi

View file

@ -0,0 +1,27 @@
/*
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_USER_H
#define CONFIG_USER_H
#include "../../config.h"
// only change
#undef RGB_DI_PIN
#define RGB_DI_PIN B2
#endif

View file

@ -0,0 +1,209 @@
// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
// this is the style you want to emulate.
#include "satan.h"
// TODO: replace your ugly german brckets with #defines
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _DEF 0
#define _SPC 1
#define _TAB 2
#define _SFX 3
// dual-role shortcuts
#define TABDUAL LT(_TAB, KC_TAB)
#define CAPSDUAL CTL_T(KC_ESC)
#define SPACEDUAL LT(_SPC, KC_SPACE)
#define ENTERDUAL CTL_T(KC_ENT)
// arrow cluster duality bottom right corner
#define ARRLEFT ALT_T(KC_LEFT)
#define ARRDOWN GUI_T(KC_DOWN)
#define ARRUP SFT_T(KC_UP)
#define ARRRIGHT CTL_T(KC_RIGHT)
// german brackets
#define GER_CUR_L RALT(KC_7) // [
#define GER_CUR_R RALT(KC_0) // ]
#define GER_PAR_L LSFT(KC_8) // (
#define GER_PAR_R LSFT(KC_9) // )
#define GER_ANG_L KC_NUBS // <
#define GER_ANG_R LSFT(KC_NUBS) // >
#define GER_BRC_L RALT(KC_8) // [
#define GER_BRC_R RALT(KC_9) // ]
// increase readability
#define _______ KC_TRNS
#define XXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap _DEF: Default Layer
* ,-----------------------------------------------------------.
* |Grv| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |
* |-----------------------------------------------------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | Tab is Fn1
* |-----------------------------------------------------------|
* |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| Return |
* |-----------------------------------------------------------|
* |Sft | < | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn2| RShift is UP
* |-----------------------------------------------------------|
* |Ctrl|Win |Alt | Space/Fn0 |Alt |Win |Menu|RCtl| Gui Menu, RCtrl is
* `-----------------------------------------------------------' LEFT DWN RIGHT
*/
[_DEF] = KEYMAP_ISO_SPLITRSHIFT(
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \
TABDUAL, 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, \
CAPSDUAL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, ENTERDUAL, \
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TG(_SFX), ARRUP, \
KC_LCTL, KC_LGUI, KC_LALT, SPACEDUAL, KC_RALT, ARRLEFT, ARRDOWN, ARRRIGHT),
/* Keymap 1: F-and-vim Layer, modified with Space (by holding space)
* ,-----------------------------------------------------------.
* |PrSc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete|
* |-----------------------------------------------------------|
* | |Paus| Up| [ | ] | | | | ( | ) | | | | |
* |-----------------------------------------------------------|
* | |Lft|Dwn|Rgt| | |Left|Down|Right|Up| | | PLAY |
* |-----------------------------------------------------------|
* | | | | | < | > | |M0 | | | | | Vol+ | |
* |-----------------------------------------------------------|
* | | | | |Alt |Prev|Vol-|Next|
* `-----------------------------------------------------------'
*/
[_SPC] = KEYMAP_ISO_SPLITRSHIFT(
KC_PSCR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \
_______, KC_PAUS, KC_UP, GER_BRC_L, GER_BRC_R, _______, _______, GER_PAR_L, GER_PAR_R, _______, _______, _______, _______, _______, \
_______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, KC_MPLY, \
_______, _______, _______, _______, GER_ANG_L, GER_ANG_R, KC_SPACE, M(0), _______, _______, _______, _______, _______, KC_VOLU, \
_______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT),
/* Keymap 2: Tab Layer w/ vim pageup, modified with Tab (by holding tab)
* ,-----------------------------------------------------------.
* |WAKE| | | | | | | | | | | | |Insert| TAB+GRC = WAKE
* |-----------------------------------------------------------|
* | | | | | | | | | { | } | | | | |
* |-----------------------------------------------------------|
* | | | | | | |Pos1|PgDn|PgUp|End| | |Retrn |
* |-----------------------------------------------------------|
* | | | | | | | |AF2| | | | | PgUp | |
* |-----------------------------------------------------------|
* | | | | |Alt |Pos1|PgDn|End |
* `-----------------------------------------------------------'
*/
[_TAB] = KEYMAP_ISO_SPLITRSHIFT(
KC_WAKE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, \
_______, _______, _______, _______, _______, _______, _______, GER_CUR_L, GER_CUR_R, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, _______, KC_ENT, \
_______, _______, _______, _______, _______, _______, _______, M(1), _______, _______, _______, _______, _______, KC_PGUP, \
_______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END),
/* Keymap 3: Split right shift Numpad toggle Layer (by tapping the split rshift key)
* ,-----------------------------------------------------------.
* |RSET| | | | | | | 7| 8| 9| | | |Backsp |
* |-----------------------------------------------------------|
* | | | | | | | | 4 | 5 | 6 | | | | \ |
* |-----------------------------------------------------------|
* | | L | L | | | | | 1 | 2 | 3 | | | Return |
* |-----------------------------------------------------------|
* | | | L | L | L | L | L | L | | 0 | | /| Up | | All "L"s represent
* |-----------------------------------------------------------| LED controlling
* |Ctrl|Win |Alt | |Alt |Left|Down|Right|
* `-----------------------------------------------------------'
*/
[_SFX] = KEYMAP_ISO_SPLITRSHIFT(
RESET, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, _______, _______, KC_BSPC, \
_______, _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, _______, _______, _______, KC_BSLS, \
_______, F(2), F(3), _______, _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, XXXXXXX, KC_ENT, \
_______, F(4), F(5), F(6), F(7), F(8), F(9), _______, _______, KC_0, _______, KC_SLSH, _______, KC_UP, \
_______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT),
};
enum function_id {
LAUNCH,
RGBLED_TOGGLE,
RGBLED_STEP_MODE,
RGBLED_INCREASE_HUE,
RGBLED_DECREASE_HUE,
RGBLED_INCREASE_SAT,
RGBLED_DECREASE_SAT,
RGBLED_INCREASE_VAL,
RGBLED_DECREASE_VAL,
};
const uint16_t PROGMEM fn_actions[] = {
[1] = ACTION_FUNCTION(LAUNCH),
[2] = ACTION_FUNCTION(RGBLED_TOGGLE),
[3] = ACTION_FUNCTION(RGBLED_STEP_MODE),
[4] = ACTION_FUNCTION(RGBLED_INCREASE_HUE),
[5] = ACTION_FUNCTION(RGBLED_DECREASE_HUE),
[6] = ACTION_FUNCTION(RGBLED_INCREASE_SAT),
[7] = ACTION_FUNCTION(RGBLED_DECREASE_SAT),
[8] = ACTION_FUNCTION(RGBLED_INCREASE_VAL),
[9] = ACTION_FUNCTION(RGBLED_DECREASE_VAL),
[10] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ENT),
};
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:
return (record->event.pressed ?
MACRO( D(RALT), T(SPC), U(RALT), END )
:MACRO( END ));
break;
case 1:
return (record->event.pressed ?
MACRO( D(LALT), T(F2), U(LALT), END )
:MACRO( END ));
break;
}
return MACRO_NONE;
};
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;
}
}

View file

@ -0,0 +1,36 @@
toneman77's Satan Layout
=====================
##Quantum MK Firmware
For the full Quantum feature list, see the parent readme.md.
* heavily modified ISO (!) layout with split right shift key
* spaceFn
* Dual-Role keys:
*
| Original key | when tapped | when held |
| ---------------- | ------------- | ------------- |
| Space | Space | layer change |
| Caps lock | Escape | Control |
| Tab | Tab | layer change |
| Enter | Enter | Control |
* Lockable layer for LED functions and numpad
* vim-style arrow keys on hjkl (spacefn layer)
* corresponding Home/PgDn/PgUp/End on hjkl (tab layer)
* bonus arrow keys in the bottom right corner on Alt/Win/Menu/rCtrl/Shift
* more bonus arrow keys on wasd (spacefn layer)
* media keys prev/next/play/vol+/vol- (spacefn layer)
* firmware bootloader button
* WS2812 RGB Underglow Support (not needed anymore to solder directly to the atmega)
* additional brackets that only work in german layout due to horrible placement
in the default qwertz layout
### Additional Credits
* Keymap has been based on TerryMathews' fork of Aqoush's fork of qmk-satan-rgb. [here](https://github.com/TerryMathews/qmk-satan-rgb/tree/master/keyboard/satan)
* nice visualization of the layers [here](http://www.keyboard-layout-editor.com/#/gists/aba4e4396459ede85bc66a22cee88e48)
* no-need-to-solder-on-chip picture:
![no need to solder directly on the chip anymore](LEDpinSatan.jpg)
* special thanks to /u/TerryMathews who suggested the pin PB2, so soldering
directly on the atmega is not needed anymore. Happened on [reddit](https://www.reddit.com/r/MechanicalKeyboards/comments/4ghq9z/photos_satan_rgb60_w1976/d2k5tra)

View file

@ -0,0 +1,4 @@
#!/bin/bash
sudo dfu-programmer atmega32u4 erase --force
sudo dfu-programmer atmega32u4 flash clear_flash.hex
sudo dfu-programmer atmega32u4 reset

View file

@ -62,6 +62,33 @@
{k40, k41, k42, KC_NO, KC_NO, k45, KC_NO, KC_NO, KC_NO, k49, k4a, k4b, k4c, k4d} \ {k40, k41, k42, KC_NO, KC_NO, k45, KC_NO, KC_NO, KC_NO, k49, k4a, k4b, k4c, k4d} \
} }
/* ISO w/ split right shift key matrix layout
* ,-----------------------------------------------------------.
* | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d |
* |-----------------------------------------------------------|
* | 10 | 11| 12| 13| 14| 15| 16| 17| 18| 19| 1a| 1b| 1c| 1d |
* |-----------------------------------------------------------|
* | 20 | 21| 22| 23| 24| 25| 26| 27| 28| 29| 2a| 2b| 2c|2d |
* |-----------------------------------------------------------|
* | 30 | 31| 32| 33| 34| 35| 36| 37| 38| 39| 3a| 3b| 3c| 3d |
* |-----------------------------------------------------------|
* | 40 | 41 | 42 | 45 | 4a | 4b | 4c | 4d |
* `-----------------------------------------------------------'
*/
#define KEYMAP_ISO_SPLITRSHIFT( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, \
k40, k41, k42, k45, k4a, k4b, k4c, k4d \
) \
{ \
{k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \
{k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \
{k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d}, \
{k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d}, \
{k40, k41, k42, KC_NO, KC_NO, k45, KC_NO, KC_NO, KC_NO, KC_NO, k4a, k4b, k4c, k4d} \
}
void matrix_init_user(void); void matrix_init_user(void);
void matrix_scan_user(void); void matrix_scan_user(void);

View file

@ -51,21 +51,25 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options # Build Options
# comment out to disable the options. # change yes to no to disable
# #
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
CONSOLE_ENABLE ?= yes # Console for debug(+400) CONSOLE_ENABLE ?= yes # Console for debug(+400)
COMMAND_ENABLE ?= yes # Commands for debug and configuration COMMAND_ENABLE ?= yes # Commands for debug and configuration
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
RGBLIGHT_ENABLE ?= no # Enable keyboard underlight functionality (+4870) SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality (+1150) # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
MIDI_ENABLE ?= no # MIDI controls NKRO_ENABLE ?= yes # USB Nkey Rollover
AUDIO_ENABLE ?= no BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default
UNICODE_ENABLE ?= no # Unicode MIDI_ENABLE ?= no # MIDI controls
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID 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 ifndef QUANTUM_DIR
include ../../Makefile include ../../Makefile
endif endif

162
keyboards/tv44/config.h Normal file
View file

@ -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 0x8844
#define DEVICE_VER 0x0002
#define MANUFACTURER Evan Sailer
#define PRODUCT TheVan 44
#define DESCRIPTION keyboard firmware for TV44
/* key matrix size */
#define MATRIX_ROWS 4
#define MATRIX_COLS 12
/*
* 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 { D7, B5, F7, D4 }
#define MATRIX_COL_PINS { D2, D3, D5, D6, B4, B6, F6, F5, F4, F1, F0, B3 }
#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

View file

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

View file

@ -0,0 +1,8 @@
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include "../../config.h"
// place overrides here
#endif

View file

@ -0,0 +1,97 @@
#include "tv44.h"
#include "action_layer.h"
#include "eeconfig.h"
extern keymap_config_t keymap_config;
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _QW 0
#define _DV 1
#define _CM 2
#define _L1 3
#define _L2 4
#define _L3 5
// Macro name shortcuts
#define QWERTY M(_QW)
#define DVORAK M(_DV)
#define COLEMAK M(_CM)
// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QW] = { /* 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 },
{MO(_L1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, MO(_L1) },
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_F, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MO(_L2) },
{KC_LCTL, MO(_L2), KC_LGUI, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_RALT, KC_ESC, XXXXXXX, TG(_L3) }
},
[_DV] = { /* Dvorak */
{KC_TAB, KC_COMM, KC_DOT, KC_SLSH, KC_Q, KC_Q, KC_Q, KC_Q, KC_Q, KC_Q, KC_Q, KC_BSPC },
{MO(_L1), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, MO(_L1) },
{KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, MO(_L2) },
{KC_LCTL, MO(_L2), KC_LGUI, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_RALT, KC_ESC, XXXXXXX, TG(_L3) }
},
[_CM] = { /* Colemak */
{KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC },
{MO(_L1), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, MO(_L1) },
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, MO(_L2) },
{KC_LCTL, MO(_L2), KC_LGUI, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_RALT, KC_ESC, XXXXXXX, TG(_L3) }
},
[_L1] = { /* LAYER 1 */
{KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL },
{_______, KC_BSLS, KC_QUOT, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, _______ },
{_______, KC_ESC, _______, KC_PSCR, _______, _______, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, KC_RSFT },
{_______, KC_LGUI, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, XXXXXXX, _______ }
},
[_L2] = { /* LAYER 2 */
{_______, QWERTY, DVORAK, COLEMAK, _______, _______, _______, KC_7, KC_8, KC_9, KC_0, _______ },
{KC_ESC, KC_PIPE, KC_DQUO, KC_UNDS, KC_PLUS, LSFT(KC_LBRC), LSFT(KC_RBRC), KC_4, KC_5, KC_6, KC_VOLU, KC_ENT },
{_______, _______, _______, _______, _______, _______, KC_0, KC_1, KC_2, KC_3, KC_VOLD, _______ },
{_______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, XXXXXXX, _______ }
},
[_L3] = { /* LAYER 3 */
{_______, _______, _______, _______, _______, _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, _______ },
{KC_ESC, _______, _______, _______, _______, _______, _______, KC_F5, KC_F6, KC_F7, KC_F8, _______ },
{KC_LSFT, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_F9, KC_F10, KC_F11, KC_F12, _______ },
{_______, KC_LSFT, KC_B, KC_SPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_C, _______, _______, XXXXXXX, _______ }
}
};
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 _DV:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_DV);
}
break;
case _QW:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_QW);
}
break;
case _CM:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_CM);
}
break;
}
return MACRO_NONE;
};

View file

@ -0,0 +1 @@
# The default keymap for tv44

View file

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

View file

@ -0,0 +1,8 @@
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include "../../config.h"
// place overrides here
#endif

View file

@ -0,0 +1,92 @@
#include "tv44.h"
#include "action_layer.h"
#include "eeconfig.h"
extern keymap_config_t keymap_config;
#define _DV 0
#define _QW 1
#define _CM 2
#define _L1 3
#define _L2 4
// Macro name shortcuts
#define DVORAK M(_DV)
#define QWERTY M(_QW)
#define COLEMAK M(_CM)
// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_DV] = { /* 0: Dvorak */
{KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC },
{MO(_L1), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_ENT },
{KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT },
{KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_SLSH, KC_MINS, XXXXXXX, MO(_L2) }
},
[_QW] = { /* 1: 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 },
{MO(_L1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT },
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT },
{KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_SLSH, KC_MINS, XXXXXXX, MO(_L2) }
},
[_CM] = { /* 2: Colemak */
{KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC },
{MO(_L1), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_ENT },
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT },
{KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_SLSH, KC_MINS, XXXXXXX, MO(_L2) }
},
[_L1] = {/* 1: FN 1 */
{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL },
{_______, KC_BSLS, KC_QUOT, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, _______ },
{_______, _______, _______, KC_PSCR, _______, _______, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, KC_RSFT },
{KC_ESC, KC_LGUI, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, KC_SLSH, _______, _______ }
},
[_L2] = { /* 2: FN 2 */
{KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_ESC },
{_______, KC_F11, KC_F12, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_VOLU, KC_ENT },
{_______, _______, _______, _______, _______, _______, _______, _______, KC_END, KC_PGDN, KC_VOLD, _______ },
{QWERTY, DVORAK, COLEMAK, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______ }
}
};
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 _DV:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_DV);
}
break;
case _QW:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_QW);
}
break;
case _CM:
if (record->event.pressed) {
persistant_default_layer_set(1UL<<_CM);
}
break;
}
return MACRO_NONE;
};

View file

@ -0,0 +1 @@
# The default keymap for tv44

28
keyboards/tv44/readme.md Normal file
View file

@ -0,0 +1,28 @@
tv44 keyboard firmware
======================
## Quantum MK Firmware
For the full Quantum feature list, see [the parent readme.md](/doc/readme.md).
## Building
Download or clone the whole firmware and navigate to the keyboards/tv44 folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file.
Depending on which keymap you would like to use, you will have to compile slightly differently.
### Default
To build with the default keymap, simply run `make`.
### Other Keymaps
Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files.
To build the firmware binary hex file with a keymap just do `make` with `keymap` option like:
```
$ make keymap=[default|jack|<name>]
```
Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/`

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