Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e4b5c44262 | ||
|
|
074be4fe5e | ||
|
|
670ff2d19f | ||
|
|
e95283b545 | ||
|
|
8725197ad6 | ||
|
|
d67b99ff3c | ||
|
|
7c2a7ab817 | ||
|
|
5b9667a4bf | ||
|
|
0cde880747 | ||
|
|
b09dc19d32 |
No files matched your search
@@ -54,6 +54,7 @@ util/Win_Check_Output.txt
|
|||||||
.vscode/tasks.json
|
.vscode/tasks.json
|
||||||
.vscode/last.sql
|
.vscode/last.sql
|
||||||
.vscode/temp.sql
|
.vscode/temp.sql
|
||||||
|
.vscode/ipch/
|
||||||
.stfolder
|
.stfolder
|
||||||
.tags
|
.tags
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,7 @@
|
|||||||
* [LED Matrix](feature_led_matrix.md)
|
* [LED Matrix](feature_led_matrix.md)
|
||||||
* [Macros](feature_macros.md)
|
* [Macros](feature_macros.md)
|
||||||
* [Mouse Keys](feature_mouse_keys.md)
|
* [Mouse Keys](feature_mouse_keys.md)
|
||||||
|
* [OLED Driver](feature_oled_driver)
|
||||||
* [One Shot Keys](feature_advanced_keycodes.md#one-shot-keys)
|
* [One Shot Keys](feature_advanced_keycodes.md#one-shot-keys)
|
||||||
* [Pointing Device](feature_pointing_device.md)
|
* [Pointing Device](feature_pointing_device.md)
|
||||||
* [PS/2 Mouse](feature_ps2_mouse.md)
|
* [PS/2 Mouse](feature_ps2_mouse.md)
|
||||||
|
|||||||
Executable
+15
@@ -0,0 +1,15 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
#define LAYOUT_ortho_4x4( \
|
||||||
|
K00, K01, K02, K03, \
|
||||||
|
K10, K11, K12, K13, \
|
||||||
|
K20, K21, K22, K23, \
|
||||||
|
K30, K31, K32, K33 \
|
||||||
|
) { \
|
||||||
|
{ K00, K01, K02, K03 }, \
|
||||||
|
{ K10, K11, K12, K13 }, \
|
||||||
|
{ K20, K21, K22, K23 }, \
|
||||||
|
{ K30, K31, K32, K33 } \
|
||||||
|
}
|
||||||
Executable
+46
@@ -0,0 +1,46 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
/* USB Device descriptor parameter */
|
||||||
|
#define VENDOR_ID 0xFEED
|
||||||
|
#define PRODUCT_ID 0x6060
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER KPrepublic
|
||||||
|
#define PRODUCT bm16s
|
||||||
|
#define DESCRIPTION KPrepublic bm16s
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 4
|
||||||
|
#define MATRIX_COLS 4
|
||||||
|
|
||||||
|
/* key matrix pins */
|
||||||
|
#define MATRIX_ROW_PINS { D1, D0, D3, D2 }
|
||||||
|
#define MATRIX_COL_PINS { F7, F6, D4, D6 }
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
/* COL2ROW or ROW2COL */
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
/* number of backlight levels */
|
||||||
|
|
||||||
|
#ifdef BACKLIGHT_PIN
|
||||||
|
#define BACKLIGHT_LEVELS 3
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* 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
|
||||||
|
|
||||||
|
#define RGB_DI_PIN E2
|
||||||
|
#ifdef RGB_DI_PIN
|
||||||
|
#define RGBLIGHT_ANIMATIONS
|
||||||
|
#define RGBLED_NUM 16
|
||||||
|
#define RGBLIGHT_HUE_STEP 8
|
||||||
|
#define RGBLIGHT_SAT_STEP 8
|
||||||
|
#define RGBLIGHT_VAL_STEP 8
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "bm16s",
|
||||||
|
"url": "",
|
||||||
|
"maintainer": "qmk",
|
||||||
|
"width": 4,
|
||||||
|
"height": 4,
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT_ortho_4x4": {
|
||||||
|
"key_count": 16,
|
||||||
|
"layout": [
|
||||||
|
{"x":0, "y":0},
|
||||||
|
{"x":1, "y":0},
|
||||||
|
{"x":2, "y":0},
|
||||||
|
{"x":3, "y":0},
|
||||||
|
{"x":0, "y":1},
|
||||||
|
{"x":1, "y":1},
|
||||||
|
{"x":2, "y":1},
|
||||||
|
{"x":3, "y":1},
|
||||||
|
{"x":0, "y":2},
|
||||||
|
{"x":1, "y":2},
|
||||||
|
{"x":2, "y":2},
|
||||||
|
{"x":3, "y":2},
|
||||||
|
{"x":0, "y":3},
|
||||||
|
{"x":1, "y":3},
|
||||||
|
{"x":2, "y":3},
|
||||||
|
{"x":3, "y":3}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Executable
+16
@@ -0,0 +1,16 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT_ortho_4x4(
|
||||||
|
KC_KP_7, KC_KP_8, KC_KP_9, MO(1), \
|
||||||
|
KC_KP_4, KC_KP_5, KC_KP_6, KC_PMNS, \
|
||||||
|
KC_KP_1, KC_KP_2, KC_KP_3, KC_PPLS, \
|
||||||
|
KC_KP_0, KC_PDOT, KC_PCMM, KC_PENT \
|
||||||
|
),
|
||||||
|
[1] = LAYOUT_ortho_4x4(
|
||||||
|
RESET, BL_STEP, _______, KC_VOLU, \
|
||||||
|
BL_TOGG, BL_DEC, BL_INC, KC_VOLD, \
|
||||||
|
RGB_TOG, RGB_MOD, RGB_HUI, KC_MUTE, \
|
||||||
|
RGB_SAI, RGB_SAD, RGB_HUD, _______ \
|
||||||
|
),
|
||||||
|
};
|
||||||
Executable
+20
@@ -0,0 +1,20 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
#define RGB_BRU RGB_VAI
|
||||||
|
#define RGB_BRD RGB_VAD
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
[0] = LAYOUT_ortho_4x4(
|
||||||
|
KC_BRIU, _______, _______, KC_VOLU, \
|
||||||
|
KC_BRID, _______, _______, KC_VOLD, \
|
||||||
|
_______, _______, _______, KC_MUTE, \
|
||||||
|
KC_MPRV, KC_MPLY, KC_MNXT, MO(1) \
|
||||||
|
),
|
||||||
|
[1] = LAYOUT_ortho_4x4(
|
||||||
|
RESET, _______, _______, _______, \
|
||||||
|
RGB_SPD, RGB_BRU, RGB_SPI, _______, \
|
||||||
|
RGB_RMOD, RGB_BRD, RGB_MOD, _______, \
|
||||||
|
RGB_TOG, _______, _______, _______ \
|
||||||
|
),
|
||||||
|
};
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# bm16s
|
||||||
|
|
||||||
|
A 16-key macropad, with USB C and per-key RGB backlighting. This is a variant of the BM16A, but with low profile Choc switches.
|
||||||
|
|
||||||
|
Keyboard Maintainer: QMK Community
|
||||||
|
Hardware Supported: The PCBs, controllers supported
|
||||||
|
Hardware Availability: [KPrepublic](https://kprepublic.com/collections/pcb/products/bm16s-16-keys-custom-mechanical-keyboard-pcb-plate-programmed-numpad-layouts-qmk-firmware-with-rgb-switch-leds-choc-switch); [AliExpress](https://www.aliexpress.com/item/bm16s-16-keys-Custom-Mechanical-Keyboard-PCB-plate-programmed-numpad-layouts-qmk-firmware-with-rgb-switch/32999247908.html); [Massdrop](https://www.massdrop.com/buy/78169)
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make bm16s:default
|
||||||
|
|
||||||
|
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
||||||
Executable
+72
@@ -0,0 +1,72 @@
|
|||||||
|
# MCU name
|
||||||
|
MCU = atmega32u4
|
||||||
|
|
||||||
|
# Processor frequency.
|
||||||
|
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||||
|
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||||
|
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||||
|
# automatically to create a 32-bit value in your source code.
|
||||||
|
#
|
||||||
|
# This will be an integer division of F_USB below, as it is sourced by
|
||||||
|
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||||
|
# does not *change* the processor frequency - it should merely be updated to
|
||||||
|
# reflect the processor speed set externally so that the code can use accurate
|
||||||
|
# software delays.
|
||||||
|
F_CPU = 16000000
|
||||||
|
|
||||||
|
#
|
||||||
|
# LUFA specific
|
||||||
|
#
|
||||||
|
# Target architecture (see library "Board Types" documentation).
|
||||||
|
ARCH = AVR8
|
||||||
|
|
||||||
|
# Input clock frequency.
|
||||||
|
# This will define a symbol, F_USB, in all source code files equal to the
|
||||||
|
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||||
|
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||||
|
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||||
|
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||||
|
# at the end, this will be done automatically to create a 32-bit value in your
|
||||||
|
# source code.
|
||||||
|
#
|
||||||
|
# If no clock division is performed on the input clock inside the AVR (via the
|
||||||
|
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||||
|
F_USB = $(F_CPU)
|
||||||
|
|
||||||
|
# Interrupt driven control endpoint task(+60)
|
||||||
|
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||||
|
|
||||||
|
# Bootloader selection
|
||||||
|
# Teensy halfkay
|
||||||
|
# Pro Micro caterina
|
||||||
|
# Atmel DFU atmel-dfu
|
||||||
|
# LUFA DFU lufa-dfu
|
||||||
|
# QMK DFU qmk-dfu
|
||||||
|
# atmega32a bootloadHID
|
||||||
|
BOOTLOADER = atmel-dfu
|
||||||
|
|
||||||
|
|
||||||
|
# If you don't know the bootloader type, then you can specify the
|
||||||
|
# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line
|
||||||
|
# Teensy halfKay 512
|
||||||
|
# Teensy++ halfKay 1024
|
||||||
|
# Atmel DFU loader 4096
|
||||||
|
# LUFA bootloader 4096
|
||||||
|
# USBaspLoader 2048
|
||||||
|
# OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
# comment out to disable the options.
|
||||||
|
#
|
||||||
|
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
|
||||||
|
MOUSEKEY_ENABLE = yes # Mouse keys
|
||||||
|
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||||
|
CONSOLE_ENABLE = no # Console for debug
|
||||||
|
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||||
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
|
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||||
|
AUDIO_ENABLE = no
|
||||||
|
RGBLIGHT_ENABLE = yes
|
||||||
|
|
||||||
|
LAYOUTS = ortho_4x4
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
/* Copyright 2019 Jeremy Bernhardt
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include "butterstick.h"
|
||||||
|
|
||||||
|
// Optional override functions below.
|
||||||
|
// You can leave any or all of these undefined.
|
||||||
|
// These are only required if you want to perform custom actions.
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
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) {
|
||||||
|
#ifdef DEBUG_MATRIX
|
||||||
|
for (uint8_t c = 0; c < MATRIX_COLS; c++)
|
||||||
|
for (uint8_t r = 0; r < MATRIX_ROWS; r++)
|
||||||
|
if (matrix_is_on(r, c)) xprintf("r:%d c:%d \n", r, c);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
matrix_scan_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
// put your per-action keyboard code here
|
||||||
|
// runs for every action, just before processing by the firmware
|
||||||
|
|
||||||
|
return process_record_user(keycode, record);
|
||||||
|
}
|
||||||
|
|
||||||
|
void led_set_kb(uint8_t usb_led) {
|
||||||
|
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||||
|
|
||||||
|
led_set_user(usb_led);
|
||||||
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
#define LAYOUT_butter( \
|
||||||
|
k09, k08, k07, k06, k05, k04, k03, k02, k01, k00, \
|
||||||
|
k19, k18, k17, k16, k15, k14, k13, k12, k11, k10 \
|
||||||
|
) { \
|
||||||
|
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09}, \
|
||||||
|
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19}, \
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
/* USB Device descriptor parameter */
|
||||||
|
#define VENDOR_ID 0xFEED
|
||||||
|
#define PRODUCT_ID 0x1337
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER g Heavy Industries
|
||||||
|
#define PRODUCT Butter Stick
|
||||||
|
#define DESCRIPTION Its a stick of butter
|
||||||
|
#define VERSION "Paula Deen"
|
||||||
|
|
||||||
|
#define DEBOUNCING_DELAY 5
|
||||||
|
#define FORCE_NKRO
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 2
|
||||||
|
#define MATRIX_COLS 10
|
||||||
|
#define MATRIX_ROW_PINS { F4, F5 }
|
||||||
|
#define MATRIX_COL_PINS { B0, B1, B2, B3, B4, B5, B6, B7, C6, C7}
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
/* COL2ROW, ROW2COL*/
|
||||||
|
#define DIODE_DIRECTION ROW2COL
|
||||||
|
|
||||||
@@ -0,0 +1,183 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
#include "sten.h"
|
||||||
|
/*
|
||||||
|
* Key names are inherited from steno machines
|
||||||
|
* .-----------------------------------------------------.
|
||||||
|
* | LSU | LFT | LP | LH | ST1 | RF | RP | RL | RT | RD |
|
||||||
|
* |-----------------------------------------------------|
|
||||||
|
* | LSD | LK | LW | LR | ST2 | RR | RB | RG | RS | RZ |
|
||||||
|
* '-----------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Function prefixes
|
||||||
|
#define MEDIA (LSD | LK | LW | LR)
|
||||||
|
#define FUNCT (LSD | LK | LP | LH)
|
||||||
|
#define MOVE (LSU | LFT | LP | LH)
|
||||||
|
#define SYMB (RD | RZ)
|
||||||
|
#define NUMA (LW | LR)
|
||||||
|
#define NUMB (RR | RB)
|
||||||
|
|
||||||
|
// QMK Layer Numbers
|
||||||
|
#define BASE 0
|
||||||
|
#define GAME 1
|
||||||
|
|
||||||
|
// Do not change QMK Layer 0! This is your main keyboard.
|
||||||
|
// Make your QMK modifications to the later layers, to add
|
||||||
|
// keys/customize on the first layer modify processQwerty():
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[BASE] = LAYOUT_butter(
|
||||||
|
STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR,
|
||||||
|
STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR
|
||||||
|
),
|
||||||
|
// I don't game don't roast me thanks
|
||||||
|
[GAME] = LAYOUT_butter(
|
||||||
|
KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_ENT,
|
||||||
|
KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, TO(BASE)
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
// Note: You can only use basic keycodes here!
|
||||||
|
// P() is just a wrapper to make your life easier, any C code can be executed.
|
||||||
|
// Only the longest matched chord is run!
|
||||||
|
//
|
||||||
|
// http://docs.gboards.ca
|
||||||
|
uint32_t processQwerty(bool lookup) {
|
||||||
|
// SECRET AGENT CHORDS
|
||||||
|
P( LSU | LK | RS | RD, SEND_STRING(VERSION); SEND_STRING(__DATE__));
|
||||||
|
P( LSD | RZ, SEND(KC_SPC));
|
||||||
|
|
||||||
|
// Dual chords
|
||||||
|
P( LP | LH, CLICK_MOUSE(KC_MS_BTN2));
|
||||||
|
P( ST1 | RF, CLICK_MOUSE(KC_MS_BTN1));
|
||||||
|
P( LSU | LFT, SEND(KC_ESC));
|
||||||
|
P( LSD | LK, SEND(KC_LSFT));
|
||||||
|
P( RZ | RS, SEND(KC_LSFT));
|
||||||
|
P( ST2 | RR, SEND(KC_SPC));
|
||||||
|
P( RP | RL, SEND(KC_LGUI));
|
||||||
|
P( RT | RD, SEND(KC_LCTL));
|
||||||
|
P( RL | RT, SEND(KC_LALT));
|
||||||
|
P( LSU | LSD | LFT | LK, SEND(KC_LCTL));
|
||||||
|
P( RS | RT | RD | RZ, SEND(KC_ENT));
|
||||||
|
|
||||||
|
// Function Layer
|
||||||
|
P( FUNCT | RF, SEND(KC_F1));
|
||||||
|
P( FUNCT | RP, SEND(KC_F2));
|
||||||
|
P( FUNCT | RL, SEND(KC_F3));
|
||||||
|
P( FUNCT | RT, SEND(KC_F4));
|
||||||
|
P( FUNCT | RF | RR, SEND(KC_F5));
|
||||||
|
P( FUNCT | RP | RB, SEND(KC_F6));
|
||||||
|
P( FUNCT | RL | RG, SEND(KC_F7));
|
||||||
|
P( FUNCT | RT | RS, SEND(KC_F8));
|
||||||
|
P( FUNCT | RR, SEND(KC_F9));
|
||||||
|
P( FUNCT | RB, SEND(KC_F10));
|
||||||
|
P( FUNCT | RG, SEND(KC_F11));
|
||||||
|
P( FUNCT | RS, SEND(KC_F12));
|
||||||
|
|
||||||
|
// Movement Layer
|
||||||
|
P( MOVE | RF, SEND(KC_LEFT));
|
||||||
|
P( MOVE | RP, SEND(KC_DOWN));
|
||||||
|
P( MOVE | RL, SEND(KC_UP));
|
||||||
|
P( MOVE | RT, SEND(KC_RIGHT));
|
||||||
|
P( MOVE | ST1, SEND(KC_PGUP));
|
||||||
|
P( MOVE | ST2, SEND(KC_PGDN));
|
||||||
|
|
||||||
|
// Media Layer
|
||||||
|
P( MEDIA | RF, SEND(KC_MPRV));
|
||||||
|
P( MEDIA | RP, SEND(KC_MPLY));
|
||||||
|
P( MEDIA | RL, SEND(KC_MPLY));
|
||||||
|
P( MEDIA | RT, SEND(KC_MNXT));
|
||||||
|
P( MEDIA | RG, SEND(KC_VOLU));
|
||||||
|
P( MEDIA | RB, SEND(KC_VOLD));
|
||||||
|
P( MEDIA | RS, SEND(KC_MUTE));
|
||||||
|
|
||||||
|
// Number Row, Right
|
||||||
|
P( NUMB | LSU, SEND(KC_1));
|
||||||
|
P( NUMB | LFT, SEND(KC_2));
|
||||||
|
P( NUMB | LP, SEND(KC_3));
|
||||||
|
P( NUMB | LH, SEND(KC_4));
|
||||||
|
P( NUMB | ST1, SEND(KC_5));
|
||||||
|
P( NUMB | RF, SEND(KC_6));
|
||||||
|
P( NUMB | RP, SEND(KC_7));
|
||||||
|
P( NUMB | RL, SEND(KC_8));
|
||||||
|
P( NUMB | RT, SEND(KC_9));
|
||||||
|
P( NUMB | RD, SEND(KC_0));
|
||||||
|
|
||||||
|
// Number Row, Left
|
||||||
|
P( NUMA | LSU, SEND(KC_1));
|
||||||
|
P( NUMA | LFT, SEND(KC_2));
|
||||||
|
P( NUMA | LP, SEND(KC_3));
|
||||||
|
P( NUMA | LH, SEND(KC_4));
|
||||||
|
P( NUMA | ST1, SEND(KC_5));
|
||||||
|
P( NUMA | RF, SEND(KC_6));
|
||||||
|
P( NUMA | RP, SEND(KC_7));
|
||||||
|
P( NUMA | RL, SEND(KC_8));
|
||||||
|
P( NUMA | RT, SEND(KC_9));
|
||||||
|
P( NUMA | RD, SEND(KC_0));
|
||||||
|
|
||||||
|
|
||||||
|
// Symbols and Numbers
|
||||||
|
P( SYMB | LP | LW, SEND(KC_LSFT); SEND(KC_9)); // (
|
||||||
|
P( SYMB | LH | LR, SEND(KC_LSFT); SEND(KC_0)); // )
|
||||||
|
P( SYMB | ST1 | ST2, SEND(KC_GRV)); // `
|
||||||
|
P( SYMB | RR | RF, SEND(KC_LSFT); SEND(KC_3)); // #
|
||||||
|
P( SYMB | LFT | LK, SEND(KC_LSFT); SEND(KC_4)); // $
|
||||||
|
P( SYMB | LSU, SEND(KC_LSFT); SEND(KC_1)); // !
|
||||||
|
P( SYMB | LSD, SEND(KC_LSFT); SEND(KC_5)); // %
|
||||||
|
P( SYMB | LFT, SEND(KC_LSFT); SEND(KC_2)); // @
|
||||||
|
P( SYMB | LK, SEND(KC_LSFT); SEND(KC_6)); // ^
|
||||||
|
P( SYMB | LP, SEND(KC_LSFT); SEND(KC_LBRC)); // {
|
||||||
|
P( SYMB | LW, SEND(KC_LBRC));
|
||||||
|
P( SYMB | LH, SEND(KC_LSFT); SEND(KC_RBRC)); // }
|
||||||
|
P( SYMB | LR, SEND(KC_RBRC));
|
||||||
|
P( SYMB | ST1, SEND(KC_LSFT); SEND(KC_BSLS)); // |
|
||||||
|
P( SYMB | ST2, SEND(KC_LSFT); SEND(KC_GRV)); // ~
|
||||||
|
P( SYMB | RP | RB, SEND(KC_QUOT));
|
||||||
|
P( SYMB | RP | RG, SEND(KC_LSFT); SEND(KC_QUOT)); // "
|
||||||
|
P( SYMB | RF, SEND(KC_KP_PLUS));
|
||||||
|
P( SYMB | RR, SEND(KC_LSFT); SEND(KC_7)); // &
|
||||||
|
P( SYMB | RP, SEND(KC_MINS));
|
||||||
|
P( SYMB | RB, SEND(KC_EQL));
|
||||||
|
P( SYMB | RL, SEND(KC_SLSH));
|
||||||
|
P( SYMB | RG, SEND(KC_COMM));
|
||||||
|
P( SYMB | RT, SEND(KC_PAST));
|
||||||
|
P( SYMB | RS, SEND(KC_DOT));
|
||||||
|
|
||||||
|
// Letters
|
||||||
|
P( LSU | LSD, SEND(KC_A));
|
||||||
|
P( LFT | LK, SEND(KC_S));
|
||||||
|
P( LP | LW, SEND(KC_D));
|
||||||
|
P( LH | LR, SEND(KC_F));
|
||||||
|
P( ST1 | ST2, SEND(KC_G));
|
||||||
|
P( RF | RR, SEND(KC_H));
|
||||||
|
P( RT | RS, SEND(KC_L));
|
||||||
|
P( RD | RZ, SEND(KC_SCLN));
|
||||||
|
P( RG | RL, SEND(KC_K));
|
||||||
|
P( RP | RB, SEND(KC_J));
|
||||||
|
P( LSU, SEND(KC_Q));
|
||||||
|
P( LSD, SEND(KC_Z));
|
||||||
|
P( LFT, SEND(KC_W));
|
||||||
|
P( LK, SEND(KC_X));
|
||||||
|
P( LP, SEND(KC_E));
|
||||||
|
P( LW, SEND(KC_C));
|
||||||
|
P( LH, SEND(KC_R));
|
||||||
|
P( LR, SEND(KC_V));
|
||||||
|
P( ST1, SEND(KC_T));
|
||||||
|
P( ST2, SEND(KC_B));
|
||||||
|
P( RF, SEND(KC_Y));
|
||||||
|
P( RR, SEND(KC_N));
|
||||||
|
P( RP, SEND(KC_U));
|
||||||
|
P( RB, SEND(KC_M));
|
||||||
|
P( RL, SEND(KC_I));
|
||||||
|
P( RG, SEND(KC_COMM));
|
||||||
|
P( RT, SEND(KC_O));
|
||||||
|
P( RS, SEND(KC_DOT));
|
||||||
|
P( RD, SEND(KC_P));
|
||||||
|
P( RZ, SEND(KC_SLSH));
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Don't fuck with this, thanks.
|
||||||
|
size_t keymapsCount = sizeof(keymaps)/sizeof(keymaps[0]);
|
||||||
Whitespace-only changes.
@@ -0,0 +1,14 @@
|
|||||||
|
# Butter Stick
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
A chorded 20% keyboard packing full sized useage into your pocket. More info on [gboards.ca](http://docs.gboards.ca/Meet-Butter-Stick)!
|
||||||
|
|
||||||
|
Keyboard Maintainer: [Germ](https://github.com/germ)
|
||||||
|
Hardware Availability: [g Heavy Industries](https://www.gboards.ca/product/butter-stick-limited-edition)
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make butterstick:default
|
||||||
|
|
||||||
|
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
# MCU name
|
||||||
|
MCU = atmega32u4
|
||||||
|
F_CPU = 16000000
|
||||||
|
ARCH = AVR8
|
||||||
|
F_USB = $(F_CPU)
|
||||||
|
|
||||||
|
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT -DONLYQWERTY -DDEBUG_MATRIX
|
||||||
|
SRC += sten.c
|
||||||
|
EXTRAFLAGS += -flto
|
||||||
|
|
||||||
|
|
||||||
|
BOOTLOADER = atmel-dfu
|
||||||
|
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||||
|
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||||
|
CONSOLE_ENABLE = yes # Console for debug(+400)
|
||||||
|
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||||
|
NKRO_ENABLE = yes # USB Nkey Rollover
|
||||||
|
STENO_ENABLE = yes # Needed for chording
|
||||||
|
|
||||||
@@ -0,0 +1,367 @@
|
|||||||
|
#include "sten.h"
|
||||||
|
|
||||||
|
// Chord state
|
||||||
|
uint32_t cChord = 0; // Current Chord
|
||||||
|
int chordIndex = 0; // Keys in previousachord
|
||||||
|
int32_t chordState[32]; // Full Chord history
|
||||||
|
#define QWERBUF 24 // Size of chords to buffer for output
|
||||||
|
|
||||||
|
bool repeatFlag = false; // Should we repeat?
|
||||||
|
uint32_t pChord = 0; // Previous Chord
|
||||||
|
int pChordIndex = 0; // Keys in previousachord
|
||||||
|
uint32_t pChordState[32]; // Previous chord sate
|
||||||
|
uint32_t stickyBits = 0; // Or'd with every incoming press
|
||||||
|
|
||||||
|
// Mode state
|
||||||
|
enum MODE { STENO = 0, QWERTY, COMMAND };
|
||||||
|
enum MODE pMode;
|
||||||
|
bool QWERSTENO = false;
|
||||||
|
#ifdef ONLYQWERTY
|
||||||
|
enum MODE cMode = QWERTY;
|
||||||
|
#else
|
||||||
|
enum MODE cMode = STENO;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Command State
|
||||||
|
#define MAX_CMD_BUF 20
|
||||||
|
uint8_t CMDLEN = 0;
|
||||||
|
uint8_t CMDBUF[MAX_CMD_BUF];
|
||||||
|
|
||||||
|
// Key Repeat state
|
||||||
|
bool inChord = false;
|
||||||
|
bool repEngaged = false;
|
||||||
|
uint16_t repTimer = 0;
|
||||||
|
#define REP_INIT_DELAY 750
|
||||||
|
#define REP_DELAY 25
|
||||||
|
|
||||||
|
// Mousekeys state
|
||||||
|
bool inMouse = false;
|
||||||
|
int8_t mousePress;
|
||||||
|
|
||||||
|
// All processing done at chordUp goes through here
|
||||||
|
// Note, this is a gutted version of the Georgi sten.h
|
||||||
|
bool send_steno_chord_user(steno_mode_t mode, uint8_t chord[6]) {
|
||||||
|
// Check for mousekeys, this is release
|
||||||
|
#ifdef MOUSEKEY_ENABLE
|
||||||
|
if (inMouse) {
|
||||||
|
inMouse = false;
|
||||||
|
mousekey_off(mousePress);
|
||||||
|
mousekey_send();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// handle command mode
|
||||||
|
if (cChord == (LSU | LSD | RD | RZ)) {
|
||||||
|
if (cMode != COMMAND) { // Entering Command Mode
|
||||||
|
CMDLEN = 0;
|
||||||
|
pMode = cMode;
|
||||||
|
cMode = COMMAND;
|
||||||
|
} else { // Exiting Command Mode
|
||||||
|
cMode = pMode;
|
||||||
|
|
||||||
|
// Press all and release all
|
||||||
|
for (int i = 0; i < CMDLEN; i++) {
|
||||||
|
register_code(CMDBUF[i]);
|
||||||
|
}
|
||||||
|
clear_keyboard();
|
||||||
|
}
|
||||||
|
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Handle Gaming Toggle,
|
||||||
|
if (cChord == (LSU | LSD | LFT | LK | RT | RS | RD | RZ) && keymapsCount > 1) {
|
||||||
|
#ifndef NO_DEBUG
|
||||||
|
uprintf("Switching to QMK\n");
|
||||||
|
#endif
|
||||||
|
layer_on(1);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do QWERTY and Momentary QWERTY
|
||||||
|
if (cMode == QWERTY || (cMode == COMMAND)) {
|
||||||
|
processChord(false);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
|
cChord = 0;
|
||||||
|
inChord = false;
|
||||||
|
chordIndex = 0;
|
||||||
|
clear_keyboard();
|
||||||
|
repEngaged = false;
|
||||||
|
for (int i = 0; i < 32; i++)
|
||||||
|
chordState[i] = 0xFFFF;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update Chord State
|
||||||
|
bool process_steno_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
// Everything happens in here when steno keys come in.
|
||||||
|
// Bail on keyup
|
||||||
|
if (!record->event.pressed) return true;
|
||||||
|
|
||||||
|
// Update key repeat timers
|
||||||
|
repTimer = timer_read();
|
||||||
|
inChord = true;
|
||||||
|
|
||||||
|
// Switch on the press adding to chord
|
||||||
|
bool pr = record->event.pressed;
|
||||||
|
switch (keycode) {
|
||||||
|
// Mods and stuff
|
||||||
|
case STN_ST1: pr ? (cChord |= (ST1)): (cChord &= ~(ST1)); break;
|
||||||
|
case STN_ST2: pr ? (cChord |= (ST2)): (cChord &= ~(ST2)); break;
|
||||||
|
case STN_ST3: pr ? (cChord |= (ST3)): (cChord &= ~(ST3)); break;
|
||||||
|
case STN_ST4: pr ? (cChord |= (ST4)): (cChord &= ~(ST4)); break;
|
||||||
|
case STN_FN: pr ? (cChord |= (FN)) : (cChord &= ~(FN)); break;
|
||||||
|
case STN_PWR: pr ? (cChord |= (PWR)): (cChord &= ~(PWR)); break;
|
||||||
|
case STN_N1...STN_N6: pr ? (cChord |= (LNO)): (cChord &= ~(LNO)); break;
|
||||||
|
case STN_N7...STN_NC: pr ? (cChord |= (RNO)): (cChord &= ~(RNO)); break;
|
||||||
|
|
||||||
|
// All the letter keys
|
||||||
|
case STN_S1: pr ? (cChord |= (LSU)) : (cChord &= ~(LSU)); break;
|
||||||
|
case STN_S2: pr ? (cChord |= (LSD)) : (cChord &= ~(LSD)); break;
|
||||||
|
case STN_TL: pr ? (cChord |= (LFT)) : (cChord &= ~(LFT)); break;
|
||||||
|
case STN_KL: pr ? (cChord |= (LK)) : (cChord &= ~(LK)); break;
|
||||||
|
case STN_PL: pr ? (cChord |= (LP)) : (cChord &= ~(LP)); break;
|
||||||
|
case STN_WL: pr ? (cChord |= (LW)) : (cChord &= ~(LW)); break;
|
||||||
|
case STN_HL: pr ? (cChord |= (LH)) : (cChord &= ~(LH)); break;
|
||||||
|
case STN_RL: pr ? (cChord |= (LR)) : (cChord &= ~(LR)); break;
|
||||||
|
case STN_A: pr ? (cChord |= (LA)) : (cChord &= ~(LA)); break;
|
||||||
|
case STN_O: pr ? (cChord |= (LO)) : (cChord &= ~(LO)); break;
|
||||||
|
case STN_E: pr ? (cChord |= (RE)) : (cChord &= ~(RE)); break;
|
||||||
|
case STN_U: pr ? (cChord |= (RU)) : (cChord &= ~(RU)); break;
|
||||||
|
case STN_FR: pr ? (cChord |= (RF)) : (cChord &= ~(RF)); break;
|
||||||
|
case STN_RR: pr ? (cChord |= (RR)) : (cChord &= ~(RR)); break;
|
||||||
|
case STN_PR: pr ? (cChord |= (RP)) : (cChord &= ~(RP)); break;
|
||||||
|
case STN_BR: pr ? (cChord |= (RB)) : (cChord &= ~(RB)); break;
|
||||||
|
case STN_LR: pr ? (cChord |= (RL)) : (cChord &= ~(RL)); break;
|
||||||
|
case STN_GR: pr ? (cChord |= (RG)) : (cChord &= ~(RG)); break;
|
||||||
|
case STN_TR: pr ? (cChord |= (RT)) : (cChord &= ~(RT)); break;
|
||||||
|
case STN_SR: pr ? (cChord |= (RS)) : (cChord &= ~(RS)); break;
|
||||||
|
case STN_DR: pr ? (cChord |= (RD)) : (cChord &= ~(RD)); break;
|
||||||
|
case STN_ZR: pr ? (cChord |= (RZ)) : (cChord &= ~(RZ)); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Store previous state for fastQWER
|
||||||
|
if (pr) {
|
||||||
|
chordState[chordIndex] = cChord;
|
||||||
|
chordIndex++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
// We abuse this for early sending of key
|
||||||
|
// Key repeat only on QWER/SYMB layers
|
||||||
|
if (cMode != QWERTY || !inChord) return;
|
||||||
|
|
||||||
|
// Check timers
|
||||||
|
#ifndef NO_REPEAT
|
||||||
|
if (repEngaged && timer_elapsed(repTimer) > REP_DELAY) {
|
||||||
|
// Process Key for report
|
||||||
|
processChord(false);
|
||||||
|
|
||||||
|
// Send report to host
|
||||||
|
send_keyboard_report();
|
||||||
|
clear_keyboard();
|
||||||
|
repTimer = timer_read();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!repEngaged && timer_elapsed(repTimer) > REP_INIT_DELAY) {
|
||||||
|
repEngaged = true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
// For Plover NKRO
|
||||||
|
uint32_t processFakeSteno(bool lookup) {
|
||||||
|
P( LSU, SEND(KC_Q););
|
||||||
|
P( LSD, SEND(KC_A););
|
||||||
|
P( LFT, SEND(KC_W););
|
||||||
|
P( LP, SEND(KC_E););
|
||||||
|
P( LH, SEND(KC_R););
|
||||||
|
P( LK, SEND(KC_S););
|
||||||
|
P( LW, SEND(KC_D););
|
||||||
|
P( LR, SEND(KC_F););
|
||||||
|
P( ST1, SEND(KC_T););
|
||||||
|
P( ST2, SEND(KC_G););
|
||||||
|
P( LA, SEND(KC_C););
|
||||||
|
P( LO, SEND(KC_V););
|
||||||
|
P( RE, SEND(KC_N););
|
||||||
|
P( RU, SEND(KC_M););
|
||||||
|
P( ST3, SEND(KC_Y););
|
||||||
|
P( ST4, SEND(KC_H););
|
||||||
|
P( RF, SEND(KC_U););
|
||||||
|
P( RP, SEND(KC_I););
|
||||||
|
P( RL, SEND(KC_O););
|
||||||
|
P( RT, SEND(KC_P););
|
||||||
|
P( RD, SEND(KC_LBRC););
|
||||||
|
P( RR, SEND(KC_J););
|
||||||
|
P( RB, SEND(KC_K););
|
||||||
|
P( RG, SEND(KC_L););
|
||||||
|
P( RS, SEND(KC_SCLN););
|
||||||
|
P( RZ, SEND(KC_COMM););
|
||||||
|
P( LNO, SEND(KC_1););
|
||||||
|
P( RNO, SEND(KC_1););
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Traverse the chord history to a given point
|
||||||
|
// Returns the mask to use
|
||||||
|
void processChord(bool useFakeSteno) {
|
||||||
|
// Save the clean chord state
|
||||||
|
uint32_t savedChord = cChord;
|
||||||
|
|
||||||
|
// Apply Stick Bits if needed
|
||||||
|
if (stickyBits != 0) {
|
||||||
|
cChord |= stickyBits;
|
||||||
|
for (int i = 0; i <= chordIndex; i++)
|
||||||
|
chordState[i] |= stickyBits;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Strip FN
|
||||||
|
if (cChord & FN) cChord ^= FN;
|
||||||
|
|
||||||
|
// First we test if a whole chord was passsed
|
||||||
|
// If so we just run it handling repeat logic
|
||||||
|
if (useFakeSteno && processFakeSteno(true) == cChord) {
|
||||||
|
processFakeSteno(false);
|
||||||
|
return;
|
||||||
|
} else if (processQwerty(true) == cChord) {
|
||||||
|
processQwerty(false);
|
||||||
|
// Repeat logic
|
||||||
|
if (repeatFlag) {
|
||||||
|
restoreState();
|
||||||
|
repeatFlag = false;
|
||||||
|
processChord(false);
|
||||||
|
} else {
|
||||||
|
saveState(cChord);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Iterate through chord picking out the individual
|
||||||
|
// and longest chords
|
||||||
|
uint32_t bufChords[QWERBUF];
|
||||||
|
int bufLen = 0;
|
||||||
|
uint32_t mask = 0;
|
||||||
|
|
||||||
|
// We iterate over it multiple times to catch the longest
|
||||||
|
// chord. Then that gets addded to the mask and re run.
|
||||||
|
while (savedChord != mask) {
|
||||||
|
uint32_t test = 0;
|
||||||
|
uint32_t longestChord = 0;
|
||||||
|
|
||||||
|
for (int i = 0; i <= chordIndex; i++) {
|
||||||
|
cChord = chordState[i] & ~mask;
|
||||||
|
if (cChord == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// Assume mid parse Sym is new chord
|
||||||
|
if (i != 0 && test != 0 && (cChord ^ test) == PWR) {
|
||||||
|
longestChord = test;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Lock SYM layer in once detected
|
||||||
|
if (mask & PWR)
|
||||||
|
cChord |= PWR;
|
||||||
|
|
||||||
|
|
||||||
|
// Testing for keycodes
|
||||||
|
if (useFakeSteno) {
|
||||||
|
test = processFakeSteno(true);
|
||||||
|
} else {
|
||||||
|
test = processQwerty(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (test != 0) {
|
||||||
|
longestChord = test;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mask |= longestChord;
|
||||||
|
bufChords[bufLen] = longestChord;
|
||||||
|
bufLen++;
|
||||||
|
|
||||||
|
// That's a loop of sorts, halt processing
|
||||||
|
if (bufLen >= QWERBUF) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now that the buffer is populated, we run it
|
||||||
|
for (int i = 0; i < bufLen ; i++) {
|
||||||
|
cChord = bufChords[i];
|
||||||
|
if (useFakeSteno) {
|
||||||
|
processFakeSteno(false);
|
||||||
|
} else {
|
||||||
|
processQwerty(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save state in case of repeat
|
||||||
|
if (!repeatFlag) {
|
||||||
|
saveState(savedChord);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Restore cChord for held repeat
|
||||||
|
cChord = savedChord;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void saveState(uint32_t cleanChord) {
|
||||||
|
pChord = cleanChord;
|
||||||
|
pChordIndex = chordIndex;
|
||||||
|
for (int i = 0; i < 32; i++)
|
||||||
|
pChordState[i] = chordState[i];
|
||||||
|
}
|
||||||
|
void restoreState() {
|
||||||
|
cChord = pChord;
|
||||||
|
chordIndex = pChordIndex;
|
||||||
|
for (int i = 0; i < 32; i++)
|
||||||
|
chordState[i] = pChordState[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Macros for calling from keymap.c
|
||||||
|
void SEND(uint8_t kc) {
|
||||||
|
// Send Keycode, Does not work for Quantum Codes
|
||||||
|
if (cMode == COMMAND && CMDLEN < MAX_CMD_BUF) {
|
||||||
|
#ifndef NO_DEBUG
|
||||||
|
uprintf("CMD LEN: %d BUF: %d\n", CMDLEN, MAX_CMD_BUF);
|
||||||
|
#endif
|
||||||
|
CMDBUF[CMDLEN] = kc;
|
||||||
|
CMDLEN++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cMode != COMMAND) register_code(kc);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void REPEAT(void) {
|
||||||
|
if (cMode != QWERTY)
|
||||||
|
return;
|
||||||
|
|
||||||
|
repeatFlag = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void SET_STICKY(uint32_t stick) {
|
||||||
|
stickyBits = stick;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void SWITCH_LAYER(int layer) {
|
||||||
|
if (keymapsCount >= layer)
|
||||||
|
layer_on(layer);
|
||||||
|
}
|
||||||
|
void CLICK_MOUSE(uint8_t kc) {
|
||||||
|
#ifdef MOUSEKEY_ENABLE
|
||||||
|
mousekey_on(kc);
|
||||||
|
mousekey_send();
|
||||||
|
|
||||||
|
// Store state for later use
|
||||||
|
inMouse = true;
|
||||||
|
mousePress = kc;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
// 2019, g Heavy Industries
|
||||||
|
// Blessed mother of Christ, please keep this readable
|
||||||
|
// and protect us from segfaults. For thine is the clock,
|
||||||
|
// the slave and the master. Until we return from main.
|
||||||
|
//
|
||||||
|
// Amen.
|
||||||
|
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
#include "mousekey.h"
|
||||||
|
#include "keymap.h"
|
||||||
|
#include "keymap_steno.h"
|
||||||
|
#include "wait.h"
|
||||||
|
|
||||||
|
extern size_t keymapsCount; // Total keymaps
|
||||||
|
extern uint32_t cChord; // Current Chord
|
||||||
|
|
||||||
|
// Function defs
|
||||||
|
void processChord(bool useFakeSteno);
|
||||||
|
uint32_t processQwerty(bool lookup);
|
||||||
|
uint32_t processFakeSteno(bool lookup);
|
||||||
|
void saveState(uint32_t cChord);
|
||||||
|
void restoreState(void);
|
||||||
|
|
||||||
|
// Macros for use in keymap.c
|
||||||
|
void SEND(uint8_t kc);
|
||||||
|
void REPEAT(void);
|
||||||
|
void SET_STICKY(uint32_t);
|
||||||
|
void SWITCH_LAYER(int);
|
||||||
|
void CLICK_MOUSE(uint8_t);
|
||||||
|
|
||||||
|
// Keymap helper
|
||||||
|
#define P(chord, act) if (cChord == (chord)) { if (!lookup) {act;} return chord;}
|
||||||
|
|
||||||
|
// Shift to internal representation
|
||||||
|
// i.e) S(teno)R(ight)F
|
||||||
|
#define STN(n) (1L<<n)
|
||||||
|
enum ORDER {
|
||||||
|
SFN = 0, SPWR, SST1, SST2, SST3, SST4, SNUML, SNUMR,
|
||||||
|
SLSU, SLSD, SLT, SLK, SLP, SLW, SLH, SLR, SLA, SLO,
|
||||||
|
SRE, SRU, SRF, SRR, SRP, SRB, SRL, SRG, SRT, SRS, SRD, SRZ, SRES1, SRES2
|
||||||
|
};
|
||||||
|
|
||||||
|
// Break it all out
|
||||||
|
#define FN STN(SFN)
|
||||||
|
#define PWR STN(SPWR)
|
||||||
|
#define ST1 STN(SST1)
|
||||||
|
#define ST2 STN(SST2)
|
||||||
|
#define ST3 STN(SST3)
|
||||||
|
#define ST4 STN(SST4)
|
||||||
|
#define LNO STN(SNUML) // STN1-6
|
||||||
|
#define RNO STN(SNUMR) // STN7-C
|
||||||
|
#define RES1 STN(SRES1) // Use reserved for sticky state
|
||||||
|
#define RES2 STN(SRES2)
|
||||||
|
|
||||||
|
#define LSU STN(SLSU)
|
||||||
|
#define LSD STN(SLSD)
|
||||||
|
#define LFT STN(SLT) // (L)e(F)t (T), preprocessor conflict
|
||||||
|
#define LK STN(SLK)
|
||||||
|
#define LP STN(SLP)
|
||||||
|
#define LW STN(SLW)
|
||||||
|
#define LH STN(SLH)
|
||||||
|
#define LR STN(SLR)
|
||||||
|
#define LA STN(SLA)
|
||||||
|
#define LO STN(SLO)
|
||||||
|
|
||||||
|
#define RE STN(SRE)
|
||||||
|
#define RU STN(SRU)
|
||||||
|
#define RF STN(SRF)
|
||||||
|
#define RR STN(SRR)
|
||||||
|
#define RP STN(SRP)
|
||||||
|
#define RB STN(SRB)
|
||||||
|
#define RL STN(SRL)
|
||||||
|
#define RG STN(SRG)
|
||||||
|
#define RT STN(SRT)
|
||||||
|
#define RS STN(SRS)
|
||||||
|
#define RD STN(SRD)
|
||||||
|
#define RZ STN(SRZ)
|
||||||
@@ -1,5 +1,12 @@
|
|||||||
# Default Doro67 ANSI layout.
|
# Default Doro67 ANSI layout.
|
||||||
|
|
||||||
|
**THIS IS THE DEFAULT ANSI KEYMAP (AVAILABILITY: CHINA + INTERNATIONAL GB)**
|
||||||
|
The "multi" directory includes keymaps for the multi-layout PCB, which supports ANSI, ISO, and multi (split backspace & non-blocker).
|
||||||
|
The keymap you choose from the "multi" directory must correspond to the integrated plate option you chose.
|
||||||
|
|
||||||
|
The multi-layout PCB and RGB pcb were the only two options available to NON-china buyers.
|
||||||
|
If you purchased an RGB PCB, please see the 'rgb' directory.
|
||||||
|
|
||||||
This is the default ANSI layout that comes flashed on the Doro67 multi PCB with
|
This is the default ANSI layout that comes flashed on the Doro67 multi PCB with
|
||||||
the exception of adding backtick as it was not mapped.
|
the exception of adding backtick as it was not mapped.
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
# Default Doro67 ISO layout.
|
# Default Doro67 ISO layout.
|
||||||
|
|
||||||
|
**THIS IS THE DEFAULT ISO KEYMAP (AVAILABILITY: CHINA + INTERNATIONAL GB)**
|
||||||
|
The "multi" directory includes keymaps for the multi-layout PCB, which supports ANSI, ISO, and multi (split backspace & non-blocker).
|
||||||
|
The keymap you choose from the "multi" directory must correspond to the integrated plate option you chose.
|
||||||
|
|
||||||
|
The multi-layout PCB and RGB pcb were the only two options available to NON-china buyers.
|
||||||
|
If you purchased an RGB PCB, please see the 'rgb' directory.
|
||||||
|
|
||||||
This is the default ISO layout that comes flashed on the Doro67 multi PCB with
|
This is the default ISO layout that comes flashed on the Doro67 multi PCB with
|
||||||
the exception of adding backtick and UK ISO specific keycodes as they were not mapped.
|
the exception of adding backtick and UK ISO specific keycodes as they were not mapped.
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
# Default Doro67 Multi layout.
|
# Default Doro67 Multi layout.
|
||||||
|
|
||||||
|
**THIS IS THE DEFAULT MULTI-LAYOUT (SPLIT BACKSPACE) KEYMAP (AVAILABILITY: CHINA + INTERNATIONAL GB)**
|
||||||
|
The "multi" directory includes keymaps for the multi-layout PCB, which supports ANSI, ISO, and multi (split backspace & non-blocker).
|
||||||
|
The keymap you choose from the "multi" directory must correspond to the integrated plate option you chose.
|
||||||
|
|
||||||
|
The multi-layout PCB and RGB pcb were the only two options available to NON-china buyers.
|
||||||
|
If you purchased an RGB PCB, please see the 'rgb' directory.
|
||||||
|
|
||||||
This is the default Multi layout that comes flashed on the Doro67 multi PCB with
|
This is the default Multi layout that comes flashed on the Doro67 multi PCB with
|
||||||
the exception of adding backtick as it was not mapped.
|
the exception of adding backtick as it was not mapped.
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,13 @@
|
|||||||
|
|
||||||
65% custom keyboard made by 80ultraman/Alf/Backprop Studios with multiple layout support. Despite the layout options available, layout is dictated by the selected integrated plate.
|
65% custom keyboard made by 80ultraman/Alf/Backprop Studios with multiple layout support. Despite the layout options available, layout is dictated by the selected integrated plate.
|
||||||
|
|
||||||
|
**MULTI-LAYOUT PCB (AVAILABILITY: CHINA + INTERNATIONAL GB)**
|
||||||
|
The "multi" directory includes keymaps for the multi-layout PCB, which supports ANSI, ISO, and multi (split backspace & non-blocker).
|
||||||
|
The keymap you choose from the "multi" directory must correspond to the integrated plate option you chose.
|
||||||
|
|
||||||
|
The multi-layout PCB and RGB pcb were the only two options available to NON-china buyers.
|
||||||
|
If you purchased an RGB PCB, please see the 'rgb' directory.
|
||||||
|
|
||||||
Keyboard Maintainer: [ShadeDream](https://github.com/shadedream)
|
Keyboard Maintainer: [ShadeDream](https://github.com/shadedream)
|
||||||
Hardware Supported: Doro67 Multi PCB
|
Hardware Supported: Doro67 Multi PCB
|
||||||
Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=97265.0)
|
Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=97265.0)
|
||||||
|
|||||||
@@ -1 +1,5 @@
|
|||||||
# The default keymap for doro67
|
# The default keymap for doro67
|
||||||
|
|
||||||
|
**THIS IS THE DEFAULT KEYMAP DIRECTORY (AVAILABILITY: CHINA GB ONLY)**
|
||||||
|
If you are a non-china buyer, you probably have the multi PCB or rgb PCB.
|
||||||
|
Please look at the "multi" and "rgb" readme files.
|
||||||
@@ -4,6 +4,10 @@
|
|||||||
|
|
||||||
This is not the PCB with RGB support. Do not flash RGB firmware for this board.
|
This is not the PCB with RGB support. Do not flash RGB firmware for this board.
|
||||||
|
|
||||||
|
**REGULAR PCB (AVAILABILITY: CHINA GB ONLY)*
|
||||||
|
If you are a non-china buyer, you probably have the multi PCB or rgb PCB.
|
||||||
|
Please look at the "multi" and "rgb" readme files.
|
||||||
|
|
||||||
Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin)
|
Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin)
|
||||||
Hardware Supported: Doro67 Regular PCB
|
Hardware Supported: Doro67 Regular PCB
|
||||||
Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=97265.0)
|
Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=97265.0)
|
||||||
|
|||||||
@@ -1 +1,7 @@
|
|||||||
# The default keymap for rgb
|
# The default keymap for rgb
|
||||||
|
|
||||||
|
**RGB PCB (AVAILABILITY: CHINA + INTERNATIONAL GB)**
|
||||||
|
The "rgb" directory includes the keymap for the RGB PCB.
|
||||||
|
|
||||||
|
The multi-layout PCB and RGB pcb were the only two options available to NON-china buyers.
|
||||||
|
If you purchased a non-rgb PCB, please see the 'multi' directory.
|
||||||
@@ -4,6 +4,12 @@
|
|||||||
|
|
||||||
Flashing the regular PCB firmware on this board will work, but will disable RGB lighting.
|
Flashing the regular PCB firmware on this board will work, but will disable RGB lighting.
|
||||||
|
|
||||||
|
**THIS IS THE RGB PCB DIRECTORY (AVAILABILITY: CHINA + INTERNATIONAL GB)**
|
||||||
|
The "rgb" directory includes the keymap for the RGB PCB.
|
||||||
|
|
||||||
|
The multi-layout PCB and RGB pcb were the only two options available to NON-china buyers.
|
||||||
|
If you purchased a non-rgb PCB, please see the 'multi' directory.
|
||||||
|
|
||||||
Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin)
|
Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin)
|
||||||
Hardware Supported: Doro 67 RGB PCB
|
Hardware Supported: Doro 67 RGB PCB
|
||||||
Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=97265.0)
|
Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=97265.0)
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
#define STARTUP_SONG SONG(PLANCK_SOUND)
|
||||||
|
// #define STARTUP_SONG SONG(NO_SOUND)
|
||||||
|
|
||||||
|
#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
|
||||||
|
SONG(COLEMAK_SOUND), \
|
||||||
|
SONG(DVORAK_SOUND) \
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* MIDI options
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Prevent use of disabled MIDI features in the keymap */
|
||||||
|
//#define MIDI_ENABLE_STRICT 1
|
||||||
|
|
||||||
|
/* enable basic MIDI features:
|
||||||
|
- MIDI notes can be sent when in Music mode is on
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define MIDI_BASIC
|
||||||
|
|
||||||
|
/* enable advanced MIDI features:
|
||||||
|
- MIDI notes can be added to the keymap
|
||||||
|
- Octave shift and transpose
|
||||||
|
- Virtual sustain, portamento, and modulation wheel
|
||||||
|
- etc.
|
||||||
|
*/
|
||||||
|
//#define MIDI_ADVANCED
|
||||||
|
|
||||||
|
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
|
||||||
|
//#define MIDI_TONE_KEYCODE_OCTAVES 2
|
||||||
|
|
||||||
|
// Most tactile encoders have detents every 4 stages
|
||||||
|
#define ENCODER_RESOLUTION 4
|
||||||
|
|
||||||
@@ -0,0 +1,211 @@
|
|||||||
|
/* Copyright 2015-2017 Jack Humbert
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
#include "muse.h"
|
||||||
|
#include "keymap_swedish.h"
|
||||||
|
|
||||||
|
extern keymap_config_t keymap_config;
|
||||||
|
|
||||||
|
enum planck_layers {
|
||||||
|
_COLEMAK,
|
||||||
|
_LOWER,
|
||||||
|
_RAISE,
|
||||||
|
_ADJUST
|
||||||
|
};
|
||||||
|
|
||||||
|
#define LOWER MO(_LOWER)
|
||||||
|
#define RAISE MO(_RAISE)
|
||||||
|
|
||||||
|
/* These definitions can be removed once keymap_swe is properly vetted against MacOS */
|
||||||
|
#define NO_DLR_MAC_V ALGR(LALT(KC_4))
|
||||||
|
#define NO_AT_MAC_V ALGR(LALT(KC_2))
|
||||||
|
|
||||||
|
/* Esc when pressed, ctrl when used as a modifier */
|
||||||
|
#define KC_ECTL MT(MOD_LCTL, KC_ESC)
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
/* Colemak_se
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | Tab | Q | W | F | P | G | J | L | U | Y | Ö | Å |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | ECTR | A | R | S | T | D | H | N | E | I | O | Ä |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | SCSHE| Z | X | C | V | B | K | M | , | . | - |SCSHE |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | esc | CTRL | Alt | CMD |Lower |Space |Bksp |Raise | CMD | RALT | HYPER| MEH |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_COLEMAK] = LAYOUT_planck_grid
|
||||||
|
(
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, NO_OSLH, NO_AA,
|
||||||
|
KC_ECTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, NO_AE,
|
||||||
|
KC_SFTENT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, NO_MINS, KC_SFTENT,
|
||||||
|
KC_ESC, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_BSPC, RAISE, KC_RGUI, KC_RALT, KC_HYPR, KC_MEH
|
||||||
|
),
|
||||||
|
|
||||||
|
/* Lower
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | | PIPE | ' | @ | & | | DOWN | | RIGHT| ` | ´ | ~ |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | | ! | " | # | ? | % | LEFT | / | \ | = | + | * |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | | | | [ | { | | UP | } | ] | | | |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | | | | | | DEL | | Next | Vol- | Vol+ | Play |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_LOWER] = LAYOUT_planck_grid
|
||||||
|
(
|
||||||
|
_______, NO_PIPE_MAC, NO_APOS, NO_AT_MAC_V, NO_AMPR, _______, KC_DOWN, KC_NO, KC_RGHT, NO_GRV, NO_GRV, NO_TILD,
|
||||||
|
_______, KC_EXLM, NO_QUO2, KC_HASH, NO_QUES, KC_PERC, KC_LEFT, NO_SLSH, NO_BSLS_MAC, NO_EQL, KC_PPLS, KC_PAST,
|
||||||
|
_______, KC_NO, KC_NO, NO_LBRC, NO_LCBR_MAC, KC_NO, KC_UP, NO_RCBR_MAC, NO_RBRC, KC_NO, KC_NO, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, KC_DEL, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
|
||||||
|
),
|
||||||
|
|
||||||
|
/* Raise
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | ^ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | $ |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | | | | < | ( | | | ) | > |Pg Up |Pg Dn | |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | Next | Vol- | Vol+ | Play |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_RAISE] = LAYOUT_planck_grid
|
||||||
|
(
|
||||||
|
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
|
||||||
|
NO_CIRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, NO_DLR_MAC_V,
|
||||||
|
_______, KC_NO, KC_NO, NO_LESS_MAC, NO_LPRN, KC_NO, KC_NO, NO_RPRN, NO_GRTR_MAC, KC_PGUP, KC_PGDN, KC_NO,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
|
||||||
|
),
|
||||||
|
|
||||||
|
/* Adjust (Lower + Raise)
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | | Reset| Debug| | | | | | | | | |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | | | |Aud on|Audoff|AGnorm|AGswap| | | | | |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof|TRMon |TRMoff| | | |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | | | | |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_ADJUST] = LAYOUT_planck_grid
|
||||||
|
(
|
||||||
|
_______, RESET, DEBUG, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______,
|
||||||
|
_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||||
|
)
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
uint32_t layer_state_set_user(uint32_t state) {
|
||||||
|
return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool muse_mode = false;
|
||||||
|
uint8_t last_muse_note = 0;
|
||||||
|
uint16_t muse_counter = 0;
|
||||||
|
uint8_t muse_offset = 70;
|
||||||
|
uint16_t muse_tempo = 50;
|
||||||
|
|
||||||
|
void encoder_update(bool clockwise) {
|
||||||
|
if (muse_mode) {
|
||||||
|
if (IS_LAYER_ON(_RAISE)) {
|
||||||
|
if (clockwise) {
|
||||||
|
muse_offset++;
|
||||||
|
} else {
|
||||||
|
muse_offset--;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (clockwise) {
|
||||||
|
muse_tempo+=1;
|
||||||
|
} else {
|
||||||
|
muse_tempo-=1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (clockwise) {
|
||||||
|
#ifdef MOUSEKEY_ENABLE
|
||||||
|
register_code(KC_MS_WH_DOWN);
|
||||||
|
unregister_code(KC_MS_WH_DOWN);
|
||||||
|
#else
|
||||||
|
register_code(KC_PGDN);
|
||||||
|
unregister_code(KC_PGDN);
|
||||||
|
#endif
|
||||||
|
} else {
|
||||||
|
#ifdef MOUSEKEY_ENABLE
|
||||||
|
register_code(KC_MS_WH_UP);
|
||||||
|
unregister_code(KC_MS_WH_UP);
|
||||||
|
#else
|
||||||
|
register_code(KC_PGUP);
|
||||||
|
unregister_code(KC_PGUP);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void dip_update(uint8_t index, bool active) {
|
||||||
|
switch (index) {
|
||||||
|
case 0:
|
||||||
|
if (active) {
|
||||||
|
layer_on(_ADJUST);
|
||||||
|
} else {
|
||||||
|
layer_off(_ADJUST);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
if (active) {
|
||||||
|
muse_mode = true;
|
||||||
|
} else {
|
||||||
|
muse_mode = false;
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
stop_all_notes();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
if (muse_mode) {
|
||||||
|
if (muse_counter == 0) {
|
||||||
|
uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()];
|
||||||
|
if (muse_note != last_muse_note) {
|
||||||
|
stop_note(compute_freq_for_midi_note(last_muse_note));
|
||||||
|
play_note(compute_freq_for_midi_note(muse_note), 0xF);
|
||||||
|
last_muse_note = muse_note;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
muse_counter = (muse_counter + 1) % muse_tempo;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
bool music_mask_user(uint16_t keycode) {
|
||||||
|
switch (keycode) {
|
||||||
|
case RAISE:
|
||||||
|
case LOWER:
|
||||||
|
return false;
|
||||||
|
default:
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# Motform Planck Layout
|
||||||
|
|
||||||
|
This layout is based off the [colemak-se](github.com/motform/colemak-se)
|
||||||
|
layout and features many tweaks to make working with Emacs and
|
||||||
|
evil-mode more ergonomi. As with the colemak layout itself, the idea
|
||||||
|
is to concentrate as much movement as possible to the home row.
|
||||||
|
|
||||||
|
To properly use the layout in Emacs, set Super to LGUI and Meta to RGUI.
|
||||||
|
Unless you are running a permutation of the MacOS Swedish QWERTY-layout,
|
||||||
|
modifiers will probably not work. For future develoment, I’m planning
|
||||||
|
to add support for MS Windows SE-QWERTY in the form of a secondary layer.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
SRC += muse.c
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
#define STARTUP_SONG SONG(PREONIC_SOUND)
|
||||||
|
// #define STARTUP_SONG SONG(NO_SOUND)
|
||||||
|
|
||||||
|
#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
|
||||||
|
SONG(COLEMAK_SOUND), \
|
||||||
|
SONG(DVORAK_SOUND) \
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define MUSIC_MASK (keycode != KC_NO)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* MIDI options
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Prevent use of disabled MIDI features in the keymap */
|
||||||
|
//#define MIDI_ENABLE_STRICT 1
|
||||||
|
|
||||||
|
/* enable basic MIDI features:
|
||||||
|
- MIDI notes can be sent when in Music mode is on
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define MIDI_BASIC
|
||||||
|
#define TAP_CODE_DELAY 10
|
||||||
|
|
||||||
|
/* enable advanced MIDI features:
|
||||||
|
- MIDI notes can be added to the keymap
|
||||||
|
- Octave shift and transpose
|
||||||
|
- Virtual sustain, portamento, and modulation wheel
|
||||||
|
- etc.
|
||||||
|
*/
|
||||||
|
//#define MIDI_ADVANCED
|
||||||
|
|
||||||
|
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
|
||||||
|
//#define MIDI_TONE_KEYCODE_OCTAVES 2
|
||||||
@@ -0,0 +1,289 @@
|
|||||||
|
/* Copyright 2015-2017 Jack Humbert
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
#include "muse.h"
|
||||||
|
|
||||||
|
enum preonic_layers {
|
||||||
|
_QWERTY,
|
||||||
|
_COLEMAK,
|
||||||
|
_DVORAK,
|
||||||
|
_LOWER,
|
||||||
|
_RAISE,
|
||||||
|
_ADJUST
|
||||||
|
};
|
||||||
|
|
||||||
|
enum preonic_keycodes {
|
||||||
|
QWERTY = SAFE_RANGE,
|
||||||
|
COLEMAK,
|
||||||
|
DVORAK,
|
||||||
|
LOWER,
|
||||||
|
RAISE,
|
||||||
|
BACKLIT
|
||||||
|
};
|
||||||
|
|
||||||
|
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 | \ |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | Caps | 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] = LAYOUT_preonic_grid(
|
||||||
|
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_BSLS, \
|
||||||
|
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
|
||||||
|
KC_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
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | ` | 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] = LAYOUT_preonic_grid(
|
||||||
|
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, \
|
||||||
|
BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
|
||||||
|
),
|
||||||
|
|
||||||
|
/* Dvorak
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | Tab | " | , | . | P | Y | F | G | C | R | L | Del |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | Esc | A | O | E | U | I | D | H | T | N | S | / |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_DVORAK] = LAYOUT_preonic_grid(
|
||||||
|
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
|
||||||
|
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \
|
||||||
|
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
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | | |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | Next | Vol- | Vol+ | Play |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_LOWER] = LAYOUT_preonic_grid(
|
||||||
|
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \
|
||||||
|
KC_TILD, 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_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
|
||||||
|
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_HOME, KC_END, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
|
||||||
|
),
|
||||||
|
|
||||||
|
/* Raise
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | | |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | Next | Vol- | Vol+ | Play |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_RAISE] = LAYOUT_preonic_grid(
|
||||||
|
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_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \
|
||||||
|
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
|
||||||
|
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
|
||||||
|
),
|
||||||
|
|
||||||
|
/* Adjust (Lower + Raise)
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | Reset| | | | | | | | | | Del |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | | | |Aud on|AudOff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | | | | |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_ADJUST] = LAYOUT_preonic_grid(
|
||||||
|
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, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL, \
|
||||||
|
_______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \
|
||||||
|
_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
switch (keycode) {
|
||||||
|
case QWERTY:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
set_single_persistent_default_layer(_QWERTY);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case COLEMAK:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
set_single_persistent_default_layer(_COLEMAK);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case DVORAK:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
set_single_persistent_default_layer(_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
|
||||||
|
#ifdef __AVR__
|
||||||
|
PORTE &= ~(1<<6);
|
||||||
|
#endif
|
||||||
|
} else {
|
||||||
|
unregister_code(KC_RSFT);
|
||||||
|
#ifdef __AVR__
|
||||||
|
PORTE |= (1<<6);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
bool muse_mode = false;
|
||||||
|
uint8_t last_muse_note = 0;
|
||||||
|
uint16_t muse_counter = 0;
|
||||||
|
uint8_t muse_offset = 70;
|
||||||
|
uint16_t muse_tempo = 50;
|
||||||
|
|
||||||
|
void encoder_update_user(uint8_t index, bool clockwise) {
|
||||||
|
if (clockwise) {
|
||||||
|
tap_code(KC_VOLU);
|
||||||
|
} else {
|
||||||
|
tap_code(KC_VOLD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void dip_update(uint8_t index, bool active) {
|
||||||
|
switch (index) {
|
||||||
|
case 0:
|
||||||
|
if (active) {
|
||||||
|
layer_on(_ADJUST);
|
||||||
|
} else {
|
||||||
|
layer_off(_ADJUST);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
if (active) {
|
||||||
|
muse_mode = true;
|
||||||
|
} else {
|
||||||
|
muse_mode = false;
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
stop_all_notes();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
if (muse_mode) {
|
||||||
|
if (muse_counter == 0) {
|
||||||
|
uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()];
|
||||||
|
if (muse_note != last_muse_note) {
|
||||||
|
stop_note(compute_freq_for_midi_note(last_muse_note));
|
||||||
|
play_note(compute_freq_for_midi_note(muse_note), 0xF);
|
||||||
|
last_muse_note = muse_note;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
muse_counter = (muse_counter + 1) % muse_tempo;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
bool music_mask_user(uint16_t keycode) {
|
||||||
|
switch (keycode) {
|
||||||
|
case RAISE:
|
||||||
|
case LOWER:
|
||||||
|
return false;
|
||||||
|
default:
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
# mikethetiger's Preonic layout - largely based on the Planck's
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
SRC += muse.c
|
||||||
@@ -1,12 +1,11 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import json
|
||||||
import layout
|
import layout
|
||||||
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
# TODO: auto-generate mutex layers
|
|
||||||
# TODO: auto-generate update_tri_layer (_state)
|
|
||||||
|
|
||||||
|
|
||||||
def gen_uc_iter():
|
def gen_uc_iter():
|
||||||
length = len(layout.uc_dict)
|
length = len(layout.uc_dict)
|
||||||
@@ -18,7 +17,7 @@ def gen_uc_iter():
|
|||||||
yield (key, value, True)
|
yield (key, value, True)
|
||||||
|
|
||||||
|
|
||||||
def translate(s):
|
def _translate(s):
|
||||||
if re.match("^[0-9]$", s):
|
if re.match("^[0-9]$", s):
|
||||||
return ("KC_{0}".format(s), " {0} ".format(s))
|
return ("KC_{0}".format(s), " {0} ".format(s))
|
||||||
elif re.match("^[a-z]$", s):
|
elif re.match("^[a-z]$", s):
|
||||||
@@ -50,80 +49,115 @@ def translate(s):
|
|||||||
|
|
||||||
|
|
||||||
def toKC(s):
|
def toKC(s):
|
||||||
(kc, lgd) = translate(s)
|
return _translate(s)[0]
|
||||||
return kc
|
|
||||||
|
|
||||||
|
|
||||||
def toLgd(s):
|
def toLgd(s):
|
||||||
(kc, lgd) = translate(s)
|
return _translate(s)[1]
|
||||||
return lgd
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
def writeKeymap(f_template, f_keymap, columns, rows):
|
||||||
|
|
||||||
template = open("km_template.txt", mode="r")
|
|
||||||
output = open("keymap.c", mode="w", encoding='utf-8')
|
|
||||||
|
|
||||||
doCopy = False
|
doCopy = False
|
||||||
|
|
||||||
for line in template:
|
for line in f_template:
|
||||||
doCopy = True
|
doCopy = True
|
||||||
if line.startswith("//<enum/>"):
|
if line.startswith("//<enum/>"):
|
||||||
doCopy = False
|
doCopy = False
|
||||||
# output.write(str(layout.uc_dict))
|
# f_keymap.write(str(layout.uc_dict))
|
||||||
for k, v, isLast in gen_uc_iter():
|
for k, v, isLast in gen_uc_iter():
|
||||||
if isLast:
|
if isLast:
|
||||||
output.write(k + "\n")
|
f_keymap.write(k + "\n")
|
||||||
else:
|
else:
|
||||||
output.write(k + ",\n")
|
f_keymap.write(k + ",\n")
|
||||||
if line.startswith("//<uc_map/>"):
|
elif line.startswith("//<uc_map/>"):
|
||||||
doCopy = False
|
doCopy = False
|
||||||
for k, v, isLast in gen_uc_iter():
|
for k, v, isLast in gen_uc_iter():
|
||||||
if isLast:
|
if isLast:
|
||||||
output.write(u"\t[{0}] = {1} // {2}\n".format(k, v, chr(int(v, 0))))
|
f_keymap.write(u"\t[{0}] = {1} // {2}\n".format(k, v, chr(int(v, 0))))
|
||||||
else:
|
else:
|
||||||
output.write(u"\t[{0}] = {1}, // {2}\n".format(k, v, chr(int(v, 0))))
|
f_keymap.write(u"\t[{0}] = {1}, // {2}\n".format(k, v, chr(int(v, 0))))
|
||||||
if line.startswith("//<keymaps/>"):
|
elif line.startswith("//<keymaps/>"):
|
||||||
doCopy = False
|
doCopy = False
|
||||||
counter = len(layout.layers)
|
for layer, L in enumerate(layout.layers):
|
||||||
layer = 0
|
r_counter = rows
|
||||||
S = layout.static
|
f_keymap.write("/* Layer %d\n" % layer)
|
||||||
for L in layout.layers:
|
f_keymap.write(" * ------------------------------------------------- -------------------------------------------------\n")
|
||||||
counter -= 1
|
f_keymap.write(" * |{0}|{1}|{2}|{3}|{4}|{5}| |{6}|{7}|{8}|{9}|{10}|{11}|\n".format(*map(toLgd, L[:12])))
|
||||||
r_counter = 4
|
f_keymap.write(" * ------------------------------------------------- -------------------------------------------------\n")
|
||||||
output.write("/* Layer %d\n" % layer)
|
f_keymap.write(" * |{0}|{1}|{2}|{3}|{4}|{5}| |{6}|{7}|{8}|{9}|{10}|{11}|\n".format(*map(toLgd, L[12:24])))
|
||||||
output.write(" * ------------------------------------------------- -------------------------------------------------\n")
|
f_keymap.write(" * ------------------------------------------------- -------------------------------------------------\n")
|
||||||
output.write(" * |{0}|{1}|{2}|{3}|{4}|{5}| |{6}|{7}|{8}|{9}|{10}|{11}|\n".format(toLgd(L[0][0]), toLgd(L[0][1]), toLgd(L[0][2]), toLgd(L[0][3]), toLgd(L[0][4]), toLgd(L[0][5]), toLgd(L[0][6]), toLgd(L[0][7]), toLgd(L[0][8]), toLgd(L[0][9]), toLgd(L[0][10]), toLgd(L[0][11])))
|
f_keymap.write(" * |{0}|{1}|{2}|{3}|{4}|{5}| |{6}|{7}|{8}|{9}|{10}|{11}|\n".format(*map(toLgd, L[24:36])))
|
||||||
output.write(" * ------------------------------------------------- -------------------------------------------------\n")
|
f_keymap.write(" * -----------------------------------------------------------------------------------------------------------------\n")
|
||||||
output.write(" * |{0}|{1}|{2}|{3}|{4}|{5}| |{6}|{7}|{8}|{9}|{10}|{11}|\n".format(toLgd(L[1][0]), toLgd(L[1][1]), toLgd(L[1][2]), toLgd(L[1][3]), toLgd(L[1][4]), toLgd(L[1][5]), toLgd(L[1][6]), toLgd(L[1][7]), toLgd(L[1][8]), toLgd(L[1][9]), toLgd(L[1][10]), toLgd(L[1][11])))
|
f_keymap.write(" * {0} {1} {2} |{3}|{4}|{5}|{6}|{7}|{8}| {9} {10} {11}".format(*map(toLgd, L[36:48])).rstrip()+"\n")
|
||||||
output.write(" * ------------------------------------------------- -------------------------------------------------\n")
|
f_keymap.write(" * -------------------------------------------------\n")
|
||||||
output.write(" * |{0}|{1}|{2}|{3}|{4}|{5}| |{6}|{7}|{8}|{9}|{10}|{11}|\n".format(toLgd(L[2][0]), toLgd(L[2][1]), toLgd(L[2][2]), toLgd(L[2][3]), toLgd(L[2][4]), toLgd(L[2][5]), toLgd(L[2][6]), toLgd(L[2][7]), toLgd(L[2][8]), toLgd(L[2][9]), toLgd(L[2][10]), toLgd(L[2][11])))
|
f_keymap.write(" */\n")
|
||||||
output.write(" * -----------------------------------------------------------------------------------------------------------------\n")
|
|
||||||
output.write(" * {0} {1} {2} |{3}|{4}|{5}|{6}|{7}|{8}| {9} {10} {11}".format(toLgd(L[3][0]), toLgd(L[3][1]), toLgd(L[3][2]), toLgd(L[3][3]), toLgd(L[3][4]), toLgd(L[3][5]), toLgd(L[3][6]), toLgd(L[3][7]), toLgd(L[3][8]), toLgd(L[3][9]), toLgd(L[3][10]), toLgd(L[3][11])).rstrip()+"\n")
|
|
||||||
output.write(" * -------------------------------------------------\n")
|
|
||||||
output.write(" */\n")
|
|
||||||
|
|
||||||
l_code = '\tLAYOUT_ortho_4x12(\n'
|
l_code = '\tLAYOUT_ortho_4x12(\n'
|
||||||
for r in range(r_counter):
|
for r in range(r_counter):
|
||||||
r_counter -= 1
|
r_counter -= 1
|
||||||
c_counter = 12
|
c_counter = columns
|
||||||
l_code += '\t\t'
|
l_code += '\t\t'
|
||||||
for c in range(c_counter):
|
for c in range(c_counter):
|
||||||
c_counter -= 1
|
c_counter -= 1
|
||||||
if c != 0:
|
if c != 0:
|
||||||
l_code += " "
|
l_code += " "
|
||||||
l_code += "%s" % toKC(L[r][c])
|
l_code += "%s" % toKC(L[r*columns + columns-c_counter-1])
|
||||||
if r_counter or c_counter:
|
if r_counter or c_counter:
|
||||||
l_code += ","
|
l_code += ","
|
||||||
l_code += '\n'
|
l_code += '\n'
|
||||||
if counter:
|
if layer + 1 != len(layout.layers):
|
||||||
l_code += "\t),\n\n"
|
l_code += "\t),\n\n"
|
||||||
else:
|
else:
|
||||||
l_code += "\t)\n"
|
l_code += "\t)\n"
|
||||||
output.write(l_code)
|
f_keymap.write(l_code)
|
||||||
layer += 1
|
|
||||||
if doCopy:
|
if doCopy:
|
||||||
output.write(line)
|
f_keymap.write(line)
|
||||||
|
|
||||||
template.close()
|
|
||||||
output.close()
|
def getKeymapJSON(keyboard, keymap, layout, layers):
|
||||||
|
return json.dumps({
|
||||||
|
'keyboard': keyboard,
|
||||||
|
'keymap': keymap,
|
||||||
|
'layout': layout,
|
||||||
|
'layers': layers
|
||||||
|
}, sort_keys=True, indent=4)
|
||||||
|
|
||||||
|
|
||||||
|
def layersToKC(layers):
|
||||||
|
return [list(map(toKC, layer)) for layer in layers]
|
||||||
|
|
||||||
|
|
||||||
|
def pathToKeymap(path):
|
||||||
|
head, keymap = os.path.split(path)
|
||||||
|
_, keymapsdir = os.path.split(head)
|
||||||
|
if keymapsdir == 'keymaps':
|
||||||
|
return keymap
|
||||||
|
|
||||||
|
|
||||||
|
def pathToKeyboard(path):
|
||||||
|
head, keymap = os.path.split(path)
|
||||||
|
head, keymapsdir = os.path.split(head)
|
||||||
|
if keymapsdir == 'keymaps':
|
||||||
|
head, dir = os.path.split(head)
|
||||||
|
while dir not in ('/', 'keyboards'):
|
||||||
|
yield dir
|
||||||
|
head, dir = os.path.split(head)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
with open("km_template.txt", mode="r") as f_template:
|
||||||
|
with open("keymap.c", mode="w", encoding='utf-8') as f_keymap:
|
||||||
|
writeKeymap(f_template, f_keymap, columns=12, rows=4)
|
||||||
|
|
||||||
|
abspath = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
keyboard = list(reversed(list(pathToKeyboard(abspath))))
|
||||||
|
keymap = pathToKeymap(abspath)
|
||||||
|
keyboard_layout = 'LAYOUT_ortho_4x12'
|
||||||
|
with open("%s_%s.json" % ('_'.join(keyboard), keymap), mode="w") as f_keymapjson:
|
||||||
|
f_keymapjson.write(
|
||||||
|
getKeymapJSON(
|
||||||
|
'/'.join(keyboard),
|
||||||
|
keymap,
|
||||||
|
keyboard_layout,
|
||||||
|
layersToKC(layout.layers))
|
||||||
|
)
|
||||||
@@ -672,8 +672,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
*/
|
*/
|
||||||
LAYOUT_ortho_4x12(
|
LAYOUT_ortho_4x12(
|
||||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_RBRC,
|
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_RBRC,
|
||||||
KC_TRNS, DF(0), DF(1), XXXXXXX, XXXXXXX, MO(3), KC_4, KC_4, KC_5, KC_6, KC_MINS, KC_EQL,
|
KC_TRNS, DF(0), DF(1), KC_NO, KC_NO, MO(3), KC_4, KC_4, KC_5, KC_6, KC_MINS, KC_EQL,
|
||||||
KC_TRNS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MO(5), KC_1, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS,
|
KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, MO(5), KC_1, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS,
|
||||||
TG(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_TRNS, KC_TRNS, KC_BSPC, KC_0, KC_TRNS, KC_TRNS, KC_TRNS
|
TG(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_TRNS, KC_TRNS, KC_BSPC, KC_0, KC_TRNS, KC_TRNS, KC_TRNS
|
||||||
),
|
),
|
||||||
|
|
||||||
@@ -689,9 +689,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
* -------------------------------------------------
|
* -------------------------------------------------
|
||||||
*/
|
*/
|
||||||
LAYOUT_ortho_4x12(
|
LAYOUT_ortho_4x12(
|
||||||
KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX,
|
KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NO,
|
||||||
KC_TRNS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MO(3), KC_F4, KC_F4, KC_F5, KC_F6, XXXXXXX, XXXXXXX,
|
KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, MO(3), KC_F4, KC_F4, KC_F5, KC_F6, KC_NO, KC_NO,
|
||||||
KC_TRNS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F1, KC_F1, KC_F2, KC_F3, XXXXXXX, KC_TRNS,
|
KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F1, KC_F1, KC_F2, KC_F3, KC_NO, KC_TRNS,
|
||||||
TG(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS
|
TG(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS
|
||||||
),
|
),
|
||||||
|
|
||||||
@@ -709,7 +709,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
LAYOUT_ortho_4x12(
|
LAYOUT_ortho_4x12(
|
||||||
KC_ESC, KC_ESC, LCTL(KC_W), LCTL(KC_T), CTL_T(KC_PGDN), CTL_T(KC_PGDN), KC_PGDN, KC_HOME, KC_UP, KC_INS, LSFT(KC_INS), KC_ESC,
|
KC_ESC, KC_ESC, LCTL(KC_W), LCTL(KC_T), CTL_T(KC_PGDN), CTL_T(KC_PGDN), KC_PGDN, KC_HOME, KC_UP, KC_INS, LSFT(KC_INS), KC_ESC,
|
||||||
KC_TRNS, KC_CAPS, LGUI_T(KC_LEFT), LGUI_T(KC_TAB), LGUI_T(KC_RIGHT), LGUI_T(KC_RIGHT), KC_LEFT, KC_LEFT, KC_DOWN, KC_RIGHT, KC_END, KC_PSCR,
|
KC_TRNS, KC_CAPS, LGUI_T(KC_LEFT), LGUI_T(KC_TAB), LGUI_T(KC_RIGHT), LGUI_T(KC_RIGHT), KC_LEFT, KC_LEFT, KC_DOWN, KC_RIGHT, KC_END, KC_PSCR,
|
||||||
KC_TRNS, XXXXXXX, XXXXXXX, XXXXXXX, CTL_T(KC_PGUP), CTL_T(KC_PGUP), KC_PGUP, XXXXXXX, KC_DOWN, XXXXXXX, KC_APP, KC_TRNS,
|
KC_TRNS, KC_NO, KC_NO, KC_NO, CTL_T(KC_PGUP), CTL_T(KC_PGUP), KC_PGUP, KC_NO, KC_DOWN, KC_NO, KC_APP, KC_TRNS,
|
||||||
TG(4), KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_TRNS, KC_TRNS, KC_BSPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
|
TG(4), KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_TRNS, KC_TRNS, KC_BSPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
|
||||||
),
|
),
|
||||||
|
|
||||||
@@ -725,9 +725,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
* -------------------------------------------------
|
* -------------------------------------------------
|
||||||
*/
|
*/
|
||||||
LAYOUT_ortho_4x12(
|
LAYOUT_ortho_4x12(
|
||||||
KC_TRNS, XXXXXXX, KC_MPLY, KC_VOLU, KC_VOLU, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, KC_PWR,
|
KC_TRNS, KC_NO, KC_MPLY, KC_VOLU, KC_VOLU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET, KC_PWR,
|
||||||
KC_TRNS, XXXXXXX, KC_MPRV, KC_MUTE, KC_MNXT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SLEP,
|
KC_TRNS, KC_NO, KC_MPRV, KC_MUTE, KC_MNXT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_SLEP,
|
||||||
KC_TRNS, XXXXXXX, XXXXXXX, KC_VOLD, KC_VOLD, MO(5), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
KC_TRNS, KC_NO, KC_NO, KC_VOLD, KC_VOLD, MO(5), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||||
TG(5), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
|
TG(5), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
|
||||||
),
|
),
|
||||||
|
|
||||||
@@ -743,9 +743,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
* -------------------------------------------------
|
* -------------------------------------------------
|
||||||
*/
|
*/
|
||||||
LAYOUT_ortho_4x12(
|
LAYOUT_ortho_4x12(
|
||||||
KC_TRNS, KC_ACL1, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_WH_U, KC_WH_L, KC_MS_U, KC_WH_R, XXXXXXX, XXXXXXX,
|
KC_TRNS, KC_ACL1, KC_NO, KC_NO, KC_NO, KC_NO, KC_WH_U, KC_WH_L, KC_MS_U, KC_WH_R, KC_NO, KC_NO,
|
||||||
KC_TRNS, KC_ACL2, KC_BTN3, KC_BTN2, KC_BTN1, KC_BTN1, KC_MS_L, KC_MS_L, KC_MS_D, KC_MS_R, XXXXXXX, XXXXXXX,
|
KC_TRNS, KC_ACL2, KC_BTN3, KC_BTN2, KC_BTN1, KC_BTN1, KC_MS_L, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, KC_NO,
|
||||||
KC_TRNS, KC_ACL0, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_WH_D, XXXXXXX, KC_MS_D, XXXXXXX, XXXXXXX, KC_TRNS,
|
KC_TRNS, KC_ACL0, KC_NO, KC_NO, KC_NO, KC_NO, KC_WH_D, KC_NO, KC_MS_D, KC_NO, KC_NO, KC_TRNS,
|
||||||
TG(6), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
|
TG(6), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Add all used Unicode symbols to this list.
|
# Add all used Unicode symbols to this list.
|
||||||
# The key (e.g. "SNEK") is used in keymap.c for "enum", "unicode_map" and "keymaps", so it needs to be a valid C variable name.
|
# The key (e.g. "SNEK") is used in keymap.c for "enum", "unicode_map" and "keymaps", so it needs to be a valid C variable name.
|
||||||
# The key is also used in this file to define the layout, so use recognizeable names.
|
# The key is also used in this file to define the layout, so use recognizeable names.
|
||||||
@@ -336,7 +338,7 @@ qmk_dict = {
|
|||||||
# If you find "BAD" in your keymaps, then something went wrong.)
|
# If you find "BAD" in your keymaps, then something went wrong.)
|
||||||
"a": "BAD", "A": "BAD", "0": "BAD",
|
"a": "BAD", "A": "BAD", "0": "BAD",
|
||||||
# Basic Keycodes
|
# Basic Keycodes
|
||||||
"XXX": "XXXXXXX", "": "KC_TRNS",
|
"XXX": "KC_NO", "": "KC_TRNS",
|
||||||
"!": "S(KC_1)", "@": "S(KC_2)", "#": "S(KC_3)", "$": "S(KC_4)", "%": "S(KC_5)",
|
"!": "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)",
|
"^": "S(KC_6)", "&": "S(KC_7)", "*": "S(KC_8)", "(": "S(KC_9)", ")": "S(KC_0)",
|
||||||
"Enter": "KC_ENT", "Esc": "KC_ESC", "BSpace": "KC_BSPC", "Tab": "KC_TAB",
|
"Enter": "KC_ENT", "Esc": "KC_ESC", "BSpace": "KC_BSPC", "Tab": "KC_TAB",
|
||||||
@@ -426,58 +428,58 @@ static = ["NEO", "GREEK", "GREEK", "GREEK", "GREEK", "MOUSE"]
|
|||||||
|
|
||||||
# 0
|
# 0
|
||||||
qwerty = [
|
qwerty = [
|
||||||
["Tab", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "["],
|
"Tab", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "[",
|
||||||
["LCtrl", "a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "'"],
|
"LCtrl", "a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "'",
|
||||||
["LShift(", "z", "x", "c", "v", "b", "n", "m", ",", ".", "/", "RShift)"],
|
"LShift(", "z", "x", "c", "v", "b", "n", "m", ",", ".", "/", "RShift)",
|
||||||
["MO2", "LGui", "LAlt", "TT2", "LT6_SPC", "TT4", "Enter", "Space", "TT2", "RAlt", "RGui", "RCtrl"],
|
"MO2", "LGui", "LAlt", "TT2", "LT6_SPC", "TT4", "Enter", "Space", "TT2", "RAlt", "RGui", "RCtrl",
|
||||||
]
|
]
|
||||||
|
|
||||||
# 1
|
# 1
|
||||||
colemak = [
|
colemak = [
|
||||||
["Tab", "q", "w", "f", "p", "g", "j", "l", "u", "y", ";", "["],
|
"Tab", "q", "w", "f", "p", "g", "j", "l", "u", "y", ";", "[",
|
||||||
["LCtrl", "a", "r", "s", "t", "d", "h", "n", "e", "i", "o", "'"],
|
"LCtrl", "a", "r", "s", "t", "d", "h", "n", "e", "i", "o", "'",
|
||||||
["LShift(", "z", "x", "c", "v", "b", "k", "m", ",", ".", "/", "RShift)"],
|
"LShift(", "z", "x", "c", "v", "b", "k", "m", ",", ".", "/", "RShift)",
|
||||||
["MO2", "LGui", "LAlt", "TT2", "LT6_SPC", "TT4", "Enter", "Space", "TT2", "RAlt", "RGui", "RCtrl"],
|
"MO2", "LGui", "LAlt", "TT2", "LT6_SPC", "TT4", "Enter", "Space", "TT2", "RAlt", "RGui", "RCtrl",
|
||||||
]
|
]
|
||||||
|
|
||||||
# 2
|
# 2
|
||||||
numpad = [
|
numpad = [
|
||||||
["`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "]"],
|
"`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "]",
|
||||||
["", "DF0", "DF1", "XXX", "XXX", "MO3", "4", "4", "5", "6", "-", "="],
|
"", "DF0", "DF1", "XXX", "XXX", "MO3", "4", "4", "5", "6", "-", "=",
|
||||||
["", "XXX", "XXX", "XXX", "XXX", "MO5", "1", "1", "2", "3", "\\", ""],
|
"", "XXX", "XXX", "XXX", "XXX", "MO5", "1", "1", "2", "3", "\\", "",
|
||||||
["TG2", "", "", "", "Del", "", "", "BSpace", "0", "", "", ""],
|
"TG2", "", "", "", "Del", "", "", "BSpace", "0", "", "", "",
|
||||||
]
|
]
|
||||||
|
|
||||||
# 3
|
# 3
|
||||||
fpad = [
|
fpad = [
|
||||||
["", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "XXX"],
|
"", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "XXX",
|
||||||
["", "XXX", "XXX", "XXX", "XXX", "MO3", "F4", "F4", "F5", "F6", "XXX", "XXX"],
|
"", "XXX", "XXX", "XXX", "XXX", "MO3", "F4", "F4", "F5", "F6", "XXX", "XXX",
|
||||||
["", "XXX", "XXX", "XXX", "XXX", "XXX", "F1", "F1", "F2", "F3", "XXX", ""],
|
"", "XXX", "XXX", "XXX", "XXX", "XXX", "F1", "F1", "F2", "F3", "XXX", "",
|
||||||
["TG3", "", "", "", "", "", "F10", "F11", "F12", "", "", ""],
|
"TG3", "", "", "", "", "", "F10", "F11", "F12", "", "", "",
|
||||||
]
|
]
|
||||||
|
|
||||||
# 4
|
# 4
|
||||||
movement = [
|
movement = [
|
||||||
["Esc", "Esc", "Tab x", "Tab n", "CPg Dn", "CPg Dn", "Pg Down", "Home", "^ Arrow", "Insert", "SInsert", "Esc"],
|
"Esc", "Esc", "Tab x", "Tab n", "CPg Dn", "CPg Dn", "Pg Down", "Home", "^ Arrow", "Insert", "SInsert", "Esc",
|
||||||
["", "Caps", "< Gui", "Gui Tab", "> Gui", "> Gui", "< Arrow", "< Arrow", "v Arrow", "> Arrow", "End", "Pr Scr"],
|
"", "Caps", "< Gui", "Gui Tab", "> Gui", "> Gui", "< Arrow", "< Arrow", "v Arrow", "> Arrow", "End", "Pr Scr",
|
||||||
["", "XXX", "XXX", "XXX", "CPg Up", "CPg Up", "Pg Up", "XXX", "v Arrow", "XXX", "App", ""],
|
"", "XXX", "XXX", "XXX", "CPg Up", "CPg Up", "Pg Up", "XXX", "v Arrow", "XXX", "App", "",
|
||||||
["TG4", "", "", "", "Del", "", "", "BSpace", "", "", "", ""],
|
"TG4", "", "", "", "Del", "", "", "BSpace", "", "", "", "",
|
||||||
]
|
]
|
||||||
|
|
||||||
# 5
|
# 5
|
||||||
media = [
|
media = [
|
||||||
["", "XXX", "play/ps", "Vol +", "Vol +", "XXX", "XXX", "XXX", "XXX", "XXX", "_reset", "Power"],
|
"", "XXX", "play/ps", "Vol +", "Vol +", "XXX", "XXX", "XXX", "XXX", "XXX", "_reset", "Power",
|
||||||
["", "XXX", "|<<", "Vol 0", ">>|", "XXX", "XXX", "XXX", "XXX", "XXX", "XXX", "Sleep"],
|
"", "XXX", "|<<", "Vol 0", ">>|", "XXX", "XXX", "XXX", "XXX", "XXX", "XXX", "Sleep",
|
||||||
["", "XXX", "XXX", "Vol -", "Vol -", "MO5", "XXX", "XXX", "XXX", "XXX", "XXX", "XXX"],
|
"", "XXX", "XXX", "Vol -", "Vol -", "MO5", "XXX", "XXX", "XXX", "XXX", "XXX", "XXX",
|
||||||
["TG5", "", "", "", "", "", "", "", "", "", "", ""],
|
"TG5", "", "", "", "", "", "", "", "", "", "", "",
|
||||||
]
|
]
|
||||||
|
|
||||||
# 6
|
# 6
|
||||||
mouse = [
|
mouse = [
|
||||||
["", "acc1", "XXX", "XXX", "XXX", "XXX", "^ Wheel", "< Wheel", "^ Mouse", "> Wheel", "XXX", "XXX"],
|
"", "acc1", "XXX", "XXX", "XXX", "XXX", "^ Wheel", "< Wheel", "^ Mouse", "> Wheel", "XXX", "XXX",
|
||||||
["", "acc2", "Mouse 3", "Mouse 2", "Mouse 1", "Mouse 1", "< Mouse", "< Mouse", "v Mouse", "> Mouse", "XXX", "XXX"],
|
"", "acc2", "Mouse 3", "Mouse 2", "Mouse 1", "Mouse 1", "< Mouse", "< Mouse", "v Mouse", "> Mouse", "XXX", "XXX",
|
||||||
["", "acc0", "XXX", "XXX", "XXX", "XXX", "v Wheel", "XXX", "v Mouse", "XXX", "XXX", ""],
|
"", "acc0", "XXX", "XXX", "XXX", "XXX", "v Wheel", "XXX", "v Mouse", "XXX", "XXX", "",
|
||||||
["TG6", "", "", "", "", "", "", "", "", "", "", ""],
|
"TG6", "", "", "", "", "", "", "", "", "", "", "",
|
||||||
]
|
]
|
||||||
|
|
||||||
layers = [
|
layers = [
|
||||||
|
|||||||
@@ -20,4 +20,5 @@ starting point to create your own layouts for the Signum 3.0 with
|
|||||||
- Attention 2: additional C functions need to be put into
|
- Attention 2: additional C functions need to be put into
|
||||||
`km_template.txt`
|
`km_template.txt`
|
||||||
|
|
||||||
Run `./generate_km.py` to regenerate `keymap.c`.
|
Run `./generate_km.py` to regenerate `keymap.c` and the JSON keymap
|
||||||
|
definition that should be copied to `qmk_configurator/public/keymaps`.
|
||||||
@@ -92,15 +92,29 @@ static void render_logo(void) {
|
|||||||
oled_write_P(sol_logo, false);
|
oled_write_P(sol_logo, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern rgb_config_t rgb_matrix_config;
|
||||||
|
|
||||||
static void render_status(void) {
|
static void render_status(void) {
|
||||||
// Render to mode icon
|
// Render to mode icon
|
||||||
static const char PROGMEM mode_logo[2][4] = {
|
static const char PROGMEM mode_logo[2][3] = {
|
||||||
{0x97,0x98,0x0a,0},
|
{0x97,0x98,0},
|
||||||
{0xb7,0xb8,0x0a,0} };
|
{0xb7,0xb8,0} };
|
||||||
|
|
||||||
oled_write_P(mode_logo[0], false);
|
oled_write_P(mode_logo[0], false);
|
||||||
|
|
||||||
|
#if defined(RGB_MATRIX_ENABLE)
|
||||||
|
static char buffer[20] = {0};
|
||||||
|
snprintf(buffer, sizeof(buffer), " h%3d s%3d v%3d\n", rgb_matrix_config.hue, rgb_matrix_config.sat, rgb_matrix_config.val);
|
||||||
|
oled_write(buffer, false);
|
||||||
|
#endif
|
||||||
|
|
||||||
oled_write_P(mode_logo[1], false);
|
oled_write_P(mode_logo[1], false);
|
||||||
|
|
||||||
|
#if defined(RGB_MATRIX_ENABLE)
|
||||||
|
snprintf(buffer, sizeof(buffer), " s%3d m%3d\n", rgb_matrix_config.speed, rgb_matrix_config.mode);
|
||||||
|
oled_write(buffer, false);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below
|
// Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below
|
||||||
oled_write_P(PSTR("Layer: "), false);
|
oled_write_P(PSTR("Layer: "), false);
|
||||||
switch (biton32(layer_state)) {
|
switch (biton32(layer_state)) {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
[](https://github.com/qmk/qmk_firmware/pulse/monthly)
|
[](https://github.com/qmk/qmk_firmware/pulse/monthly)
|
||||||
[](https://github.com/qmk/qmk_firmware/)
|
[](https://github.com/qmk/qmk_firmware/)
|
||||||
|
|
||||||
This is a keyboard firmware based on the [tmk\_keyboard firmware](http://github.com/tmk/tmk_keyboard) with some useful features for Atmel AVR and ARM controllers, and more specifically, the [OLKB product line](https://olkb.com), the [ErgoDox EZ](http://www.ergodox-ez.com) keyboard, and the [Clueboard product line](http://clueboard.co/).
|
This is a keyboard firmware based on the [tmk\_keyboard firmware](https://github.com/tmk/tmk_keyboard) with some useful features for Atmel AVR and ARM controllers, and more specifically, the [OLKB product line](https://olkb.com), the [ErgoDox EZ](https://ergodox-ez.com) keyboard, and the [Clueboard product line](https://clueboard.co).
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
@@ -30,6 +30,6 @@ The project also includes community support for [lots of other keyboards](/keybo
|
|||||||
|
|
||||||
QMK is developed and maintained by Jack Humbert of OLKB with contributions from the community, and of course, [Hasu](https://github.com/tmk). The OLKB product firmwares are maintained by [Jack Humbert](https://github.com/jackhumbert), the Ergodox EZ by [Erez Zukerman](https://github.com/ezuk), the Clueboard by [Zach White](https://github.com/skullydazed), and the Atreus by [Phil Hagelberg](https://github.com/technomancy).
|
QMK is developed and maintained by Jack Humbert of OLKB with contributions from the community, and of course, [Hasu](https://github.com/tmk). The OLKB product firmwares are maintained by [Jack Humbert](https://github.com/jackhumbert), the Ergodox EZ by [Erez Zukerman](https://github.com/ezuk), the Clueboard by [Zach White](https://github.com/skullydazed), and the Atreus by [Phil Hagelberg](https://github.com/technomancy).
|
||||||
|
|
||||||
## Official website
|
## Official Website
|
||||||
|
|
||||||
[http://qmk.fm](http://qmk.fm) is the official website of QMK, where you can find links to this page, the documentation, and the keyboards supported by QMK.
|
[qmk.fm](https://qmk.fm) is the official website of QMK, where you can find links to this page, the documentation, and the keyboards supported by QMK.
|
||||||
@@ -11,3 +11,17 @@
|
|||||||
#define RSPC_KEYS KC_RSFT, KC_TRNS, KC_RBRC
|
#define RSPC_KEYS KC_RSFT, KC_TRNS, KC_RBRC
|
||||||
#define LCPO_KEYS KC_LCTL, KC_TRNS, KC_MINS
|
#define LCPO_KEYS KC_LCTL, KC_TRNS, KC_MINS
|
||||||
#define RCPO_KEYS KC_RCTL, KC_TRNS, KC_EQL
|
#define RCPO_KEYS KC_RCTL, KC_TRNS, KC_EQL
|
||||||
|
|
||||||
|
// No need for the single versions when multi performance isn't a problem =D
|
||||||
|
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
|
||||||
|
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
|
||||||
|
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
|
||||||
|
#define DISABLE_RGB_MATRIX_SPLASH
|
||||||
|
#define DISABLE_RGB_MATRIX_SOLID_SPLASH
|
||||||
|
|
||||||
|
// Don't like or feel to identical to other effects
|
||||||
|
#define DISABLE_RGB_MATRIX_RAINBOW_BEACON
|
||||||
|
#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
|
||||||
|
#define DISABLE_RGB_MATRIX_DIGITAL_RAIN
|
||||||
|
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
|
||||||
|
#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
|
||||||
@@ -11,6 +11,10 @@ qk_tap_dance_action_t tap_dance_actions[] = {
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(RGB_MATRIX_ENABLE)
|
||||||
|
extern void eeconfig_update_rgb_matrix_default(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
switch (keycode) {
|
switch (keycode) {
|
||||||
case QWERTY:
|
case QWERTY:
|
||||||
@@ -56,12 +60,16 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
case RGBRST:
|
case RGBRST:
|
||||||
#ifdef RGBLIGHT_ENABLE
|
#if defined(RGBLIGHT_ENABLE)
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
eeconfig_update_rgblight_default();
|
eeconfig_update_rgblight_default();
|
||||||
rgblight_enable();
|
rgblight_enable();
|
||||||
}
|
}
|
||||||
#endif
|
#elif defined(RGB_MATRIX_ENABLE)
|
||||||
|
if (record->event.pressed) {
|
||||||
|
eeconfig_update_rgb_matrix_default();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user