Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1620d78e73 | ||
|
|
fc54d62111 | ||
|
|
f5422a70b6 | ||
|
|
e3b3c1ef82 |
No files matched your search
@@ -0,0 +1,82 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2012 Doyu Studio <[email protected]>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef CONFIG_H
|
||||||
|
#define CONFIG_H
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
/* USB Device descriptor parameter */
|
||||||
|
#define VENDOR_ID 0xFEED
|
||||||
|
#define PRODUCT_ID 0x6060
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER Shopkey by Doyu Studio
|
||||||
|
#define PRODUCT Do60
|
||||||
|
#define DESCRIPTION Do60 Keyboard PCB by Doyu Studio
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 5
|
||||||
|
#define MATRIX_COLS 15
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Keyboard Matrix Assignments
|
||||||
|
*
|
||||||
|
* Change this to how you wired your keyboard
|
||||||
|
* COLS: AVR pins used for columns, left to right
|
||||||
|
* ROWS: AVR pins used for rows, top to bottom
|
||||||
|
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||||
|
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 }
|
||||||
|
#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B7, B5, B4, D7, D6, B3, B0 }
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
/* Backlight Setup */
|
||||||
|
#define BACKLIGHT_PIN F4
|
||||||
|
#define BACKLIGHT_LEVELS 6
|
||||||
|
//#define BACKLIGHT_BREATHING
|
||||||
|
|
||||||
|
/* COL2ROW or ROW2COL */
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||||
|
#define DEBOUNCING_DELAY 5
|
||||||
|
|
||||||
|
/* RGB Underglow
|
||||||
|
* F5 PIN for DO60's pre-soldered WS2812 LEDs
|
||||||
|
*/
|
||||||
|
#define RGB_DI_PIN F5
|
||||||
|
#define RGBLIGHT_ANIMATIONS
|
||||||
|
#define RGBLED_NUM 20 // Number of LEDs
|
||||||
|
#define RGBLIGHT_HUE_STEP 10
|
||||||
|
#define RGBLIGHT_SAT_STEP 15
|
||||||
|
#define RGBLIGHT_VAL_STEP 15
|
||||||
|
|
||||||
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||||
|
#define LOCKING_SUPPORT_ENABLE
|
||||||
|
/* Locking resynchronize hack */
|
||||||
|
#define LOCKING_RESYNC_ENABLE
|
||||||
|
|
||||||
|
/* key combination for magic key command */
|
||||||
|
#define IS_COMMAND() ( \
|
||||||
|
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||||
|
)
|
||||||
|
|
||||||
|
#define TAPPING_TERM 200
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
#include "do60.h"
|
||||||
|
|
||||||
|
|
||||||
|
extern inline void do60_caps_led_on(void);
|
||||||
|
extern inline void do60_bl_led_on(void);
|
||||||
|
|
||||||
|
extern inline void do60_caps_led_off(void);
|
||||||
|
extern inline void do60_bl_led_off(void);
|
||||||
|
|
||||||
|
|
||||||
|
void led_set_kb(uint8_t usb_led) {
|
||||||
|
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
|
||||||
|
do60_caps_led_on();
|
||||||
|
} else {
|
||||||
|
do60_caps_led_off();
|
||||||
|
}
|
||||||
|
|
||||||
|
led_set_user(usb_led);
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
#ifndef DO60_H
|
||||||
|
#define DO60_H
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
#include "led.h"
|
||||||
|
|
||||||
|
/* DO60 LEDs
|
||||||
|
* GPIO pads
|
||||||
|
* 0 F7 not connected
|
||||||
|
* 1 F6 RGB PWM Underglow
|
||||||
|
* 2 F5 Backlight LED
|
||||||
|
* 3 F4 not connected
|
||||||
|
* B2 Capslock LED
|
||||||
|
* B0 not connected
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
inline void do60_caps_led_on(void) { DDRB |= (1<<2); PORTB &= ~(1<<2); }
|
||||||
|
inline void do60_bl_led_on(void) { DDRF |= (1<<4); PORTF &= ~(1<<4); }
|
||||||
|
|
||||||
|
inline void do60_caps_led_off(void) { DDRB &= ~(1<<2); PORTB &= ~(1<<2); }
|
||||||
|
inline void do60_bl_led_off(void) { DDRF &= ~(1<<4); PORTF &= ~(1<<4); }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Do60 Keymap Definition Macro */
|
||||||
|
#define KEYMAP( \
|
||||||
|
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \
|
||||||
|
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, \
|
||||||
|
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2E, \
|
||||||
|
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \
|
||||||
|
K40, K41, K42, K45, K46, K47, K4A, K4B, K4C, K4D, K4E \
|
||||||
|
) { \
|
||||||
|
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \
|
||||||
|
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, KC_NO, K1E }, \
|
||||||
|
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, KC_NO, K2E }, \
|
||||||
|
{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \
|
||||||
|
{ K40, K41, K42, KC_NO,KC_NO,K45, K46, K47, KC_NO,KC_NO,K4A, K4B, K4C, K4D, K4E } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
#include "do60.h"
|
||||||
|
#include "action_layer.h"
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
// 0: Base Layer
|
||||||
|
[0] = KEYMAP(
|
||||||
|
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, \
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \
|
||||||
|
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \
|
||||||
|
KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, KC_NO, KC_UP, KC_SLSH, \
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_NO, KC_BSPC, KC_RGUI, F(0), KC_LEFT, KC_DOWN, KC_RIGHT),
|
||||||
|
|
||||||
|
// 1: Function Layer
|
||||||
|
[1] = KEYMAP(
|
||||||
|
RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, \
|
||||||
|
KC_NO, RGB_HUI, RGB_SAI, RGB_VAI, RGB_MOD, KC_HOME,KC_CALC,KC_NO, KC_INS, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_DEL, \
|
||||||
|
KC_NO, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SMOD, KC_END, KC_PGDN,KC_NO, KC_NO, KC_NO, KC_HOME, KC_PGUP, KC_NO, KC_ENT, \
|
||||||
|
KC_LSFT, KC_NO, KC_NO, KC_APP, BL_STEP, KC_NO, KC_NO, KC_VOLD,KC_VOLU,KC_MUTE, KC_END, KC_RSFT, KC_NO , KC_PGUP, KC_INS, \
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_BSPC,KC_SPC, KC_DEL, KC_RGUI, F(0), KC_HOME, KC_PGDOWN,KC_END),
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
// Custom Actions
|
||||||
|
const uint16_t PROGMEM fn_actions[] = {
|
||||||
|
[0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay
|
||||||
|
};
|
||||||
|
|
||||||
|
// Macros
|
||||||
|
/*
|
||||||
|
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||||
|
|
||||||
|
// MACRODOWN only works in this function
|
||||||
|
switch(id) {
|
||||||
|
case 0:
|
||||||
|
if (record->event.pressed) { register_code(KC_RSFT); }
|
||||||
|
else { unregister_code(KC_RSFT); }
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return MACRO_NONE;
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
// Loop
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
// Empty
|
||||||
|
};
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|

|
||||||
|
|
||||||
|
All of the keys which CAN have a function should be assigned one.
|
||||||
|
|
||||||
|
The keys with KC_NO cannot be assigned a value
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
#include "do60.h"
|
||||||
|
#include "action_layer.h"
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
// 0: Base Layer
|
||||||
|
[0] = KEYMAP(
|
||||||
|
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, KC_BSPC, \
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \
|
||||||
|
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \
|
||||||
|
KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_UP, \
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_BSPC,KC_SPC, KC_DEL, KC_RGUI, F(0), KC_LEFT, KC_DOWN, KC_RIGHT),
|
||||||
|
|
||||||
|
// 1: Function Layer
|
||||||
|
[1] = KEYMAP(
|
||||||
|
RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, \
|
||||||
|
KC_NO, RGB_HUI, RGB_SAI, RGB_VAI, RGB_MOD, KC_HOME,KC_CALC,KC_NO, KC_INS, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_DEL, \
|
||||||
|
KC_NO, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SMOD, KC_END, KC_PGDN,KC_NO, KC_NO, KC_NO, KC_HOME, KC_PGUP, KC_NO, KC_ENT, \
|
||||||
|
KC_LSFT, KC_NO, KC_NO, KC_APP, BL_STEP, KC_NO, KC_NO, KC_VOLD,KC_VOLU,KC_MUTE, KC_END, KC_RSFT, KC_NO , KC_PGUP, KC_INS, \
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_BSPC,KC_SPC, KC_DEL, KC_RGUI, F(0), KC_HOME, KC_PGDOWN,KC_END),
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
// Custom Actions
|
||||||
|
const uint16_t PROGMEM fn_actions[] = {
|
||||||
|
[0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay
|
||||||
|
};
|
||||||
|
|
||||||
|
// Macros
|
||||||
|
/*
|
||||||
|
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||||
|
|
||||||
|
// MACRODOWN only works in this function
|
||||||
|
switch(id) {
|
||||||
|
case 0:
|
||||||
|
if (record->event.pressed) { register_code(KC_RSFT); }
|
||||||
|
else { unregister_code(KC_RSFT); }
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return MACRO_NONE;
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
// Loop
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
// Empty
|
||||||
|
};
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|

|
||||||
|
|
||||||
|
All of the keys which CAN have a function should be assigned one.
|
||||||
|
|
||||||
|
The keys with KC_NO cannot be assigned a value
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# QMK Firmware for DoyuStudio DO60 PCB
|
||||||
|
|
||||||
|
|
||||||
|
## Quantum MK Firmware
|
||||||
|
For the full Quantum feature list, see [the parent readme.md](/readme.md).
|
||||||
|
|
||||||
|
Board supports in-switch LEDs (two-pin, single colour)
|
||||||
|
Build-in WS2182 RGB LED for underglow lighting.
|
||||||
|
|
||||||
|
## Build
|
||||||
|
To build the default keymap, simply run `make do60:default`.
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
# MCU name
|
||||||
|
MCU = atmega32u4
|
||||||
|
|
||||||
|
|
||||||
|
# Processor frequency.
|
||||||
|
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||||
|
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||||
|
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||||
|
# automatically to create a 32-bit value in your source code.
|
||||||
|
#
|
||||||
|
# This will be an integer division of F_USB below, as it is sourced by
|
||||||
|
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||||
|
# does not *change* the processor frequency - it should merely be updated to
|
||||||
|
# reflect the processor speed set externally so that the code can use accurate
|
||||||
|
# software delays.
|
||||||
|
F_CPU = 16000000
|
||||||
|
|
||||||
|
|
||||||
|
# LUFA specific
|
||||||
|
# Target architecture (see library "Board Types" documentation).
|
||||||
|
ARCH = AVR8
|
||||||
|
|
||||||
|
|
||||||
|
# Input clock frequency.
|
||||||
|
# This will define a symbol, F_USB, in all source code files equal to the
|
||||||
|
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||||
|
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||||
|
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||||
|
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||||
|
# at the end, this will be done automatically to create a 32-bit value in your
|
||||||
|
# source code.
|
||||||
|
#
|
||||||
|
# If no clock division is performed on the input clock inside the AVR (via the
|
||||||
|
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||||
|
F_USB = $(F_CPU)
|
||||||
|
|
||||||
|
|
||||||
|
# Interrupt driven control endpoint task(+60)
|
||||||
|
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||||
|
|
||||||
|
|
||||||
|
# Boot Section Size in *bytes*
|
||||||
|
# Teensy halfKay 512
|
||||||
|
# Teensy++ halfKay 1024
|
||||||
|
# Atmel DFU loader 4096
|
||||||
|
# LUFA bootloader 4096
|
||||||
|
# USBaspLoader 2048
|
||||||
|
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||||
|
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
AUDIO_ENABLE = no # Audio output on port C6
|
||||||
|
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
|
||||||
|
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||||
|
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
|
||||||
|
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||||
|
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||||
|
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||||
|
MIDI_ENABLE = no # MIDI controls
|
||||||
|
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||||
|
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
|
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||||
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
UNICODE_ENABLE = no # Unicode
|
||||||
@@ -49,6 +49,7 @@ void matrix_init(void)
|
|||||||
|
|
||||||
memset(matrix, 0, MATRIX_ROWS);
|
memset(matrix, 0, MATRIX_ROWS);
|
||||||
memset(matrix_debouncing, 0, MATRIX_ROWS);
|
memset(matrix_debouncing, 0, MATRIX_ROWS);
|
||||||
|
matrix_init_quantum();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t matrix_scan(void)
|
uint8_t matrix_scan(void)
|
||||||
@@ -102,6 +103,7 @@ uint8_t matrix_scan(void)
|
|||||||
}
|
}
|
||||||
debouncing = false;
|
debouncing = false;
|
||||||
}
|
}
|
||||||
|
matrix_scan_quantum();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,3 +15,20 @@ You should have received a copy of the GNU General Public License
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "whitefox.h"
|
#include "whitefox.h"
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_init_kb(void) {
|
||||||
|
matrix_init_user();
|
||||||
|
};
|
||||||
|
|
||||||
|
void matrix_scan_kb(void) {
|
||||||
|
matrix_scan_user();
|
||||||
|
};
|
||||||
|
|
||||||
@@ -0,0 +1,504 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
#include "led.h"
|
||||||
|
#include "mousekey.h"
|
||||||
|
#include "debug.h"
|
||||||
|
#include "action_layer.h"
|
||||||
|
#include "action_util.h"
|
||||||
|
|
||||||
|
#define BASE 0 // default layer
|
||||||
|
#define SYMB 1 // symbols layer
|
||||||
|
#define MDIA 2 // media layer
|
||||||
|
#define SPEC 3 // special layer
|
||||||
|
#define RBASE 4 // reverse default layer
|
||||||
|
|
||||||
|
#define LSymb 10 // left symbol-shift key
|
||||||
|
#define LMdia 11 // left media-shift key
|
||||||
|
#define LSpec 12 // left special-shift key
|
||||||
|
#define RSymb 13 // right symbol-shift key
|
||||||
|
#define RMdia 14 // right media-shift key
|
||||||
|
#define RSpec 15 // right special-shift key
|
||||||
|
|
||||||
|
#define NotEq 16 // != macro
|
||||||
|
#define GrtEq 17 // >= macro
|
||||||
|
#define LesEq 18 // <= macro
|
||||||
|
#define DeRef 19 // -> macro
|
||||||
|
|
||||||
|
#define MUL 20 // mouse up left
|
||||||
|
#define MUR 21 // mouse up right
|
||||||
|
#define MDL 22 // mouse down left
|
||||||
|
#define MDR 23 // mouse down right
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The Ordinary Layout for the Ergodox EZ keyboard, v5
|
||||||
|
*
|
||||||
|
* Modifications from the default Ergodox EZ layout
|
||||||
|
* by Nicholas Keene [email protected]
|
||||||
|
*
|
||||||
|
* No rights reserved. This software is in the public domain.
|
||||||
|
* Credit me if you are friendly but if you're a jerk don't bother.
|
||||||
|
* If you use or modify this layout I would love to hear from you.
|
||||||
|
*
|
||||||
|
* Details: readme.md
|
||||||
|
* https://github.com/nrrkeene/qmk_firmware/tree/master/keyboards/ergodox/keymaps/ordinary
|
||||||
|
*/
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
/******* Base Layer ****************************************************************************************************
|
||||||
|
*
|
||||||
|
* ,------------------------------------------------------. ,------------------------------------------------------.
|
||||||
|
* | Special `~ | 1 | 2 | 3 | 4 | 5 | ESC | | - | 6 | 7 | 8 | 9 | 0 | =+ Special |
|
||||||
|
* |------------+------+------+------+------+-------------| |------+------+------+------+------+------+------------|
|
||||||
|
* | Media Tab | Q | W | E | R | T |Shift | | Tab | Y | U | I | O | P | \| Media |
|
||||||
|
* |------------+------+------+------+------+------|-Tab | | |------+------+------+------+------+------------|
|
||||||
|
* | Symbol | ^A | S | D | ^F | G |------| |------| H | ^J | K | L | ^; | '" Symbol |
|
||||||
|
* |------------+------+------+------+------+------| [ | | ] |------+------+------+------+------+------------|
|
||||||
|
* | Capitals | Z | X | C | V | B | | | | N | M | , | . | / | Capitals |
|
||||||
|
* `------------+------+------+------+------+-------------' `-------------+------+------+------+------+------------'
|
||||||
|
* | Left | Right | LCtrl | LAlt | LGui| | RGui | RAlt | RCtrl | Up | Down |
|
||||||
|
* `-----------------------------------' `-----------------------------------'
|
||||||
|
* ,-------------. ,-------------.
|
||||||
|
* | Home | End | | Left | Right|
|
||||||
|
* ,------|------|------| |------+------+------.
|
||||||
|
* | | | PgUp | | Up | | |
|
||||||
|
* |Backsp| Del |------| |------| Enter| Space|
|
||||||
|
* | | | PgDn | | Down | | |
|
||||||
|
* `--------------------' `--------------------'
|
||||||
|
*/
|
||||||
|
[BASE] = LAYOUT_ergodox(
|
||||||
|
// left hand
|
||||||
|
F(LSpec) ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_ESC
|
||||||
|
,F(LMdia) ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,LSFT(KC_TAB)
|
||||||
|
,M(LSymb) ,LT(RBASE, KC_A),KC_S ,KC_D ,LT(RBASE, KC_F) ,KC_G
|
||||||
|
,KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_LBRC
|
||||||
|
,KC_LEFT ,KC_RIGHT ,KC_LCTL,KC_LALT,KC_LGUI
|
||||||
|
,KC_HOME,KC_END
|
||||||
|
,KC_PGUP
|
||||||
|
,KC_BSPC,KC_DEL ,KC_PGDN
|
||||||
|
// right hand
|
||||||
|
,KC_MINS ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,F(RSpec)
|
||||||
|
,KC_TAB ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,F(RMdia)
|
||||||
|
,KC_H ,LT(RBASE, KC_J),KC_K ,KC_L ,LT(RBASE,KC_SCLN),F(RSymb)
|
||||||
|
,KC_RBRC ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH ,KC_RSFT
|
||||||
|
,KC_RGUI ,KC_RALT,KC_RCTL,KC_UP ,KC_DOWN
|
||||||
|
,KC_LEFT ,KC_RGHT
|
||||||
|
,KC_UP
|
||||||
|
,KC_DOWN ,KC_ENT ,KC_SPC
|
||||||
|
),
|
||||||
|
|
||||||
|
/******* Symbols Layer *************************************************************************************************
|
||||||
|
*
|
||||||
|
* ,-----------------------------------------------------. ,-----------------------------------------------------.
|
||||||
|
* | | F1 | F2 | F3 | F4 | F5 | Esc | | - | F6 | F7 | F8 | F9 | F10 | |
|
||||||
|
* |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------|
|
||||||
|
* | | ! | @ | { | } | & | < | | > | | | 7 | 8 | 9 | / | |
|
||||||
|
* |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------|
|
||||||
|
* | | # | $ | ( | ) | ` |------| |------| / | 4 | 5 | 6 | * | |
|
||||||
|
* |-----------+------+------+------+------+------| ' | | " |------+------+------+------+------+-----------|
|
||||||
|
* | | % | ^ | [ | ] | ~ | | | | \ | 1 | 2 | 3 | - | |
|
||||||
|
* `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------'
|
||||||
|
* | ; | & | * | < | > | | 0 | . | = | + | Enter |
|
||||||
|
* `-----------------------------------' `-----------------------------------'
|
||||||
|
* ,-------------. ,-------------.
|
||||||
|
* | |||| | |||| | | |||| | |||| |
|
||||||
|
* ,------|------|------| |------+------+------.
|
||||||
|
* | Plus | Equal| |||| | | |||| | Under| Dash |
|
||||||
|
* | | |------| |------| Score| |
|
||||||
|
* | + | = | != | | -> | _ | - |
|
||||||
|
* `--------------------' `--------------------'
|
||||||
|
*/
|
||||||
|
[SYMB] = LAYOUT_ergodox(
|
||||||
|
// left hand
|
||||||
|
KC_TRNS ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_ESC
|
||||||
|
,KC_TRNS ,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_AMPR ,LSFT(KC_COMM)
|
||||||
|
,KC_TRNS ,KC_HASH ,KC_DLR ,KC_LPRN ,KC_RPRN ,KC_GRV
|
||||||
|
,KC_TRNS ,KC_PERC ,KC_CIRC ,KC_LBRC ,KC_RBRC ,KC_TILD ,KC_QUOT
|
||||||
|
,KC_SCLN ,KC_AMPR ,KC_ASTR ,LSFT(KC_COMM),LSFT(KC_DOT)
|
||||||
|
,M(GrtEq),M(LesEq)
|
||||||
|
,KC_NO
|
||||||
|
,KC_PLUS ,KC_EQL ,M(NotEq)
|
||||||
|
// right hand
|
||||||
|
,KC_MINS ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_TRNS
|
||||||
|
,LSFT(KC_DOT),KC_PIPE ,KC_7 ,KC_8 ,KC_9 ,KC_SLSH ,KC_TRNS
|
||||||
|
,KC_SLSH ,KC_4 ,KC_5 ,KC_6 ,KC_ASTR ,KC_TRNS
|
||||||
|
,LSFT(KC_QUOT),KC_BSLS ,KC_1 ,KC_2 ,KC_3 ,KC_MINS ,KC_TRNS
|
||||||
|
,KC_0 ,KC_DOT ,KC_EQL,KC_PLUS ,KC_ENT
|
||||||
|
,KC_NO ,KC_NO
|
||||||
|
,KC_NO
|
||||||
|
,M(DeRef) ,LSFT(KC_MINS),KC_MINS
|
||||||
|
),
|
||||||
|
|
||||||
|
/******* Media Layer *******************************************************************************************************
|
||||||
|
*
|
||||||
|
* ,---------------------------------------------------------------. ,---------------------------------------------------------------.
|
||||||
|
* | | F11 | F12 | F13 | F14 | F15 | Esc | | |||| | F16 | F17 | F18 | F19 | F20 | |
|
||||||
|
* |------+---------+---------+---------+---------+----------------| |------+---------+---------+---------+---------+---------+------|
|
||||||
|
* | |Shut Down|MouseUpLf|Mouse Up |MouseUpRg|Volume Up|Scroll| |Scroll|PrintScrn| Home | Up | PgUp | Mail | |
|
||||||
|
* |------+---------+---------+---------+---------+---------| Up | | Up |---------+---------+---------+---------+---------+------|
|
||||||
|
* | | Sleep |MouseLeft|MouseDown|MouseRght|Volume Dn|------| |------| Num Lock| Left | Down | Right | MyComp | |
|
||||||
|
* |------+---------+---------+---------+---------+---------|Scroll| |Scroll|---------+---------+---------+---------+---------+------|
|
||||||
|
* | | |||| |MouseDnLf|MouseDown|MouseDnRg| Mute | Down | | Down | |||| | End | Down | PgDn | |||| | |
|
||||||
|
* `------+---------+---------+---------+---------+----------------' `----------------+---------+---------+---------+---------+------'
|
||||||
|
* | ||| | |||| | MClick | LClick | R Click| | Insert | Del | |||| | |||| | ||| |
|
||||||
|
* `---------------------------------------------' `---------------------------------------------'
|
||||||
|
* ,-------------. ,-------------.
|
||||||
|
* | Stop |Refrsh| | Prev | Next |
|
||||||
|
* ,------|------|------| |------+------+------.
|
||||||
|
* |Brwser|Brwser|Search| |VolUp | | |
|
||||||
|
* |Back | Fwd |------| |------| Stop | Play-|
|
||||||
|
* | | | Home | |VolDn | | Pause|
|
||||||
|
* `--------------------' `--------------------'
|
||||||
|
*/
|
||||||
|
[MDIA] = LAYOUT_ergodox(
|
||||||
|
// left hand
|
||||||
|
KC_TRNS ,KC_F11 ,KC_F12 ,KC_F13 ,KC_F14 ,KC_F15 ,KC_ESC
|
||||||
|
,KC_TRNS ,KC_POWER ,M(MUL) ,KC_MS_U ,M(MUR) ,KC_VOLU ,KC_WH_U
|
||||||
|
,KC_TRNS ,KC_SLEP ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_VOLD
|
||||||
|
,KC_TRNS ,KC_NO ,M(MDL) ,KC_MS_D ,M(MDR) ,KC_MUTE ,KC_WH_D
|
||||||
|
,KC_NO ,KC_NO ,KC_BTN3 ,KC_BTN1 ,KC_BTN2
|
||||||
|
,KC_WSTP ,KC_WREF
|
||||||
|
,KC_WSCH
|
||||||
|
,KC_WBAK ,KC_NO ,KC_WHOM
|
||||||
|
// right hand
|
||||||
|
,KC_NO ,KC_F16 ,KC_F17 ,KC_F18 ,KC_F19 ,KC_F20 ,KC_TRNS
|
||||||
|
,KC_WH_U ,KC_PSCR ,KC_HOME ,KC_UP ,KC_PGUP ,KC_MAIL ,KC_TRNS
|
||||||
|
,KC_NLCK ,KC_LEFT ,KC_DOWN ,KC_RIGHT,KC_MYCM ,KC_TRNS
|
||||||
|
,KC_WH_D ,KC_NO ,KC_END ,KC_DOWN ,KC_PGDN ,KC_NO ,KC_TRNS
|
||||||
|
,KC_INS ,KC_DEL ,KC_NO ,KC_NO ,KC_NO
|
||||||
|
,KC_MPRV ,KC_MNXT
|
||||||
|
,KC_VOLU
|
||||||
|
,KC_VOLD ,KC_MSTP ,KC_MPLY
|
||||||
|
),
|
||||||
|
|
||||||
|
/******* Special Layer *****************************************************************************************************
|
||||||
|
*
|
||||||
|
* ,-------------------------------------------------------. ,-------------------------------------------------------.
|
||||||
|
* | | Esc | | | | | | | | | | | - | Bspc | |
|
||||||
|
* |-------------+------+------+------+------+-------------| |------+------+------+------+------+------+-------------|
|
||||||
|
* | Media Lock | | | | | | | | | | | | [ | ] | Media Lock |
|
||||||
|
* |-------------+------+------+------+------+------| | | |------+------+------+------+------+-------------|
|
||||||
|
* | Symbol Lock | | | | | |------| |------| | | | | | Symbol Lock |
|
||||||
|
* |-------------+------+------+------+------+------| | | |------+------+------+------+------+-------------|
|
||||||
|
* | Caps Lock | | | | | | | | | | | | | | Caps Lock |
|
||||||
|
* `-------------+------+------+------+------+-------------' `-------------+------+------+------+------+-------------'
|
||||||
|
* | | | | | | | | | | | |
|
||||||
|
* `------------------------------------' `------------------------------------'
|
||||||
|
* ,-------------. ,-------------.
|
||||||
|
* | | | | | |
|
||||||
|
* ,------|------|------| |------+------+------.
|
||||||
|
* | | | | | | | |
|
||||||
|
* | | |------| |------| | |
|
||||||
|
* | | | | | | | |
|
||||||
|
* `--------------------' `--------------------'
|
||||||
|
*/
|
||||||
|
[SPEC] = LAYOUT_ergodox(
|
||||||
|
// left hand
|
||||||
|
KC_TRNS ,KC_ESC ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS
|
||||||
|
,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS
|
||||||
|
,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS
|
||||||
|
,KC_CAPS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS
|
||||||
|
,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS
|
||||||
|
,KC_TRNS ,KC_TRNS
|
||||||
|
,KC_TRNS
|
||||||
|
,KC_TRNS,KC_TRNS ,KC_TRNS
|
||||||
|
// right hand
|
||||||
|
,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_MINS ,KC_BSPC ,KC_TRNS
|
||||||
|
,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_LBRC ,KC_RBRC ,KC_TRNS
|
||||||
|
,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS
|
||||||
|
,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_CAPS
|
||||||
|
,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS
|
||||||
|
,KC_TRNS ,KC_TRNS
|
||||||
|
,KC_TRNS
|
||||||
|
,KC_TRNS ,KC_TRNS ,KC_TRNS
|
||||||
|
),
|
||||||
|
|
||||||
|
/******* Reverse Base Layer *********************************************************************************************
|
||||||
|
*
|
||||||
|
* ,------------------------------------------------------. ,------------------------------------------------------.
|
||||||
|
* | =+ | 0 | 9 | 8 | 7 | 6 | - | | Esc | 5 | 4 | 3 | 2 | 1 | `~ |
|
||||||
|
* |------------+------+------+------+------+-------------| |------+------+------+------+------+------+------------|
|
||||||
|
* | \| | P | O | I | U | Y | ] | | [ | T | R | E | W | Q | Tab |
|
||||||
|
* |------------+------+------+------+------+------| | | |------+------+------+------+------+------------|
|
||||||
|
* | '" | ; | L | K | J | H |------| |------| G | F | D | S | A | |
|
||||||
|
* |------------+------+------+------+------+------| Tab | |Shift |------+------+------+------+------+------------|
|
||||||
|
* | Capitals | / | . | , | M | N | | | -Tab | B | V | C | X | Z | Capitals |
|
||||||
|
* `------------+------+------+------+------+-------------' `-------------+------+------+------+------+------------'
|
||||||
|
* | LCtrl | Meh |Hyper | LAlt | LGui | | RGui | RAlt | Hyper| Meh | RCtrl |
|
||||||
|
* `-----------------------------------' `-----------------------------------'
|
||||||
|
* ,-------------. ,-------------.
|
||||||
|
* | Left | Right| | Home | End |
|
||||||
|
* ,------|------|------| |------+------+------.
|
||||||
|
* | | | Up | | PgUp | | |
|
||||||
|
* |Space |Enter |------| |------|BackSp| Del |
|
||||||
|
* | | | Down | | PgDn | | |
|
||||||
|
* `--------------------' `--------------------'
|
||||||
|
*/
|
||||||
|
[RBASE] = LAYOUT_ergodox(
|
||||||
|
// left hand
|
||||||
|
KC_EQL ,KC_0 ,KC_9 ,KC_8 ,KC_7 ,KC_6 ,KC_MINS
|
||||||
|
,KC_BSLS ,KC_P ,KC_O ,KC_I ,KC_U ,KC_Y ,KC_RBRC
|
||||||
|
,KC_QUOT ,LT(RBASE, KC_SCLN) ,KC_L ,KC_K ,LT(RBASE, KC_J) ,KC_H
|
||||||
|
,KC_RSFT ,KC_SLSH ,KC_DOT ,KC_COMM,KC_M ,KC_N ,KC_TAB
|
||||||
|
,KC_RCTL ,MEH_T(KC_NO),ALL_T(KC_NO),KC_RALT,KC_RGUI
|
||||||
|
,KC_LEFT ,KC_RGHT
|
||||||
|
,KC_UP
|
||||||
|
,KC_SPC ,KC_ENT ,KC_DOWN
|
||||||
|
// right hand
|
||||||
|
,KC_ESC ,KC_5 ,KC_4 ,KC_3 ,KC_2 ,KC_1 ,KC_GRV
|
||||||
|
,KC_LBRC ,KC_T ,KC_R ,KC_E ,KC_W ,KC_Q ,KC_TAB
|
||||||
|
,KC_G ,LT(RBASE, KC_F),KC_D ,KC_S ,LT(RBASE, KC_A) ,KC_NO
|
||||||
|
,LSFT(KC_TAB),KC_B ,KC_V ,KC_C ,KC_X ,KC_Z ,KC_LSFT
|
||||||
|
,KC_LGUI,KC_LALT,KC_HYPR ,KC_MEH,KC_LCTL
|
||||||
|
,KC_HOME ,KC_END
|
||||||
|
,KC_PGUP
|
||||||
|
,KC_PGDN ,KC_BSPC ,KC_DEL
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM fn_actions[] = {
|
||||||
|
// the faux shift keys are implemented as macro taps
|
||||||
|
[LSymb] = ACTION_MACRO_TAP(LSymb)
|
||||||
|
,[LMdia] = ACTION_MACRO_TAP(LMdia)
|
||||||
|
,[LSpec] = ACTION_MACRO_TAP(LSpec)
|
||||||
|
,[RSymb] = ACTION_MACRO_TAP(RSymb)
|
||||||
|
,[RMdia] = ACTION_MACRO_TAP(RMdia)
|
||||||
|
,[RSpec] = ACTION_MACRO_TAP(RSpec)
|
||||||
|
};
|
||||||
|
|
||||||
|
uint16_t symb_shift = 0;
|
||||||
|
uint16_t mdia_shift = 0;
|
||||||
|
uint16_t spec_shift = 0;
|
||||||
|
|
||||||
|
bool mdia_lock = false;
|
||||||
|
bool symb_lock = false;
|
||||||
|
|
||||||
|
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||||
|
{
|
||||||
|
switch(id) {
|
||||||
|
// There are two shift keys for each layer so we increment a layer_shift var when one
|
||||||
|
// is pressed and decrement when one is released. The shift counts are bound between 0 and 2
|
||||||
|
// only because sometimes rapid pressing led to irregular events; this way the states
|
||||||
|
// are self healing during use.
|
||||||
|
|
||||||
|
case LSymb: //
|
||||||
|
if (record->event.pressed) { // when the LSymb button is pressed
|
||||||
|
if(++symb_shift > 2) symb_shift = 2; // increment the symb shift count, max two
|
||||||
|
if(spec_shift) symb_lock = !symb_lock; // if the Special layer is on, toggle the shift lock
|
||||||
|
layer_on(SYMB); // in any case, turn on the Symbols layer
|
||||||
|
} else { // when the LSymb button is released
|
||||||
|
if(--symb_shift < 0) symb_shift = 0; // decrement the shift count, minimum zero
|
||||||
|
if((!symb_shift) && (!symb_lock)) layer_off(SYMB); // if both shifts are released and the lock is off, turn off the Symbols layer
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LMdia:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
if (record->tap.count && (!mdia_shift) && (!mdia_lock) && (!spec_shift)) {
|
||||||
|
register_code(KC_TAB);
|
||||||
|
} else {
|
||||||
|
if(spec_shift) mdia_lock = !mdia_lock;
|
||||||
|
if(++mdia_shift > 2) mdia_shift = 2;
|
||||||
|
layer_on(MDIA);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(record->tap.count && (!mdia_shift) && (!mdia_lock) && (!spec_shift)) {
|
||||||
|
unregister_code(KC_TAB);
|
||||||
|
} else {
|
||||||
|
if(--mdia_shift < 0) mdia_shift = 0;
|
||||||
|
if((!mdia_shift) && (!mdia_lock)) layer_off(MDIA);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LSpec:
|
||||||
|
if (record->event.pressed) { // when the LSpec button is pressed
|
||||||
|
if(symb_shift) symb_lock = !symb_lock; // if another layer button is engaged, then
|
||||||
|
else if(mdia_shift) mdia_lock = !mdia_lock; // lock that layer, be it caps or symb or mdia
|
||||||
|
else if (record->tap.count && !record->tap.interrupted && (!spec_shift)) {
|
||||||
|
register_code(KC_GRV); // otherwise, if it's an uninterrupted tap, emit a char
|
||||||
|
} else {
|
||||||
|
if(++spec_shift > 2) spec_shift = 2;
|
||||||
|
layer_on(SPEC); // otherwise, turn on the Special layer
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(record->tap.count && !record->tap.interrupted && (!spec_shift)) {
|
||||||
|
unregister_code(KC_GRV);
|
||||||
|
} else {
|
||||||
|
if(--spec_shift < 0) spec_shift = 0;
|
||||||
|
if(!spec_shift) layer_off(SPEC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RSymb:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
if (record->tap.count && (!symb_shift) && (!symb_lock) && (!spec_shift)) {
|
||||||
|
register_code(KC_QUOT);
|
||||||
|
} else {
|
||||||
|
if(++symb_shift > 2) symb_shift = 2;
|
||||||
|
if(spec_shift) symb_lock = !symb_lock;
|
||||||
|
layer_on(SYMB);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(record->tap.count && (!symb_shift) && (!symb_lock) && (!spec_shift)) {
|
||||||
|
unregister_code(KC_QUOT);
|
||||||
|
} else {
|
||||||
|
if(--symb_shift < 0) symb_shift = 0;
|
||||||
|
if((!symb_shift) && (!symb_lock)) layer_off(SYMB);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RMdia:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
if (record->tap.count && (!mdia_shift) && (!mdia_lock) && (!spec_shift)) {
|
||||||
|
register_code(KC_BSLS);
|
||||||
|
} else {
|
||||||
|
if(++mdia_shift > 2) mdia_shift = 2;
|
||||||
|
if(spec_shift) mdia_lock = !mdia_lock;
|
||||||
|
layer_on(MDIA);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(record->tap.count && (!mdia_shift) && (!mdia_lock) && (!spec_shift)) {
|
||||||
|
unregister_code(KC_BSLS);
|
||||||
|
} else {
|
||||||
|
if(--mdia_shift < 0) mdia_shift = 0;
|
||||||
|
if((!mdia_shift) && (!mdia_lock)) layer_off(MDIA);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RSpec:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
if(symb_shift) symb_lock = !symb_lock;
|
||||||
|
else if(mdia_shift) mdia_lock = !mdia_lock;
|
||||||
|
else if (record->tap.count && !record->tap.interrupted && (!spec_shift)) {
|
||||||
|
register_code(KC_EQL);
|
||||||
|
} else {
|
||||||
|
if(++spec_shift > 2) spec_shift = 2;
|
||||||
|
layer_on(SPEC);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(record->tap.count && !record->tap.interrupted && (!spec_shift)) {
|
||||||
|
unregister_code(KC_EQL);
|
||||||
|
} else {
|
||||||
|
if(--spec_shift < 0) spec_shift = 0;
|
||||||
|
if(!spec_shift) layer_off(SPEC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NotEq:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
return MACRO( I(10), D(LSFT), T(1), U(LSFT), T(EQL), END ); // !=
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GrtEq:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
return MACRO( I(10), D(LSFT), T(COMM), U(LSFT), T(EQL), END ); // <=
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case LesEq:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
return MACRO( I(10), D(LSFT), T(DOT), U(LSFT), T(EQL), END ); // >=
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DeRef:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
return MACRO( I(10), T(MINS), D(LSFT), T(DOT), U(LSFT), END ); // ->
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
// mouse diagonals
|
||||||
|
|
||||||
|
case MUL: // mouse up left
|
||||||
|
if (record->event.pressed) {
|
||||||
|
mousekey_on(KC_MS_UP);
|
||||||
|
mousekey_on(KC_MS_LEFT);
|
||||||
|
mousekey_send();
|
||||||
|
} else {
|
||||||
|
mousekey_off(KC_MS_UP);
|
||||||
|
mousekey_off(KC_MS_LEFT);
|
||||||
|
mousekey_send();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MUR: // mouse up right
|
||||||
|
if (record->event.pressed) {
|
||||||
|
mousekey_on(KC_MS_UP);
|
||||||
|
mousekey_on(KC_MS_RIGHT);
|
||||||
|
mousekey_send();
|
||||||
|
} else {
|
||||||
|
mousekey_off(KC_MS_UP);
|
||||||
|
mousekey_off(KC_MS_RIGHT);
|
||||||
|
mousekey_send();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MDL: // mouse down left
|
||||||
|
if (record->event.pressed) {
|
||||||
|
mousekey_on(KC_MS_DOWN);
|
||||||
|
mousekey_on(KC_MS_LEFT);
|
||||||
|
mousekey_send();
|
||||||
|
} else {
|
||||||
|
mousekey_off(KC_MS_DOWN);
|
||||||
|
mousekey_off(KC_MS_LEFT);
|
||||||
|
mousekey_send();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MDR: // mouse down right
|
||||||
|
if (record->event.pressed) {
|
||||||
|
mousekey_on(KC_MS_DOWN);
|
||||||
|
mousekey_on(KC_MS_RIGHT);
|
||||||
|
mousekey_send();
|
||||||
|
} else {
|
||||||
|
mousekey_off(KC_MS_DOWN);
|
||||||
|
mousekey_off(KC_MS_RIGHT);
|
||||||
|
mousekey_send();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
// none
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return MACRO_NONE;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Runs just one time when the keyboard initializes.
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
// Runs constantly in the background, in a loop.
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
// shift or caps lock turns on red light
|
||||||
|
if((keyboard_report->mods & MOD_BIT(KC_LSFT))
|
||||||
|
|| (keyboard_report->mods & MOD_BIT(KC_RSFT))
|
||||||
|
|| (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK))) {
|
||||||
|
ergodox_right_led_1_on();
|
||||||
|
} else {
|
||||||
|
ergodox_right_led_1_off();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Symbol layer turns on green light
|
||||||
|
if(layer_state & (1UL<<SYMB)) {
|
||||||
|
ergodox_right_led_2_on();
|
||||||
|
} else {
|
||||||
|
ergodox_right_led_2_off();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Media layer turns on blue light
|
||||||
|
if(layer_state & (1UL<<MDIA)) {
|
||||||
|
ergodox_right_led_3_on();
|
||||||
|
} else {
|
||||||
|
ergodox_right_led_3_off();
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
[{x:3.5},"#\n3",{x:10.5},"*\n8"],
|
||||||
|
[{y:-0.875,x:2.5},"@\n2",{x:1},"$\n4",{x:8.5},"&\n7",{x:1},"(\n9"],
|
||||||
|
[{y:-0.875,x:5.5},"%\n5",{c:"#ff4444"},"Esc",{x:4.5,c:"#cccccc"},"_\n\n\n\n\n\n-","^\n6"],
|
||||||
|
[{y:-0.875,c:"#c6c600",w:1.5},"Special\n\n~\n\n\n\nShift\n`",{c:"#cccccc"},"!\n1",{x:14.5},")\n0",{c:"#c6c600",w:1.5},"+\n\nSpecial\n\n\n\n=\nShift"],
|
||||||
|
[{y:-0.375,x:3.5,c:"#cccccc"},"E",{x:10.5},"I"],
|
||||||
|
[{y:-0.875,x:2.5},"W",{x:1},"R",{x:8.5},"U",{x:1},"O"],
|
||||||
|
[{y:-0.875,x:5.5},"T",{h:1.5},"{\n\n\n\n\n\n[",{x:4.5,h:1.5},"}\n\n\n\n\n\n]","Y"],
|
||||||
|
[{y:-0.875,c:"#c6c600",t:"#002299",w:1.5},"Media\n\nTab\n\n\n\nShift",{c:"#cccccc",t:"#000000"},"Q",{x:14.5},"P",{c:"#c6c600",t:"#002299",w:1.5},"|\n\\\nMedia\n\n\n\n\nShift"],
|
||||||
|
[{y:-0.375,x:3.5,c:"#cccccc",t:"#000000"},"D",{x:10.5},"K"],
|
||||||
|
[{y:-0.875,x:2.5},"S",{x:1,fa:[0,0,0,1]},"F\n\n\nreverse",{x:8.5},"J\n\n\nreverse",{x:1},"L"],
|
||||||
|
[{y:-0.875,x:5.5},"G",{x:6.5},"H"],
|
||||||
|
[{y:-0.875,c:"#c6c600",t:"#007d00",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#cccccc",t:"#000000"},"A\n\n\nreverse",{x:14.5},":\n;\n\nreverse",{c:"#c6c600",t:"#007d00",w:1.5},"\"\n'\nSymbols\n\n\n\n\nShift"],
|
||||||
|
[{y:-0.625,x:6.5,c:"#ff8500",t:"#000000",h:1.5},"< Tab\n\n\nShift Tab",{x:4.5,h:1.5},"Tab >\n\n\nTab"],
|
||||||
|
[{y:-0.75,x:3.5,c:"#cccccc"},"C",{x:10.5},"<\n,"],
|
||||||
|
[{y:-0.875,x:2.5},"X",{x:1},"V",{x:8.5},"M",{x:1},">\n."],
|
||||||
|
[{y:-0.875,x:5.5},"B",{x:6.5},"N"],
|
||||||
|
[{y:-0.875,c:"#c6c600",t:"#9e0000",w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#cccccc",t:"#000000"},"Z",{x:14.5},"?\n/",{c:"#c6c600",t:"#9e0000",w:1.5},"\n\nCapitals\n\n\n\n\nShift"],
|
||||||
|
[{y:-0.375,x:3.5,c:"#dddd77",t:"#000000"},"Option\n\n\nLAlt",{x:10.5},"Option\n\n\nRAlt"],
|
||||||
|
[{y:-0.875,x:2.5},"Hyper",{x:1},"Cmd\n\n\nSuper",{x:8.5},"Cmd\n\n\nSuper",{x:1},"Hyper"],
|
||||||
|
[{y:-0.75,x:0.5},"Ctrl\n\n\nLCtrl","Meh",{x:14.5},"Meh","Ctrl\n\n\nRCtrl"],
|
||||||
|
[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#ff8500"},"Home","End"],
|
||||||
|
[{h:2},"< Del\n\n\nBackspace",{h:2},"Del >\n\n\nDelete","Page\n\n\n\n\n\nUp"],
|
||||||
|
[{x:2},"Page\n\n\n\n\n\nDown"],
|
||||||
|
[{r:-30,rx:13,y:-1,x:-3},"Left","Right"],
|
||||||
|
[{x:-3},"Up",{h:2},"Enter",{h:2},"Space"],
|
||||||
|
[{x:-3},"Down"]
|
||||||
|
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
[{x:3.5,c:"#99de2a"},"F13",{x:10.5},"F18"],
|
||||||
|
[{y:-0.875,x:2.5},"F12",{x:1},"F14",{x:8.5},"F17",{x:1},"F19"],
|
||||||
|
[{y:-0.875,x:5.5},"F15",{c:"#ff4444"},"Esc",{x:4.5,c:"#737373",a:7},"",{c:"#99de2a",a:4},"F16"],
|
||||||
|
[{y:-0.875,c:"#c6c600",w:1.5},"Shift\n\n\n\n\n\nLock",{c:"#99de2a"},"F11",{x:14.5},"F20",{c:"#c6c600",w:1.5},"\n\nShift\n\n\n\n\nLock"],
|
||||||
|
[{y:-0.375,x:3.5,c:"#0066cc"},"Mouse\n\n\n\n\n\nUp",{x:10.5},"Cursor\n\n\n\n\n\nUp"],
|
||||||
|
[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nUpLeft",{x:1},"Mouse\n\n\n\n\n\nUpRgt",{x:8.5,c:"#1e8fff"},"Home",{x:1},"Page\n\n\n\n\n\nUp"],
|
||||||
|
[{y:-0.875,x:5.5,c:"#9977ee"},"Vol\n\n\n\n\n\nUp",{c:"#1e8fff",h:1.5},"Scroll\n\n\n\n\n\nUp",{x:4.5,h:1.5},"Scroll\n\n\n\n\n\nUp",{c:"#9977ee"},"Print\n\n\n\n\n\nScreen"],
|
||||||
|
[{y:-0.875,c:"#000000",t:"#3f68ff",w:1.5},"Media\n\n\n\n\n\nShift",{c:"#9977ee",t:"#000000"},"Shut\n\n\n\n\n\nDown",{x:14.5},"Mail",{c:"#000000",t:"#3f68ff",w:1.5},"\n\nMedia\n\n\n\n\nShift"],
|
||||||
|
[{y:-0.375,x:3.5,c:"#0066cc",t:"#000000"},"Mouse\n\n\n\n\n\nDown",{x:10.5},"Cursor\n\n\n\n\n\nDown"],
|
||||||
|
[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nLeft",{x:1},"Mouse\n\n\n\n\n\nRight",{x:8.5},"Cursor\n\n\n\n\n\nLeft",{x:1},"Cursor\n\n\n\n\n\nRight"],
|
||||||
|
[{y:-0.875,x:5.5,c:"#9977ee"},"Vol\n\n\n\n\n\nDown",{x:6.5},"Num\n\n\n\n\n\nLock"],
|
||||||
|
[{y:-0.875,c:"#c6c600",t:"#007d00",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#9977ee",t:"#000000"},"Sleep",{x:14.5},"My\n\n\n\n\n\nComp",{c:"#c6c600",t:"#007d00",w:1.5},"\n\nSymbols\n\n\n\n\nShift"],
|
||||||
|
[{y:-0.625,x:6.5,c:"#1e8fff",t:"#000000",h:1.5},"Scroll\n\n\n\n\n\nDown",{x:4.5,h:1.5},"Scroll\n\n\n\n\n\nDown"],
|
||||||
|
[{y:-0.75,x:3.5,c:"#0066cc"},"Mouse\n\n\n\n\n\nDown",{x:10.5},"Cursor\n\n\n\n\n\nDown"],
|
||||||
|
[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nDnLeft",{x:1},"Mouse\n\n\n\n\n\nDnRgt",{x:8.5,c:"#1e8fff"},"End",{x:1},"Page\n\n\n\n\n\nDown"],
|
||||||
|
[{y:-0.875,x:5.5,c:"#9977ee"},"Mute",{x:6.5,c:"#737373",a:7},""],
|
||||||
|
[{y:-0.875,c:"#c6c600",t:"#9e0000",a:4,w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#737373",t:"#000000",a:7},"",{x:14.5},"",{c:"#c6c600",t:"#9e0000",a:4,w:1.5},"\n\nCapitals\n\n\n\n\nShift"],
|
||||||
|
[{y:-0.375,x:3.5,c:"#0066cc",t:"#000000"},"Middle\n\n\n\n\n\nClick",{x:10.5,c:"#1e8fff"},"Delete"],
|
||||||
|
[{y:-0.875,x:2.5,c:"#0066cc"},"Left\n\n\n\n\n\nClick",{x:1},"Right\n\n\n\n\n\nClick",{x:8.5,c:"#1e8fff"},"Insert",{x:1,c:"#737373",a:7},""],
|
||||||
|
[{y:-0.75,x:0.5},"","",{x:14.5},"",""],
|
||||||
|
[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#6633ee",a:4,fa:[0,0,0,1]},"Stop\n\n\nBrowser","Reload\n\n\nBrowser"],
|
||||||
|
[{h:2},"< Web\n\n\nBrowser",{h:2},"Web >\n\n\nBrowser","Search\n\n\nBrowser"],
|
||||||
|
[{x:2},"Home\n\n\nBrowser"],
|
||||||
|
[{r:-30,rx:13,y:-1,x:-3},"Prev\n\n\nAudio\n\n\nTrack","Next\n\n\nAudio\n\n\nTrack"],
|
||||||
|
[{x:-3,c:"#9977ee"},"Vol\n\n\n\n\n\nUp",{c:"#6633ee",h:2},"Stop\n\n\nAudio",{h:2},"Play\n\n\nAudio\n\n\nPause"],
|
||||||
|
[{x:-3,c:"#9977ee"},"Vol\n\n\n\n\n\nDown"]
|
||||||
|
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
[{x:3.5,a:7},"",{x:10.5},""],
|
||||||
|
[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1,a:4},"_\n\n\n\n\n\n-"],
|
||||||
|
[{y:-0.875,x:5.5,a:7},"",{c:"#ff4444",a:4},"Esc",{x:4.5,c:"#cccccc",a:7},"",""],
|
||||||
|
[{y:-0.875,c:"#000000",t:"#ff0000",a:4,w:1.5},"Special\n\n\n\n\n\nShift",{c:"#ff4444",t:"#000000"},"Esc",{x:14.5,c:"#ff8500"},"Back\n\n\n\n\n\nspace",{c:"#000000",t:"#ff0000",w:1.5},"\n\nSpecial\n\n\n\n\nShift"],
|
||||||
|
[{y:-0.375,x:3.5,c:"#cccccc",t:"#000000",a:7},"",{x:10.5},""],
|
||||||
|
[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1,a:4},"{\n["],
|
||||||
|
[{y:-0.875,x:5.5,a:7},"",{h:1.5},"",{x:4.5,h:1.5},"",""],
|
||||||
|
[{y:-0.875,c:"#c6c600",t:"#002299",a:4,w:1.5},"Media\n\n\n\n\n\nLock",{c:"#cccccc",t:"#000000",a:7},"",{x:14.5,a:4},"\n\n}\n]",{c:"#c6c600",t:"#002299",w:1.5},"Media\n\n\n\n\n\nLock"],
|
||||||
|
[{y:-0.375,x:3.5,c:"#cccccc",t:"#000000",a:7},"",{x:10.5},""],
|
||||||
|
[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""],
|
||||||
|
[{y:-0.875,x:5.5},"",{x:6.5},""],
|
||||||
|
[{y:-0.875,c:"#c6c600",t:"#007d00",a:4,w:1.5},"Symbols\n\n\n\n\n\nLock",{c:"#cccccc",t:"#000000",a:7},"",{x:14.5},"",{c:"#c6c600",t:"#007d00",a:4,w:1.5},"Symbols\n\n\n\n\n\nLock"],
|
||||||
|
[{y:-0.625,x:6.5,c:"#cccccc",t:"#000000",a:7,h:1.5},"",{x:4.5,h:1.5},""],
|
||||||
|
[{y:-0.75,x:3.5},"",{x:10.5},""],
|
||||||
|
[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""],
|
||||||
|
[{y:-0.875,x:5.5},"",{x:6.5},""],
|
||||||
|
[{y:-0.875,c:"#c6c600",t:"#9e0000",a:4,w:1.5},"Capitals\n\n\n\n\n\nLock",{c:"#cccccc",t:"#000000",a:7},"",{x:14.5},"",{c:"#c6c600",t:"#9e0000",a:4,w:1.5},"Capitals\n\n\n\n\n\nLock"],
|
||||||
|
[{y:-0.375,x:3.5,c:"#cccccc",t:"#000000",a:7},"",{x:10.5},""],
|
||||||
|
[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""],
|
||||||
|
[{y:-0.75,x:0.5},"","",{x:14.5},"",""],
|
||||||
|
[{r:30,rx:6.5,ry:4.25,y:-1,x:1},"",""],
|
||||||
|
[{h:2},"",{h:2},"",""],
|
||||||
|
[{x:2},""],
|
||||||
|
[{r:-30,rx:13,y:-1,x:-3},"",""],
|
||||||
|
[{x:-3},"",{h:2},"",{h:2},""],
|
||||||
|
[{x:-3},""]
|
||||||
|
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
[{x:3.5,c:"#99de2a"},"F3",{x:10.5},"F8"],
|
||||||
|
[{y:-0.875,x:2.5},"F2",{x:1},"F4",{x:8.5},"F7",{x:1},"F9"],
|
||||||
|
[{y:-0.875,x:5.5},"F5",{c:"#ff4444"},"Esc",{x:4.5,c:"#bbddbb"},"_\n\n\n\n\n\n-",{c:"#99de2a"},"F6"],
|
||||||
|
[{y:-0.875,c:"#c6c600",w:1.5},"Shift\n\n\n\n\n\nLock",{c:"#99de2a"},"F1",{x:14.5},"F10",{c:"#c6c600",w:1.5},"\n\nShift\n\n\n\n\nLock"],
|
||||||
|
[{y:-0.375,x:3.5,c:"#bbddbb"},"{",{x:10.5,c:"#89b087"},"8"],
|
||||||
|
[{y:-0.875,x:2.5,c:"#bbddbb"},"@",{x:1},"}",{x:8.5,c:"#89b087"},"7",{x:1},"9"],
|
||||||
|
[{y:-0.875,x:5.5,c:"#bbddbb"},"&",{h:1.5},"<",{x:4.5,h:1.5},">","|"],
|
||||||
|
[{y:-0.875,c:"#c6c600",t:"#002299",w:1.5},"Media\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"!",{x:14.5,c:"#89b087"},"/",{c:"#c6c600",t:"#002299",w:1.5},"\n\nMedia\n\n\n\n\nShift"],
|
||||||
|
[{y:-0.375,x:3.5,c:"#bbddbb",t:"#000000"},"(",{x:10.5,c:"#89b087"},"5"],
|
||||||
|
[{y:-0.875,x:2.5,c:"#bbddbb"},"$",{x:1},")",{x:8.5,c:"#89b087"},"4",{x:1},"6"],
|
||||||
|
[{y:-0.875,x:5.5,c:"#bbddbb"},"`",{x:6.5},"/"],
|
||||||
|
[{y:-0.875,c:"#000000",t:"#007d00",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"#",{x:14.5,c:"#89b087"},"*",{c:"#000000",t:"#007d00",w:1.5},"\n\nSymbols\n\n\n\n\nShift"],
|
||||||
|
[{y:-0.625,x:6.5,c:"#bbddbb",t:"#000000",a:6,h:1.5},"'",{x:4.5,h:1.5},"\""],
|
||||||
|
[{y:-0.75,x:3.5,a:4},"[",{x:10.5,c:"#89b087"},"2"],
|
||||||
|
[{y:-0.875,x:2.5,c:"#bbddbb"},"^",{x:1},"]",{x:8.5,c:"#89b087"},"1",{x:1},"3"],
|
||||||
|
[{y:-0.875,x:5.5,c:"#bbddbb"},"~",{x:6.5},"\\"],
|
||||||
|
[{y:-0.875,c:"#c6c600",t:"#9e0000",w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"%",{x:14.5,c:"#89b087"},"-",{c:"#c6c600",t:"#9e0000",w:1.5},"\n\nCapitals\n\n\n\n\nShift"],
|
||||||
|
[{y:-0.375,x:3.5,c:"#bbddbb",t:"#000000"},"<",{x:10.5,c:"#89b087"},"."],
|
||||||
|
[{y:-0.875,x:2.5,c:"#bbddbb"},"*",{x:1},">",{x:8.5,c:"#89b087"},"0",{x:1},"="],
|
||||||
|
[{y:-0.75,x:0.5,c:"#bbddbb"},";","&",{x:14.5,c:"#89b087"},"+","Enter"],
|
||||||
|
[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#bbddbb"},"<=",">="],
|
||||||
|
[{a:7,h:2},"+",{h:2},"=",{c:"#737373"},""],
|
||||||
|
[{x:2,c:"#bbddbb",a:4},"!="],
|
||||||
|
[{r:-30,rx:13,y:-1,x:-3,c:"#737373",a:7},"",""],
|
||||||
|
[{x:-3},"",{c:"#bbddbb",h:2},"_",{h:2},"-"],
|
||||||
|
[{x:-3,a:4},"->"]
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# The Ordinary Layout for OSX #
|
||||||
|
|
||||||
|
It is based on [Ordinary Layout](../ordinary/readme.md) with some keys re-mapped for OSX.
|
||||||
@@ -88,6 +88,16 @@ void layer_clear(void)
|
|||||||
layer_state_set(0);
|
layer_state_set(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool layer_state_is(uint8_t layer)
|
||||||
|
{
|
||||||
|
return layer_state_cmp(layer_state, layer);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool layer_state_cmp(uint32_t cmp_layer_state, uint8_t layer) {
|
||||||
|
if (layer == 0) { return cmp_layer_state == 0; }
|
||||||
|
return (cmp_layer_state & (1UL<<layer)) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
void layer_move(uint8_t layer)
|
void layer_move(uint8_t layer)
|
||||||
{
|
{
|
||||||
layer_state_set(1UL<<layer);
|
layer_state_set(1UL<<layer);
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ void default_layer_xor(uint32_t state);
|
|||||||
extern uint32_t layer_state;
|
extern uint32_t layer_state;
|
||||||
void layer_debug(void);
|
void layer_debug(void);
|
||||||
void layer_clear(void);
|
void layer_clear(void);
|
||||||
|
bool layer_state_is(uint8_t layer);
|
||||||
|
bool layer_state_cmp(uint32_t layer1, uint8_t layer2);
|
||||||
void layer_move(uint8_t layer);
|
void layer_move(uint8_t layer);
|
||||||
void layer_on(uint8_t layer);
|
void layer_on(uint8_t layer);
|
||||||
void layer_off(uint8_t layer);
|
void layer_off(uint8_t layer);
|
||||||
|
|||||||
Reference in new issue
Block a user