forked from mirror/qmk_firmware
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6cf9402cbc | ||
|
|
76aa2baf3e | ||
|
|
423b419138 | ||
|
|
4e2817eff1 | ||
|
|
31d12662bd | ||
|
|
44a348d56f | ||
|
|
85f315ad65 | ||
|
|
2c3e617fba | ||
|
|
088b476343 | ||
|
|
4c9372a081 | ||
|
|
4930e22dda | ||
|
|
0beb945554 | ||
|
|
bf0bb1a4db | ||
|
|
64459fedbf | ||
|
|
47e29754c2 | ||
|
|
ec86141a4a | ||
|
|
f0f9283d02 | ||
|
|
9fbd7eb7a5 | ||
|
|
d7dea0e6d9 | ||
|
|
533f684887 | ||
|
|
d81d216d72 |
@@ -110,8 +110,28 @@ ifneq ("$(wildcard $(KEYBOARD_C_1))","")
|
||||
KEYBOARD_SRC += $(KEYBOARD_C_1)
|
||||
endif
|
||||
|
||||
OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE)
|
||||
# Generate KEYBOARD_name_subname for all levels of the keyboard folder
|
||||
KEYBOARD_FILESAFE_1 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_1)))
|
||||
KEYBOARD_FILESAFE_2 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_2)))
|
||||
KEYBOARD_FILESAFE_3 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_3)))
|
||||
KEYBOARD_FILESAFE_4 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_4)))
|
||||
KEYBOARD_FILESAFE_5 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_5)))
|
||||
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_5)/)","")
|
||||
OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_5)
|
||||
endif
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_4)/)","")
|
||||
OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_4)
|
||||
endif
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_3)/)","")
|
||||
OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_3)
|
||||
endif
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_2)/)","")
|
||||
OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_2)
|
||||
endif
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_1)/)","")
|
||||
OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_1)
|
||||
endif
|
||||
|
||||
# Setup the define for QMK_KEYBOARD_H. This is used inside of keymaps so
|
||||
# that the same keymap may be used on multiple keyboards.
|
||||
|
||||
@@ -117,12 +117,12 @@ void led_set_user(uint8_t usb_led) {
|
||||
} else {
|
||||
PORTB &= ~(1<<2);
|
||||
}
|
||||
if (usb_led & (1<<USB_LED_COMPOSE_LOCK)) {
|
||||
if (usb_led & (1<<USB_LED_COMPOSE)) {
|
||||
PORTB |= (1<<3);
|
||||
} else {
|
||||
PORTB &= ~(1<<3);
|
||||
}
|
||||
if (usb_led & (1<<USB_LED_KANA_LOCK)) {
|
||||
if (usb_led & (1<<USB_LED_KANA)) {
|
||||
PORTB |= (1<<4);
|
||||
} else {
|
||||
PORTB &= ~(1<<4);
|
||||
|
||||
@@ -8,7 +8,7 @@ Start on the [QMK Github page](https://github.com/qmk/qmk_firmware), and you'll
|
||||
|
||||

|
||||
|
||||
If you're apart of an organization, you'll need to choose which account to fork it to. In most circumstances, you'll want to fork it to your personal account. Once your fork is completed (sometimes this takes a little while), click the "Clone or Download" button:
|
||||
If you're a part of an organization, you'll need to choose which account to fork it to. In most circumstances, you'll want to fork it to your personal account. Once your fork is completed (sometimes this takes a little while), click the "Clone or Download" button:
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -20,13 +20,17 @@
|
||||
enum contra_layers {
|
||||
_QWERTZ,
|
||||
_FUNC,
|
||||
_NUMROW
|
||||
_NUMROW,
|
||||
_NUMROW_L3,
|
||||
_GAMING
|
||||
};
|
||||
|
||||
#define KC_I3 LM(_NUMROW, MOD_LALT)
|
||||
#define KC_NR MO(_NUMROW)
|
||||
#define NR_L3 SAFE_RANGE
|
||||
#define FUN MO(_FUNC)
|
||||
#define G_1 TO(_GAMING)
|
||||
#define G_0 TG(_GAMING)
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
@@ -52,7 +56,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | | | | | | | | Ü | | Ö | | Del |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Lock | Ä | ß | | | | | RGBS | RGBB | RGBS | | |
|
||||
* | Lock | Ä | ß | | | GAME | | RGBS | RGBB | RGBS | | |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | | | | | | | RGBH-| RGBT | RGBH+| PgUp | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
@@ -61,14 +65,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
*/
|
||||
[_FUNC] = {
|
||||
{_______, _______, _______, _______, _______, _______, _______, DE_UE, _______, DE_OE, _______, KC_DEL },
|
||||
{KC_LOCK, DE_AE, DE_SS, _______, _______, _______, _______, RGB_M_P, RGB_M_B, RGB_M_SW,_______, _______},
|
||||
{KC_LOCK, DE_AE, DE_SS, _______, _______, G_1, _______, RGB_M_P, RGB_M_B, RGB_M_SW,_______, _______},
|
||||
{_______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_TOG, RGB_HUI, KC_PGUP, _______},
|
||||
{_______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, KC_HOME, KC_PGDN, KC_END }
|
||||
},
|
||||
|
||||
/* Numrow layer (special characters with Shift and ISO_L3_Shift)
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ß |
|
||||
* | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | #' | |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
@@ -78,25 +82,61 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_NUMROW] = {
|
||||
{_______, DE_1, DE_2, DE_3, DE_4, DE_5, DE_6, DE_7, DE_8, DE_9, DE_0, DE_SS },
|
||||
{_______, DE_1, DE_2, DE_3, DE_4, DE_5, DE_6, DE_7, DE_8, DE_9, DE_0, _______},
|
||||
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, DE_HASH, _______},
|
||||
{_______, DE_LESS, _______, _______, _______, _______, _______, _______, _______, _______, DE_MINS, _______},
|
||||
{_______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, _______, _______, _______}
|
||||
},
|
||||
[_NUMROW_L3] = {
|
||||
{_______, DE_1, DE_2, DE_3, DE_4, DE_5, DE_6, DE_7, DE_8, DE_9, DE_0, _______},
|
||||
{_______, DE_Q, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
|
||||
{_______, DE_LESS, _______, _______, _______, _______, _______, _______, _______, _______, DE_MINS, _______},
|
||||
{_______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, _______, _______, _______}
|
||||
},
|
||||
|
||||
/* Gaming
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Space| | | | | | | | Reset| | | |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_GAMING] = {
|
||||
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
|
||||
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
|
||||
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
|
||||
{KC_SPC, _______, _______, _______, _______, _______, _______, _______, G_0, _______, _______, _______}
|
||||
}
|
||||
};
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (keycode == NR_L3) {
|
||||
if (record->event.pressed) {
|
||||
register_code(DE_ALGR);
|
||||
layer_on(_NUMROW);
|
||||
} else {
|
||||
layer_off(_NUMROW);
|
||||
unregister_code(DE_ALGR);
|
||||
}
|
||||
return false;
|
||||
switch(keycode) {
|
||||
case KC_BSPC:
|
||||
if (record->event.pressed) {
|
||||
if (get_mods() & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT))) {
|
||||
register_code(DE_SS);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
unregister_code(DE_SS);
|
||||
}
|
||||
return true;
|
||||
case NR_L3:
|
||||
if (record->event.pressed) {
|
||||
register_code(DE_ALGR);
|
||||
layer_on(_NUMROW_L3);
|
||||
} else {
|
||||
layer_off(_NUMROW_L3);
|
||||
unregister_code(DE_ALGR);
|
||||
}
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
|
||||
@@ -40,3 +40,5 @@ ifdef HARDWARE_SERIAL
|
||||
else
|
||||
SRC += protocol/serial_soft.c
|
||||
endif
|
||||
|
||||
DEFAULT_FOLDER = converter/sun_usb/type5
|
||||
|
||||
31
keyboards/converter/sun_usb/type5/keymaps/sigma/keymap.c
Normal file
31
keyboards/converter/sun_usb/type5/keymaps/sigma/keymap.c
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
Copyright 2018 Yann Hodique <yann.hodique@gmail.com> @sigma
|
||||
|
||||
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 "sigma.h"
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] =
|
||||
{
|
||||
[_QWERTY] = LAYOUT_us_unix(
|
||||
KC_LEAD, KC_SCRT, KC_F1,KC_F2,KC_F3,KC_F4, KC_F5,KC_F6,KC_F7,KC_F8, KC_F9,KC_F10,KC_F11,KC_F12, KC_PSCR,KC_SLCK,KC_PAUS, KC_MUTE,KC_VOLD,KC_VOLU,KC_OS_LOCK,
|
||||
KC_STOP, KC_OS_REDO, KC_ESC,KC_1,KC_2,KC_3,KC_4,KC_5,KC_6,KC_7,KC_8,KC_9,KC_0,KC_MINS,KC_EQL,KC_BSLS,KC_GRV, KC_INS, KC_HOME,KC_PGUP, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS,
|
||||
VRSN, KC_OS_UNDO, KC_TAB, KC_Q,KC_W,KC_E,KC_R,KC_T,KC_Y,KC_U,KC_I,KC_O,KC_P,KC_LBRC,KC_RBRC, KC_BSPC, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS,
|
||||
KC_MAKE, KC_OS_COPY, KC_LCTL, KC_A,KC_S,KC_D,KC_F,KC_G,KC_H,KC_J,KC_K,KC_L,KC_SCLN,KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6,
|
||||
KC_EXECUTE,KC_OS_PASTE, KC_LSFT, KC_Z,KC_X,KC_C,KC_V,KC_B,KC_N,KC_M,KC_COMM,KC_DOT,KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT,
|
||||
KC_FIND, KC_OS_CUT, KC_CAPS,KC_LGUI,KC_LALT, KC_SPC, KC_RGUI,KC_APP,KC_RALT, KC_LEFT,KC_DOWN,KC_RGHT, KC_P0, KC_PDOT
|
||||
),
|
||||
};
|
||||
12
keyboards/converter/sun_usb/type5/keymaps/sigma/readme.md
Normal file
12
keyboards/converter/sun_usb/type5/keymaps/sigma/readme.md
Normal file
@@ -0,0 +1,12 @@
|
||||
Overview
|
||||
========
|
||||
|
||||
This is my personal Sun Type 5 configuration.
|
||||
|
||||
How to build
|
||||
------------
|
||||
|
||||
make converter/sun_usb/type5:sigma:teensy
|
||||
|
||||
Layers
|
||||
------
|
||||
1
keyboards/converter/sun_usb/type5/keymaps/sigma/rules.mk
Normal file
1
keyboards/converter/sun_usb/type5/keymaps/sigma/rules.mk
Normal file
@@ -0,0 +1 @@
|
||||
BOOTLOADER = halfkay
|
||||
@@ -34,10 +34,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
// #define TAPPING_FORCE_HOLD
|
||||
// #define TAPPING_TERM 100
|
||||
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
#undef RGBLED_NUM
|
||||
#define RGBLIGHT_ANIMATIONS
|
||||
#define RGBLED_NUM 27
|
||||
|
||||
#define RGBLIGHT_HUE_STEP 8
|
||||
#define RGBLIGHT_SAT_STEP 8
|
||||
#define RGBLIGHT_VAL_STEP 8
|
||||
#define RGBLIGHT_LIMIT_VAL 120
|
||||
#define RGBLIGHT_HUE_STEP 10
|
||||
#define RGBLIGHT_SAT_STEP 17
|
||||
#define RGBLIGHT_VAL_STEP 17
|
||||
#endif
|
||||
|
||||
@@ -20,37 +20,48 @@ enum crkbd_keycodes {
|
||||
RGBRST = NEW_SAFE_RANGE
|
||||
};
|
||||
|
||||
#define LAYOUT_crkbd_base( \
|
||||
K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \
|
||||
K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \
|
||||
K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \
|
||||
) \
|
||||
LAYOUT_wrapper( \
|
||||
KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \
|
||||
KC_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \
|
||||
KC_MLSF, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, CTL_T(K2A), KC_MRSF, \
|
||||
LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE \
|
||||
)
|
||||
#define LAYOUT_crkbd_base_wrapper(...) LAYOUT_crkbd_base(__VA_ARGS__)
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[_QWERTY] = LAYOUT_wrapper(
|
||||
KC_ESC, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC,
|
||||
KC_TAB, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT,
|
||||
KC_MLSF, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_MRSF,
|
||||
LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE
|
||||
[_QWERTY] = LAYOUT_crkbd_base_wrapper(
|
||||
_________________QWERTY_L1_________________, _________________QWERTY_R1_________________,
|
||||
_________________QWERTY_L2_________________, _________________QWERTY_R2_________________,
|
||||
_________________QWERTY_L3_________________, _________________QWERTY_R3_________________
|
||||
),
|
||||
[_COLEMAK] = LAYOUT_wrapper(
|
||||
KC_ESC, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC,
|
||||
KC_TAB, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT,
|
||||
KC_MLSF, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_MRSF,
|
||||
LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE
|
||||
|
||||
[_COLEMAK] = LAYOUT_crkbd_base_wrapper(
|
||||
_________________COLEMAK_L1________________, _________________COLEMAK_R1________________,
|
||||
_________________COLEMAK_L2________________, _________________COLEMAK_R2________________,
|
||||
_________________COLEMAK_L3________________, _________________COLEMAK_R3________________
|
||||
),
|
||||
[_DVORAK] = LAYOUT_wrapper(
|
||||
KC_ESC, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC,
|
||||
KC_TAB, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT,
|
||||
KC_MLSF, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_MRSF,
|
||||
LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE
|
||||
|
||||
[_DVORAK] = LAYOUT_crkbd_base_wrapper(
|
||||
_________________DVORAK_L1_________________, _________________DVORAK_R1_________________,
|
||||
_________________DVORAK_L2_________________, _________________DVORAK_R2_________________,
|
||||
_________________DVORAK_L3_________________, _________________DVORAK_R3_________________
|
||||
),
|
||||
[_WORKMAN] = LAYOUT_wrapper(
|
||||
KC_ESC, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC,
|
||||
KC_TAB, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT,
|
||||
KC_MLSF, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_MRSF,
|
||||
LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE
|
||||
|
||||
[_WORKMAN] = LAYOUT_crkbd_base_wrapper(
|
||||
_________________WORKMAN_L1________________, _________________WORKMAN_R1________________,
|
||||
_________________WORKMAN_L2________________, _________________WORKMAN_R2________________,
|
||||
_________________WORKMAN_L3________________, _________________WORKMAN_R3________________
|
||||
),
|
||||
|
||||
[_MODS] = LAYOUT_wrapper(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RSFT,
|
||||
_______, ___________________BLANK___________________, ___________________BLANK___________________, _______,
|
||||
_______, ___________________BLANK___________________, ___________________BLANK___________________, _______,
|
||||
KC_LSFT, ___________________BLANK___________________, ___________________BLANK___________________, KC_RSFT,
|
||||
_______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
@@ -65,7 +76,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, KC_BSPC,
|
||||
_______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS,
|
||||
_______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______,
|
||||
_______, _______, _______, _______, _______, _______ //`--------------------' `--------------------'
|
||||
_______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
[_ADJUST] = LAYOUT_wrapper( \
|
||||
|
||||
18
keyboards/dz60/keymaps/60_ansi/keymap.c
Normal file
18
keyboards/dz60/keymaps/60_ansi/keymap.c
Normal file
@@ -0,0 +1,18 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
LAYOUT_60_ansi(
|
||||
KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
|
||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL),
|
||||
|
||||
LAYOUT_60_ansi(
|
||||
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL,
|
||||
KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, RESET,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_HOME, KC_PGUP, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, BL_STEP, KC_TRNS, KC_DEL, KC_END, KC_PGDN, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS)
|
||||
};
|
||||
9
keyboards/dz60/keymaps/60_ansi/readme.md
Normal file
9
keyboards/dz60/keymaps/60_ansi/readme.md
Normal file
@@ -0,0 +1,9 @@
|
||||

|
||||
|
||||

|
||||
|
||||
# 60_ansi DZ60 Layout
|
||||
|
||||
This is a basic keymap for the 60_ansi layout of the DZ60.
|
||||
The default layer is normal ANSI and the Fn layer is used for RGB
|
||||
and backlighting functions.
|
||||
@@ -12,25 +12,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Shift | Z | X | C | V | B | N | M | , | . | / | RSh | U | DEL |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Ctrl | Alt | Cmd | Space | Cmd | FN | L | D | R |
|
||||
* | FN2 | Alt | Cmd | Space | Cmd | FN1 | L | D | R |
|
||||
* `-----------------------------------------------------------------------------------------'
|
||||
*/
|
||||
|
||||
LAYOUT_directional(
|
||||
KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, _______, KC_BSPC,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
|
||||
CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_DEL,
|
||||
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_RGUI, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT
|
||||
KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, _______, KC_BSPC,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
|
||||
CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_DEL,
|
||||
MO(2), KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_RGUI, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT
|
||||
),
|
||||
|
||||
/* FN Layer
|
||||
/* FN1 Layer
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | ` ~ | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | RESET |
|
||||
* | ` ~ | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | |RBB T|RGB M| Hue+| Hue-| Sat+| Sat-| Val+| Val-| | | | | |
|
||||
* | | | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | BL T| BL M| BL+ | BL- | | | | | | | | |
|
||||
* | | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | | | | | | | | |PgUp | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
@@ -39,10 +39,32 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
*/
|
||||
|
||||
LAYOUT_directional(
|
||||
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, RESET,
|
||||
_______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______,
|
||||
_______, BL_TOGG, BL_STEP, BL_INC, BL_DEC, _______, _______, _______, _______, _______, _______, _______,
|
||||
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDOWN, KC_END
|
||||
),
|
||||
|
||||
/* FN2 Layer (Media)
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | RESET |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | |RBB T|RGB M| Hue+| Hue-| Sat+| Sat-| Val+| Val-| | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | | | | | | | |Pl/Ps|Vol+ |Mute |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | | |Prev |Vol- |Next |
|
||||
* `-----------------------------------------------------------------------------------------'
|
||||
*/
|
||||
|
||||
LAYOUT_directional(
|
||||
KC_SLEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET,
|
||||
_______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_VOLU, KC_MUTE,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT
|
||||
),
|
||||
};
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#define FORCE_NKRO
|
||||
|
||||
#undef LSPO_KEY
|
||||
#undef RSPC_KEY
|
||||
#define LSPO_KEY KC_8 // Nordic Left SpaceCadet
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
#include "version.h"
|
||||
#include "keymap_swedish.h"
|
||||
|
||||
#define _______ KC_TRNS
|
||||
|
||||
#define BASE 0 // default layer
|
||||
#define SYMB 1 // symbols
|
||||
#define MDIA 2 // media keys
|
||||
@@ -47,8 +45,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | L4 | A | S | D | F | G |------| |------| H | J | K | L |Ö / L3| Ä/L2 |
|
||||
* | | | | | | | Hypr/| | Meh/ | | | | | | |
|
||||
* |--------+------+------+------+------+------| Esc | | Ent |------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+------| Back | |Forwd |------+------+------+------+------+--------|
|
||||
* | LShift/| Z | X | C | V | B | | | | N | M | ; | : | _ | RShift/|
|
||||
* | ( | | | | | | | | | | | , | . | - | ) |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
@@ -71,8 +69,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
NO_HALF, KC_1, KC_2, KC_3, KC_4, KC_5, KC_INS,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB),
|
||||
MO(ARRW), KC_A, KC_S, KC_D, KC_F, KC_G,
|
||||
KC_LSPO, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_ESC),
|
||||
CTL_T(NO_APOS), NO_ACUT, KC_LALT, KC_BSPC, KC_SPC,
|
||||
KC_LSPO, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_WBAK,
|
||||
CTL_T(NO_APOS), NO_ACUT, KC_LALT, KC_BSPC, KC_SPC,
|
||||
NO_LESS, KC_END,
|
||||
KC_LEFT, KC_RIGHT, KC_PGDN,
|
||||
CTL_T(KC_ENT), ALT_T(KC_ESC), KC_LGUI,
|
||||
@@ -81,7 +79,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
TO(ARRW), KC_6, KC_7, KC_8, KC_9, KC_0, NO_PLUS,
|
||||
TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, NO_AA,
|
||||
KC_H, KC_J, KC_K, KC_L, LT(MDIA, NO_OSLH), LT(SYMB, NO_AE),
|
||||
MEH_T(KC_ENT), KC_N, KC_M, KC_COMM, KC_DOT, NO_MINS, KC_RSPC,
|
||||
KC_WFWD, KC_N, KC_M, KC_COMM, KC_DOT, NO_MINS, KC_RSPC,
|
||||
KC_SPC, KC_BSPC, NO_ALGR, NO_ASTR, CTL_T(NO_TILD),
|
||||
KC_HOME, NO_CIRC,
|
||||
KC_PGUP, KC_UP, KC_DOWN,
|
||||
@@ -101,11 +99,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* | | | | | | | | . | 0 | = | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* |Animat| | |Toggle|Solid |
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* |------|------|------| |------|------|------|
|
||||
* |BNess-|Bness+| | | |Hue- |Hue+ |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// SYMBOLS
|
||||
@@ -116,18 +114,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
_______,KC_HASH,NO_DLR, NO_LPRN,NO_RPRN,NO_GRV,
|
||||
_______,KC_PERC,NO_CIRC,NO_LBRC,NO_RBRC,NO_TILD,_______,
|
||||
EPRM,_______,_______,_______,_______,
|
||||
RGB_MOD,_______,
|
||||
_______,_______,
|
||||
_______,_______,_______,
|
||||
_______,_______,_______,
|
||||
RGB_VAD,RGB_VAI,_______,
|
||||
// right hand
|
||||
_______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
|
||||
_______, KC_UP, KC_7, KC_8, KC_9, NO_ASTR, KC_F12,
|
||||
KC_DOWN, KC_4, KC_5, KC_6, NO_PLUS, _______,
|
||||
_______, NO_AMPR, KC_1, KC_2, KC_3, NO_MINS, _______,
|
||||
_______,KC_DOT, KC_0, NO_EQL, _______,
|
||||
RGB_TOG, RGB_SLD,
|
||||
_______, _______,
|
||||
_______, _______, _______,
|
||||
_______, RGB_HUD, RGB_HUI
|
||||
_______, _______, _______
|
||||
),
|
||||
|
||||
/* Keymap: Media and mouse keys
|
||||
@@ -183,10 +181,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
_______, _______, _______,
|
||||
// right hand
|
||||
TO(BASE), _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, KC_BTN4, KC_MS_U, KC_BTN5, _______, _______,
|
||||
_______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
KC_BTN1, KC_BTN3, KC_BTN2, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
_______, _______,
|
||||
_______, _______, _______,
|
||||
_______, _______, _______
|
||||
|
||||
@@ -15,76 +15,7 @@ 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 REV1_CONFIG_H
|
||||
#define REV1_CONFIG_H
|
||||
#pragma once
|
||||
|
||||
#include QMK_KEYBOARD_CONFIG_H
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xCEEB
|
||||
#define PRODUCT_ID 0x1256
|
||||
#define DEVICE_VER 0x0100
|
||||
#define MANUFACTURER JPConstantineau.com
|
||||
#define PRODUCT ErgoTravel Keyboard
|
||||
#define DESCRIPTION Split 45 percent ergonomic keyboard
|
||||
|
||||
/* key matrix size */
|
||||
// Rows are doubled-up
|
||||
#define MATRIX_ROWS 8
|
||||
#define MATRIX_COLS 7
|
||||
|
||||
// wiring of each half
|
||||
#define MATRIX_ROW_PINS { C6, D7, E6, B4 }
|
||||
#define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2, B6 }
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/* define if matrix has ghost */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* number of backlight levels */
|
||||
// #define BACKLIGHT_LEVELS 3
|
||||
|
||||
/* Set 0 if debouncing isn't needed */
|
||||
#define DEBOUNCING_DELAY 5
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/* key combination for command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
#define BACKLIGHT_PIN B5
|
||||
#define BACKLIGHT_LEVELS 5
|
||||
|
||||
/* ws2812 RGB LED */
|
||||
#define RGB_DI_PIN D3
|
||||
#define RGBLIGHT_TIMER
|
||||
#define RGBLED_NUM 12 // Number of LEDs
|
||||
#define ws2812_PORTREG PORTD
|
||||
#define ws2812_DDRREG DDRD
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
*/
|
||||
|
||||
/* disable debug print */
|
||||
// #define NO_DEBUG
|
||||
|
||||
/* disable print */
|
||||
// #define NO_PRINT
|
||||
|
||||
/* disable action features */
|
||||
//#define NO_ACTION_LAYER
|
||||
//#define NO_ACTION_TAPPING
|
||||
//#define NO_ACTION_ONESHOT
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#ifndef ERGOTRAVEL_H
|
||||
#define ERGOTRAVEL_H
|
||||
#pragma once
|
||||
|
||||
#ifdef KEYBOARD_ergotravel_rev1
|
||||
#include "rev1.h"
|
||||
@@ -21,4 +20,3 @@
|
||||
KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35 \
|
||||
)
|
||||
|
||||
#endif
|
||||
@@ -1,162 +0,0 @@
|
||||
#include <util/twi.h>
|
||||
#include <avr/io.h>
|
||||
#include <stdlib.h>
|
||||
#include <avr/interrupt.h>
|
||||
#include <util/twi.h>
|
||||
#include <stdbool.h>
|
||||
#include "i2c.h"
|
||||
|
||||
#ifdef USE_I2C
|
||||
|
||||
// Limits the amount of we wait for any one i2c transaction.
|
||||
// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is
|
||||
// 9 bits, a single transaction will take around 90μs to complete.
|
||||
//
|
||||
// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit
|
||||
// poll loop takes at least 8 clock cycles to execute
|
||||
#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8
|
||||
|
||||
#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE)
|
||||
|
||||
volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE];
|
||||
|
||||
static volatile uint8_t slave_buffer_pos;
|
||||
static volatile bool slave_has_register_set = false;
|
||||
|
||||
// Wait for an i2c operation to finish
|
||||
inline static
|
||||
void i2c_delay(void) {
|
||||
uint16_t lim = 0;
|
||||
while(!(TWCR & (1<<TWINT)) && lim < I2C_LOOP_TIMEOUT)
|
||||
lim++;
|
||||
|
||||
// easier way, but will wait slightly longer
|
||||
// _delay_us(100);
|
||||
}
|
||||
|
||||
// Setup twi to run at 100kHz
|
||||
void i2c_master_init(void) {
|
||||
// no prescaler
|
||||
TWSR = 0;
|
||||
// Set TWI clock frequency to SCL_CLOCK. Need TWBR>10.
|
||||
// Check datasheets for more info.
|
||||
TWBR = ((F_CPU/SCL_CLOCK)-16)/2;
|
||||
}
|
||||
|
||||
// Start a transaction with the given i2c slave address. The direction of the
|
||||
// transfer is set with I2C_READ and I2C_WRITE.
|
||||
// returns: 0 => success
|
||||
// 1 => error
|
||||
uint8_t i2c_master_start(uint8_t address) {
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTA);
|
||||
|
||||
i2c_delay();
|
||||
|
||||
// check that we started successfully
|
||||
if ( (TW_STATUS != TW_START) && (TW_STATUS != TW_REP_START))
|
||||
return 1;
|
||||
|
||||
TWDR = address;
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
|
||||
i2c_delay();
|
||||
|
||||
if ( (TW_STATUS != TW_MT_SLA_ACK) && (TW_STATUS != TW_MR_SLA_ACK) )
|
||||
return 1; // slave did not acknowledge
|
||||
else
|
||||
return 0; // success
|
||||
}
|
||||
|
||||
|
||||
// Finish the i2c transaction.
|
||||
void i2c_master_stop(void) {
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
|
||||
|
||||
uint16_t lim = 0;
|
||||
while(!(TWCR & (1<<TWSTO)) && lim < I2C_LOOP_TIMEOUT)
|
||||
lim++;
|
||||
}
|
||||
|
||||
// Write one byte to the i2c slave.
|
||||
// returns 0 => slave ACK
|
||||
// 1 => slave NACK
|
||||
uint8_t i2c_master_write(uint8_t data) {
|
||||
TWDR = data;
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
|
||||
i2c_delay();
|
||||
|
||||
// check if the slave acknowledged us
|
||||
return (TW_STATUS == TW_MT_DATA_ACK) ? 0 : 1;
|
||||
}
|
||||
|
||||
// Read one byte from the i2c slave. If ack=1 the slave is acknowledged,
|
||||
// if ack=0 the acknowledge bit is not set.
|
||||
// returns: byte read from i2c device
|
||||
uint8_t i2c_master_read(int ack) {
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (ack<<TWEA);
|
||||
|
||||
i2c_delay();
|
||||
return TWDR;
|
||||
}
|
||||
|
||||
void i2c_reset_state(void) {
|
||||
TWCR = 0;
|
||||
}
|
||||
|
||||
void i2c_slave_init(uint8_t address) {
|
||||
TWAR = address << 0; // slave i2c address
|
||||
// TWEN - twi enable
|
||||
// TWEA - enable address acknowledgement
|
||||
// TWINT - twi interrupt flag
|
||||
// TWIE - enable the twi interrupt
|
||||
TWCR = (1<<TWIE) | (1<<TWEA) | (1<<TWINT) | (1<<TWEN);
|
||||
}
|
||||
|
||||
ISR(TWI_vect);
|
||||
|
||||
ISR(TWI_vect) {
|
||||
uint8_t ack = 1;
|
||||
switch(TW_STATUS) {
|
||||
case TW_SR_SLA_ACK:
|
||||
// this device has been addressed as a slave receiver
|
||||
slave_has_register_set = false;
|
||||
break;
|
||||
|
||||
case TW_SR_DATA_ACK:
|
||||
// this device has received data as a slave receiver
|
||||
// The first byte that we receive in this transaction sets the location
|
||||
// of the read/write location of the slaves memory that it exposes over
|
||||
// i2c. After that, bytes will be written at slave_buffer_pos, incrementing
|
||||
// slave_buffer_pos after each write.
|
||||
if(!slave_has_register_set) {
|
||||
slave_buffer_pos = TWDR;
|
||||
// don't acknowledge the master if this memory loctaion is out of bounds
|
||||
if ( slave_buffer_pos >= SLAVE_BUFFER_SIZE ) {
|
||||
ack = 0;
|
||||
slave_buffer_pos = 0;
|
||||
}
|
||||
slave_has_register_set = true;
|
||||
} else {
|
||||
i2c_slave_buffer[slave_buffer_pos] = TWDR;
|
||||
BUFFER_POS_INC();
|
||||
}
|
||||
break;
|
||||
|
||||
case TW_ST_SLA_ACK:
|
||||
case TW_ST_DATA_ACK:
|
||||
// master has addressed this device as a slave transmitter and is
|
||||
// requesting data.
|
||||
TWDR = i2c_slave_buffer[slave_buffer_pos];
|
||||
BUFFER_POS_INC();
|
||||
break;
|
||||
|
||||
case TW_BUS_ERROR: // something went wrong, reset twi state
|
||||
TWCR = 0;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// Reset everything, so we are ready for the next TWI interrupt
|
||||
TWCR |= (1<<TWIE) | (1<<TWINT) | (ack<<TWEA) | (1<<TWEN);
|
||||
}
|
||||
#endif
|
||||
@@ -1,49 +0,0 @@
|
||||
#ifndef I2C_H
|
||||
#define I2C_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef F_CPU
|
||||
#define F_CPU 16000000UL
|
||||
#endif
|
||||
|
||||
#define I2C_READ 1
|
||||
#define I2C_WRITE 0
|
||||
|
||||
#define I2C_ACK 1
|
||||
#define I2C_NACK 0
|
||||
|
||||
#define SLAVE_BUFFER_SIZE 0x10
|
||||
|
||||
// i2c SCL clock frequency
|
||||
#define SCL_CLOCK 100000L
|
||||
|
||||
extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE];
|
||||
|
||||
void i2c_master_init(void);
|
||||
uint8_t i2c_master_start(uint8_t address);
|
||||
void i2c_master_stop(void);
|
||||
uint8_t i2c_master_write(uint8_t data);
|
||||
uint8_t i2c_master_read(int);
|
||||
void i2c_reset_state(void);
|
||||
void i2c_slave_init(uint8_t address);
|
||||
|
||||
|
||||
static inline unsigned char i2c_start_read(unsigned char addr) {
|
||||
return i2c_master_start((addr << 1) | I2C_READ);
|
||||
}
|
||||
|
||||
static inline unsigned char i2c_start_write(unsigned char addr) {
|
||||
return i2c_master_start((addr << 1) | I2C_WRITE);
|
||||
}
|
||||
|
||||
// from SSD1306 scrips
|
||||
extern unsigned char i2c_rep_start(unsigned char addr);
|
||||
extern void i2c_start_wait(unsigned char addr);
|
||||
extern unsigned char i2c_readAck(void);
|
||||
extern unsigned char i2c_readNak(void);
|
||||
extern unsigned char i2c_read(unsigned char ack);
|
||||
|
||||
#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak();
|
||||
|
||||
#endif
|
||||
@@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "config_common.h"
|
||||
#pragma once
|
||||
|
||||
/* Use I2C or Serial, not both */
|
||||
|
||||
@@ -40,4 +37,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGBLIGHT_SAT_STEP 8
|
||||
#define RGBLIGHT_VAL_STEP 8
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
extern keymap_config_t keymap_config;
|
||||
|
||||
@@ -100,7 +100,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
|
||||
, , , , , , , ,COMM, P1 , P2 , P3 ,PLUS, ,
|
||||
//|----+----+----+----+----+----+----. .----+----+----+----+----+----+----|
|
||||
, , , , , , , P0 ,NLCK, , ,
|
||||
, , , , , , , P0 ,NLCK, , ,
|
||||
//`----+----+----+--+-+----/----/ \----\----+----+----+----+----'
|
||||
),
|
||||
|
||||
@@ -112,7 +112,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
|
||||
,UDO ,CUT ,CPY ,PST ,XXXX, , ,XXXX,XXXX,COMM,DOT ,SLSH, ,
|
||||
//|----+----+----+----+----+----+----. .----+----+----+----+----+----+----|
|
||||
, , , , , , , , , , ,
|
||||
, , , , , , , , , , ,
|
||||
//`----+----+----+--+-+----/----/ \----\----+----+----+----+----'
|
||||
),
|
||||
|
||||
@@ -124,7 +124,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
|
||||
, GRV,TILD,XXXX,EQL ,PLUS, , ,UNDS,MINS,COMM,DOT ,SLSH,ENT ,
|
||||
//|----+----+----+----+----+----+----. .----+----+----+----+----+----+----|
|
||||
, , , , , , , , , , ,
|
||||
, , , , , , , , , , ,
|
||||
//`----+----+----+--+-+----/----/ \----\----+----+----+----+----'
|
||||
),
|
||||
|
||||
@@ -139,7 +139,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
//|----+----+----+----+----+----+----. .----+----+----+----+----+----+----|
|
||||
, , , , , , , , ,VOLD,VOLU,MUTE
|
||||
//`----+----+----+--+-+----/----/ \----\----+----+----+----+----'
|
||||
)
|
||||
)
|
||||
|
||||
};
|
||||
|
||||
@@ -148,9 +148,9 @@ const uint16_t PROGMEM fn_actions[] = {
|
||||
,[F_ALT] = ACTION_MODS_ONESHOT (MOD_LALT)
|
||||
,[F_CTRL] = ACTION_MODS_ONESHOT (MOD_LCTL)
|
||||
,[F_NUMPAD] = ACTION_LAYER_TAP_TOGGLE(_NUMPAD)
|
||||
// ,[F_LOWER] = ACTION_LAYER_TAP_TOGGLE(LOWER) // FN1 - Momentary Layer 1 (Lower)
|
||||
// ,[F_LOWER] = ACTION_LAYER_TAP_TOGGLE(LOWER) // FN1 - Momentary Layer 1 (Lower)
|
||||
// ,[F_RAISE] = ACTION_LAYER_TAP_TOGGLE(RAISE) // FN2 - Momentary Layer 2 (Raise)
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
||||
|
||||
@@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "config_common.h"
|
||||
#pragma once
|
||||
|
||||
/* Use I2C or Serial, not both */
|
||||
|
||||
@@ -38,4 +35,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGBLIGHT_SAT_STEP 8
|
||||
#define RGBLIGHT_VAL_STEP 8
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
||||
|
||||
@@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "config_common.h"
|
||||
#pragma once
|
||||
|
||||
/* Use I2C or Serial, not both */
|
||||
|
||||
@@ -38,4 +35,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGBLIGHT_SAT_STEP 8
|
||||
#define RGBLIGHT_VAL_STEP 8
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
||||
|
||||
@@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "config_common.h"
|
||||
#pragma once
|
||||
|
||||
/* Use I2C or Serial, not both */
|
||||
|
||||
@@ -38,4 +35,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGBLIGHT_SAT_STEP 8
|
||||
#define RGBLIGHT_VAL_STEP 8
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
||||
|
||||
@@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "config_common.h"
|
||||
#pragma once
|
||||
|
||||
/* Use I2C or Serial, not both */
|
||||
|
||||
@@ -39,4 +36,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGBLIGHT_VAL_STEP 20
|
||||
#define RGBLIGHT_LIMIT_VAL 220
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,6 +2,3 @@ RGBLIGHT_ENABLE = yes
|
||||
BACKLIGHT_ENABLE = no
|
||||
UNICODE_ENABLE = yes
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
||||
|
||||
@@ -1,482 +0,0 @@
|
||||
/*
|
||||
Copyright 2018 Pierre Constantineau
|
||||
|
||||
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/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* scan matrix
|
||||
*/
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <avr/io.h>
|
||||
#include "wait.h"
|
||||
#include "print.h"
|
||||
#include "debug.h"
|
||||
#include "util.h"
|
||||
#include "matrix.h"
|
||||
#include "split_util.h"
|
||||
#include "pro_micro.h"
|
||||
#include "config.h"
|
||||
#include "timer.h"
|
||||
#include "backlight.h"
|
||||
|
||||
#ifdef USE_I2C
|
||||
# include "i2c.h"
|
||||
#else // USE_SERIAL
|
||||
# include "serial.h"
|
||||
#endif
|
||||
|
||||
#ifndef DEBOUNCING_DELAY
|
||||
# define DEBOUNCING_DELAY 5
|
||||
#endif
|
||||
|
||||
#if (DEBOUNCING_DELAY > 0)
|
||||
static uint16_t debouncing_time;
|
||||
static bool debouncing = false;
|
||||
#endif
|
||||
|
||||
#if (MATRIX_COLS <= 8)
|
||||
# define print_matrix_header() print("\nr/c 01234567\n")
|
||||
# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
|
||||
# define matrix_bitpop(i) bitpop(matrix[i])
|
||||
# define ROW_SHIFTER ((uint8_t)1)
|
||||
#else
|
||||
# error "Currently only supports 8 COLS"
|
||||
#endif
|
||||
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
||||
|
||||
#define ERROR_DISCONNECT_COUNT 5
|
||||
|
||||
#define SERIAL_LED_ADDR 0x00
|
||||
|
||||
#define ROWS_PER_HAND (MATRIX_ROWS/2)
|
||||
|
||||
static uint8_t error_count = 0;
|
||||
|
||||
static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
|
||||
static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
|
||||
|
||||
/* matrix state(1:on, 0:off) */
|
||||
static matrix_row_t matrix[MATRIX_ROWS];
|
||||
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
||||
|
||||
#if (DIODE_DIRECTION == COL2ROW)
|
||||
static void init_cols(void);
|
||||
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row);
|
||||
static void unselect_rows(void);
|
||||
static void select_row(uint8_t row);
|
||||
static void unselect_row(uint8_t row);
|
||||
#elif (DIODE_DIRECTION == ROW2COL)
|
||||
static void init_rows(void);
|
||||
static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col);
|
||||
static void unselect_cols(void);
|
||||
static void unselect_col(uint8_t col);
|
||||
static void select_col(uint8_t col);
|
||||
#endif
|
||||
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_kb(void) {
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_kb(void) {
|
||||
matrix_scan_user();
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_user(void) {
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_user(void) {
|
||||
}
|
||||
|
||||
inline
|
||||
uint8_t matrix_rows(void)
|
||||
{
|
||||
return MATRIX_ROWS;
|
||||
}
|
||||
|
||||
inline
|
||||
uint8_t matrix_cols(void)
|
||||
{
|
||||
return MATRIX_COLS;
|
||||
}
|
||||
|
||||
void matrix_init(void)
|
||||
{
|
||||
debug_enable = true;
|
||||
debug_matrix = true;
|
||||
debug_mouse = true;
|
||||
// initialize row and col
|
||||
unselect_rows();
|
||||
init_cols();
|
||||
|
||||
TX_RX_LED_INIT;
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||
matrix[i] = 0;
|
||||
matrix_debouncing[i] = 0;
|
||||
}
|
||||
|
||||
matrix_init_quantum();
|
||||
|
||||
}
|
||||
|
||||
uint8_t _matrix_scan(void)
|
||||
{
|
||||
int offset = isLeftHand ? 0 : (ROWS_PER_HAND);
|
||||
#if (DIODE_DIRECTION == COL2ROW)
|
||||
// Set row, read cols
|
||||
for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) {
|
||||
# if (DEBOUNCING_DELAY > 0)
|
||||
bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row);
|
||||
|
||||
if (matrix_changed) {
|
||||
debouncing = true;
|
||||
debouncing_time = timer_read();
|
||||
PORTD ^= (1 << 2);
|
||||
}
|
||||
|
||||
# else
|
||||
read_cols_on_row(matrix+offset, current_row);
|
||||
# endif
|
||||
|
||||
}
|
||||
|
||||
#elif (DIODE_DIRECTION == ROW2COL)
|
||||
// Set col, read rows
|
||||
for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
|
||||
# if (DEBOUNCING_DELAY > 0)
|
||||
bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col);
|
||||
if (matrix_changed) {
|
||||
debouncing = true;
|
||||
debouncing_time = timer_read();
|
||||
}
|
||||
# else
|
||||
read_rows_on_col(matrix+offset, current_col);
|
||||
# endif
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
# if (DEBOUNCING_DELAY > 0)
|
||||
if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) {
|
||||
for (uint8_t i = 0; i < ROWS_PER_HAND; i++) {
|
||||
matrix[i+offset] = matrix_debouncing[i+offset];
|
||||
}
|
||||
debouncing = false;
|
||||
}
|
||||
# endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef USE_I2C
|
||||
|
||||
// Get rows from other half over i2c
|
||||
int i2c_transaction(void) {
|
||||
int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
|
||||
|
||||
int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE);
|
||||
if (err) goto i2c_error;
|
||||
|
||||
// start of matrix stored at 0x00
|
||||
err = i2c_master_write(0x00);
|
||||
if (err) goto i2c_error;
|
||||
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
// Write backlight level for slave to read
|
||||
err = i2c_master_write(get_backlight_level());
|
||||
#else
|
||||
// Write zero, so our byte index is the same
|
||||
err = i2c_master_write(0x00);
|
||||
#endif
|
||||
if (err) goto i2c_error;
|
||||
|
||||
// Start read
|
||||
err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ);
|
||||
if (err) goto i2c_error;
|
||||
|
||||
if (!err) {
|
||||
int i;
|
||||
for (i = 0; i < ROWS_PER_HAND-1; ++i) {
|
||||
matrix[slaveOffset+i] = i2c_master_read(I2C_ACK);
|
||||
}
|
||||
matrix[slaveOffset+i] = i2c_master_read(I2C_NACK);
|
||||
i2c_master_stop();
|
||||
} else {
|
||||
i2c_error: // the cable is disconnceted, or something else went wrong
|
||||
i2c_reset_state();
|
||||
return err;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else // USE_SERIAL
|
||||
|
||||
int serial_transaction(void) {
|
||||
int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
|
||||
|
||||
if (serial_update_buffers()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
||||
matrix[slaveOffset+i] = serial_slave_buffer[i];
|
||||
}
|
||||
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
// Write backlight level for slave to read
|
||||
serial_master_buffer[SERIAL_LED_ADDR] = get_backlight_level();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
uint8_t matrix_scan(void)
|
||||
{
|
||||
uint8_t ret = _matrix_scan();
|
||||
|
||||
#ifdef USE_I2C
|
||||
if( i2c_transaction() ) {
|
||||
#else // USE_SERIAL
|
||||
if( serial_transaction() ) {
|
||||
#endif
|
||||
// turn on the indicator led when halves are disconnected
|
||||
TXLED1;
|
||||
|
||||
error_count++;
|
||||
|
||||
if (error_count > ERROR_DISCONNECT_COUNT) {
|
||||
// reset other half if disconnected
|
||||
int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
|
||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
||||
matrix[slaveOffset+i] = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// turn off the indicator led on no error
|
||||
TXLED0;
|
||||
error_count = 0;
|
||||
}
|
||||
matrix_scan_quantum();
|
||||
return ret;
|
||||
}
|
||||
|
||||
void matrix_slave_scan(void) {
|
||||
_matrix_scan();
|
||||
|
||||
int offset = (isLeftHand) ? 0 : ROWS_PER_HAND;
|
||||
|
||||
#ifdef USE_I2C
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
// Read backlight level sent from master and update level on slave
|
||||
backlight_set(i2c_slave_buffer[0]);
|
||||
#endif
|
||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
||||
i2c_slave_buffer[i+1] = matrix[offset+i];
|
||||
}
|
||||
#else // USE_SERIAL
|
||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
||||
serial_slave_buffer[i] = matrix[offset+i];
|
||||
}
|
||||
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
// Read backlight level sent from master and update level on slave
|
||||
backlight_set(serial_master_buffer[SERIAL_LED_ADDR]);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
bool matrix_is_modified(void)
|
||||
{
|
||||
if (debouncing) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
inline
|
||||
bool matrix_is_on(uint8_t row, uint8_t col)
|
||||
{
|
||||
return (matrix[row] & ((matrix_row_t)1<<col));
|
||||
}
|
||||
|
||||
inline
|
||||
matrix_row_t matrix_get_row(uint8_t row)
|
||||
{
|
||||
return matrix[row];
|
||||
}
|
||||
|
||||
void matrix_print(void)
|
||||
{
|
||||
print("\nr/c 0123456789ABCDEF\n");
|
||||
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||
phex(row); print(": ");
|
||||
pbin_reverse16(matrix_get_row(row));
|
||||
print("\n");
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t matrix_key_count(void)
|
||||
{
|
||||
uint8_t count = 0;
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
count += bitpop16(matrix[i]);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
#if (DIODE_DIRECTION == COL2ROW)
|
||||
|
||||
static void init_cols(void)
|
||||
{
|
||||
for(uint8_t x = 0; x < MATRIX_COLS; x++) {
|
||||
uint8_t pin = col_pins[x];
|
||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||
}
|
||||
}
|
||||
|
||||
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
|
||||
{
|
||||
// Store last value of row prior to reading
|
||||
matrix_row_t last_row_value = current_matrix[current_row];
|
||||
|
||||
// Clear data in matrix row
|
||||
current_matrix[current_row] = 0;
|
||||
|
||||
// Select row and wait for row selecton to stabilize
|
||||
select_row(current_row);
|
||||
wait_us(30);
|
||||
|
||||
// For each col...
|
||||
for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
|
||||
|
||||
// Select the col pin to read (active low)
|
||||
uint8_t pin = col_pins[col_index];
|
||||
uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF));
|
||||
|
||||
// Populate the matrix row with the state of the col pin
|
||||
current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index);
|
||||
}
|
||||
|
||||
// Unselect row
|
||||
unselect_row(current_row);
|
||||
|
||||
return (last_row_value != current_matrix[current_row]);
|
||||
}
|
||||
|
||||
static void select_row(uint8_t row)
|
||||
{
|
||||
uint8_t pin = row_pins[row];
|
||||
_SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT
|
||||
_SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW
|
||||
}
|
||||
|
||||
static void unselect_row(uint8_t row)
|
||||
{
|
||||
uint8_t pin = row_pins[row];
|
||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||
}
|
||||
|
||||
static void unselect_rows(void)
|
||||
{
|
||||
for(uint8_t x = 0; x < ROWS_PER_HAND; x++) {
|
||||
uint8_t pin = row_pins[x];
|
||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||
}
|
||||
}
|
||||
|
||||
#elif (DIODE_DIRECTION == ROW2COL)
|
||||
|
||||
static void init_rows(void)
|
||||
{
|
||||
for(uint8_t x = 0; x < ROWS_PER_HAND; x++) {
|
||||
uint8_t pin = row_pins[x];
|
||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||
}
|
||||
}
|
||||
|
||||
static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
|
||||
{
|
||||
bool matrix_changed = false;
|
||||
|
||||
// Select col and wait for col selecton to stabilize
|
||||
select_col(current_col);
|
||||
wait_us(30);
|
||||
|
||||
// For each row...
|
||||
for(uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++)
|
||||
{
|
||||
|
||||
// Store last value of row prior to reading
|
||||
matrix_row_t last_row_value = current_matrix[row_index];
|
||||
|
||||
// Check row pin state
|
||||
if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0)
|
||||
{
|
||||
// Pin LO, set col bit
|
||||
current_matrix[row_index] |= (ROW_SHIFTER << current_col);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Pin HI, clear col bit
|
||||
current_matrix[row_index] &= ~(ROW_SHIFTER << current_col);
|
||||
}
|
||||
|
||||
// Determine if the matrix changed state
|
||||
if ((last_row_value != current_matrix[row_index]) && !(matrix_changed))
|
||||
{
|
||||
matrix_changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Unselect col
|
||||
unselect_col(current_col);
|
||||
|
||||
return matrix_changed;
|
||||
}
|
||||
|
||||
static void select_col(uint8_t col)
|
||||
{
|
||||
uint8_t pin = col_pins[col];
|
||||
_SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT
|
||||
_SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW
|
||||
}
|
||||
|
||||
static void unselect_col(uint8_t col)
|
||||
{
|
||||
uint8_t pin = col_pins[col];
|
||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||
}
|
||||
|
||||
static void unselect_cols(void)
|
||||
{
|
||||
for(uint8_t x = 0; x < MATRIX_COLS; x++) {
|
||||
uint8_t pin = col_pins[x];
|
||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -15,10 +15,7 @@ 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 REV1_CONFIG_H
|
||||
#define REV1_CONFIG_H
|
||||
|
||||
#include QMK_KEYBOARD_CONFIG_H
|
||||
#pragma once
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xCEEB
|
||||
@@ -87,4 +84,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
SRC += matrix.c \
|
||||
i2c.c \
|
||||
split_util.c \
|
||||
serial.c
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
@@ -41,7 +37,7 @@ F_USB = $(F_CPU)
|
||||
|
||||
# Bootloader
|
||||
# This definition is optional, and if your keyboard supports multiple bootloaders of
|
||||
# different sizes, comment this out, and the correct address will be loaded
|
||||
# different sizes, comment this out, and the correct address will be loaded
|
||||
# automatically (+60). See bootloader.mk for all options.
|
||||
BOOTLOADER = caterina
|
||||
|
||||
@@ -64,11 +60,9 @@ AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
SUBPROJECT_rev1 = yes
|
||||
USE_I2C = yes # I2C is used between the sides
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
CUSTOM_MATRIX = yes
|
||||
SPLIT_KEYBOARD = yes
|
||||
|
||||
DEFAULT_FOLDER = ergotravel/rev1
|
||||
|
||||
@@ -1,228 +0,0 @@
|
||||
/*
|
||||
* WARNING: be careful changing this code, it is very timing dependent
|
||||
*/
|
||||
|
||||
#ifndef F_CPU
|
||||
#define F_CPU 16000000
|
||||
#endif
|
||||
|
||||
#include <avr/io.h>
|
||||
#include <avr/interrupt.h>
|
||||
#include <util/delay.h>
|
||||
#include <stdbool.h>
|
||||
#include "serial.h"
|
||||
|
||||
#ifndef USE_I2C
|
||||
|
||||
// Serial pulse period in microseconds. Its probably a bad idea to lower this
|
||||
// value.
|
||||
#define SERIAL_DELAY 24
|
||||
|
||||
uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0};
|
||||
uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0};
|
||||
|
||||
#define SLAVE_DATA_CORRUPT (1<<0)
|
||||
volatile uint8_t status = 0;
|
||||
|
||||
inline static
|
||||
void serial_delay(void) {
|
||||
_delay_us(SERIAL_DELAY);
|
||||
}
|
||||
|
||||
inline static
|
||||
void serial_output(void) {
|
||||
SERIAL_PIN_DDR |= SERIAL_PIN_MASK;
|
||||
}
|
||||
|
||||
// make the serial pin an input with pull-up resistor
|
||||
inline static
|
||||
void serial_input(void) {
|
||||
SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK;
|
||||
SERIAL_PIN_PORT |= SERIAL_PIN_MASK;
|
||||
}
|
||||
|
||||
inline static
|
||||
uint8_t serial_read_pin(void) {
|
||||
return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK);
|
||||
}
|
||||
|
||||
inline static
|
||||
void serial_low(void) {
|
||||
SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK;
|
||||
}
|
||||
|
||||
inline static
|
||||
void serial_high(void) {
|
||||
SERIAL_PIN_PORT |= SERIAL_PIN_MASK;
|
||||
}
|
||||
|
||||
void serial_master_init(void) {
|
||||
serial_output();
|
||||
serial_high();
|
||||
}
|
||||
|
||||
void serial_slave_init(void) {
|
||||
serial_input();
|
||||
|
||||
// Enable INT0
|
||||
EIMSK |= _BV(INT0);
|
||||
// Trigger on falling edge of INT0
|
||||
EICRA &= ~(_BV(ISC00) | _BV(ISC01));
|
||||
}
|
||||
|
||||
// Used by the master to synchronize timing with the slave.
|
||||
static
|
||||
void sync_recv(void) {
|
||||
serial_input();
|
||||
// This shouldn't hang if the slave disconnects because the
|
||||
// serial line will float to high if the slave does disconnect.
|
||||
while (!serial_read_pin());
|
||||
serial_delay();
|
||||
}
|
||||
|
||||
// Used by the slave to send a synchronization signal to the master.
|
||||
static
|
||||
void sync_send(void) {
|
||||
serial_output();
|
||||
|
||||
serial_low();
|
||||
serial_delay();
|
||||
|
||||
serial_high();
|
||||
}
|
||||
|
||||
// Reads a byte from the serial line
|
||||
static
|
||||
uint8_t serial_read_byte(void) {
|
||||
uint8_t byte = 0;
|
||||
serial_input();
|
||||
for ( uint8_t i = 0; i < 8; ++i) {
|
||||
byte = (byte << 1) | serial_read_pin();
|
||||
serial_delay();
|
||||
_delay_us(1);
|
||||
}
|
||||
|
||||
return byte;
|
||||
}
|
||||
|
||||
// Sends a byte with MSB ordering
|
||||
static
|
||||
void serial_write_byte(uint8_t data) {
|
||||
uint8_t b = 8;
|
||||
serial_output();
|
||||
while( b-- ) {
|
||||
if(data & (1 << b)) {
|
||||
serial_high();
|
||||
} else {
|
||||
serial_low();
|
||||
}
|
||||
serial_delay();
|
||||
}
|
||||
}
|
||||
|
||||
// interrupt handle to be used by the slave device
|
||||
ISR(SERIAL_PIN_INTERRUPT) {
|
||||
sync_send();
|
||||
|
||||
uint8_t checksum = 0;
|
||||
for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) {
|
||||
serial_write_byte(serial_slave_buffer[i]);
|
||||
sync_send();
|
||||
checksum += serial_slave_buffer[i];
|
||||
}
|
||||
serial_write_byte(checksum);
|
||||
sync_send();
|
||||
|
||||
// wait for the sync to finish sending
|
||||
serial_delay();
|
||||
|
||||
// read the middle of pulses
|
||||
_delay_us(SERIAL_DELAY/2);
|
||||
|
||||
uint8_t checksum_computed = 0;
|
||||
for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) {
|
||||
serial_master_buffer[i] = serial_read_byte();
|
||||
sync_send();
|
||||
checksum_computed += serial_master_buffer[i];
|
||||
}
|
||||
uint8_t checksum_received = serial_read_byte();
|
||||
sync_send();
|
||||
|
||||
serial_input(); // end transaction
|
||||
|
||||
if ( checksum_computed != checksum_received ) {
|
||||
status |= SLAVE_DATA_CORRUPT;
|
||||
} else {
|
||||
status &= ~SLAVE_DATA_CORRUPT;
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
bool serial_slave_DATA_CORRUPT(void) {
|
||||
return status & SLAVE_DATA_CORRUPT;
|
||||
}
|
||||
|
||||
// Copies the serial_slave_buffer to the master and sends the
|
||||
// serial_master_buffer to the slave.
|
||||
//
|
||||
// Returns:
|
||||
// 0 => no error
|
||||
// 1 => slave did not respond
|
||||
int serial_update_buffers(void) {
|
||||
// this code is very time dependent, so we need to disable interrupts
|
||||
cli();
|
||||
|
||||
// signal to the slave that we want to start a transaction
|
||||
serial_output();
|
||||
serial_low();
|
||||
_delay_us(1);
|
||||
|
||||
// wait for the slaves response
|
||||
serial_input();
|
||||
serial_high();
|
||||
_delay_us(SERIAL_DELAY);
|
||||
|
||||
// check if the slave is present
|
||||
if (serial_read_pin()) {
|
||||
// slave failed to pull the line low, assume not present
|
||||
sei();
|
||||
return 1;
|
||||
}
|
||||
|
||||
// if the slave is present syncronize with it
|
||||
sync_recv();
|
||||
|
||||
uint8_t checksum_computed = 0;
|
||||
// receive data from the slave
|
||||
for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) {
|
||||
serial_slave_buffer[i] = serial_read_byte();
|
||||
sync_recv();
|
||||
checksum_computed += serial_slave_buffer[i];
|
||||
}
|
||||
uint8_t checksum_received = serial_read_byte();
|
||||
sync_recv();
|
||||
|
||||
if (checksum_computed != checksum_received) {
|
||||
sei();
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint8_t checksum = 0;
|
||||
// send data to the slave
|
||||
for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) {
|
||||
serial_write_byte(serial_master_buffer[i]);
|
||||
sync_recv();
|
||||
checksum += serial_master_buffer[i];
|
||||
}
|
||||
serial_write_byte(checksum);
|
||||
sync_recv();
|
||||
|
||||
// always, release the line when not in use
|
||||
serial_output();
|
||||
serial_high();
|
||||
|
||||
sei();
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,26 +0,0 @@
|
||||
#ifndef MY_SERIAL_H
|
||||
#define MY_SERIAL_H
|
||||
|
||||
#include "config.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
/* TODO: some defines for interrupt setup */
|
||||
#define SERIAL_PIN_DDR DDRD
|
||||
#define SERIAL_PIN_PORT PORTD
|
||||
#define SERIAL_PIN_INPUT PIND
|
||||
#define SERIAL_PIN_MASK _BV(PD0)
|
||||
#define SERIAL_PIN_INTERRUPT INT0_vect
|
||||
|
||||
#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
|
||||
#define SERIAL_MASTER_BUFFER_LENGTH 1
|
||||
|
||||
// Buffers for master - slave communication
|
||||
extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH];
|
||||
extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH];
|
||||
|
||||
void serial_master_init(void);
|
||||
void serial_slave_init(void);
|
||||
int serial_update_buffers(void);
|
||||
bool serial_slave_data_corrupt(void);
|
||||
|
||||
#endif
|
||||
@@ -1,86 +0,0 @@
|
||||
#include <avr/io.h>
|
||||
#include <avr/wdt.h>
|
||||
#include <avr/power.h>
|
||||
#include <avr/interrupt.h>
|
||||
#include <util/delay.h>
|
||||
#include <avr/eeprom.h>
|
||||
#include "split_util.h"
|
||||
#include "matrix.h"
|
||||
#include "keyboard.h"
|
||||
#include "config.h"
|
||||
#include "timer.h"
|
||||
|
||||
#ifdef USE_I2C
|
||||
# include "i2c.h"
|
||||
#else
|
||||
# include "serial.h"
|
||||
#endif
|
||||
|
||||
volatile bool isLeftHand = true;
|
||||
|
||||
static void setup_handedness(void) {
|
||||
#ifdef EE_HANDS
|
||||
isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS);
|
||||
#else
|
||||
// I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c
|
||||
#if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT)
|
||||
isLeftHand = !has_usb();
|
||||
#else
|
||||
isLeftHand = has_usb();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
static void keyboard_master_setup(void) {
|
||||
#ifdef USE_I2C
|
||||
i2c_master_init();
|
||||
#ifdef SSD1306OLED
|
||||
matrix_master_OLED_init ();
|
||||
#endif
|
||||
#else
|
||||
serial_master_init();
|
||||
#endif
|
||||
}
|
||||
|
||||
static void keyboard_slave_setup(void) {
|
||||
timer_init();
|
||||
#ifdef USE_I2C
|
||||
i2c_slave_init(SLAVE_I2C_ADDRESS);
|
||||
#else
|
||||
serial_slave_init();
|
||||
#endif
|
||||
}
|
||||
|
||||
bool has_usb(void) {
|
||||
USBCON |= (1 << OTGPADE); //enables VBUS pad
|
||||
_delay_us(5);
|
||||
return (USBSTA & (1<<VBUS)); //checks state of VBUS
|
||||
}
|
||||
|
||||
void split_keyboard_setup(void) {
|
||||
setup_handedness();
|
||||
|
||||
if (has_usb()) {
|
||||
keyboard_master_setup();
|
||||
} else {
|
||||
keyboard_slave_setup();
|
||||
}
|
||||
sei();
|
||||
}
|
||||
|
||||
void keyboard_slave_loop(void) {
|
||||
matrix_init();
|
||||
|
||||
while (1) {
|
||||
matrix_slave_scan();
|
||||
}
|
||||
}
|
||||
|
||||
// this code runs before the usb and keyboard is initialized
|
||||
void matrix_setup(void) {
|
||||
split_keyboard_setup();
|
||||
|
||||
if (!has_usb()) {
|
||||
keyboard_slave_loop();
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
#ifndef SPLIT_KEYBOARD_UTIL_H
|
||||
#define SPLIT_KEYBOARD_UTIL_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "eeconfig.h"
|
||||
|
||||
#define SLAVE_I2C_ADDRESS 0x32
|
||||
|
||||
extern volatile bool isLeftHand;
|
||||
|
||||
// slave version of matix scan, defined in matrix.c
|
||||
void matrix_slave_scan(void);
|
||||
|
||||
void split_keyboard_setup(void);
|
||||
bool has_usb(void);
|
||||
void keyboard_slave_loop(void);
|
||||
|
||||
void matrix_master_OLED_init (void);
|
||||
|
||||
#endif
|
||||
@@ -4,8 +4,10 @@
|
||||
#include "rev1.h"
|
||||
#elif KEYBOARD_iris_rev1_led
|
||||
#include "rev1_led.h"
|
||||
#else
|
||||
#elif KEYBOARD_iris_rev2
|
||||
#include "rev2.h"
|
||||
#else
|
||||
#include "rev3.h"
|
||||
#endif
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
@@ -31,7 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
#undef RGBLED_NUM
|
||||
#define RGBLED_NUM 18 // Number of LEDs
|
||||
#define RGBLIGHT_ANIMATIONS
|
||||
|
||||
#define RGBLIGHT_HUE_STEP 12
|
||||
#define RGBLIGHT_SAT_STEP 12
|
||||
#define RGBLIGHT_VAL_STEP 12
|
||||
|
||||
@@ -2,42 +2,53 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "drashna.h"
|
||||
|
||||
|
||||
#define LAYOUT_iris_base( \
|
||||
K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \
|
||||
K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \
|
||||
K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \
|
||||
) \
|
||||
LAYOUT_wrapper( \
|
||||
KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS, \
|
||||
KC_TAB , K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSLS, \
|
||||
KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \
|
||||
KC_MLSF, CTL_T(K21), K22, K23, K24, K25, ALT_APP, OS_RGUI, K26, K27, K28, K29, CTL_T(K2A), KC_MRSF, \
|
||||
LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE \
|
||||
)
|
||||
#define LAYOUT_iris_base_wrapper(...) LAYOUT_iris_base(__VA_ARGS__)
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[_QWERTY] = LAYOUT_wrapper(
|
||||
KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS,
|
||||
KC_TAB , _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSLS,
|
||||
KC_C1R3, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT,
|
||||
KC_MLSF, _________________QWERTY_L3_________________, ALT_APP, OS_RGUI, _________________QWERTY_R3_________________, KC_MRSF,
|
||||
LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE
|
||||
[_QWERTY] = LAYOUT_iris_base_wrapper(
|
||||
_________________QWERTY_L1_________________, _________________QWERTY_R1_________________,
|
||||
_________________QWERTY_L2_________________, _________________QWERTY_R2_________________,
|
||||
_________________QWERTY_L3_________________, _________________QWERTY_R3_________________
|
||||
),
|
||||
[_COLEMAK] = LAYOUT_wrapper(
|
||||
KC_ESC , ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS,
|
||||
KC_TAB , _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, KC_BSLS,
|
||||
KC_C1R3, _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, KC_QUOT,
|
||||
KC_MLSF, _________________COLEMAK_L3________________, ALT_APP, OS_RGUI, _________________COLEMAK_R3________________, KC_MRSF,
|
||||
LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE
|
||||
|
||||
[_COLEMAK] = LAYOUT_iris_base_wrapper(
|
||||
_________________COLEMAK_L1________________, _________________COLEMAK_R1________________,
|
||||
_________________COLEMAK_L2________________, _________________COLEMAK_R2________________,
|
||||
_________________COLEMAK_L3________________, _________________COLEMAK_R3________________
|
||||
),
|
||||
[_DVORAK] = LAYOUT_wrapper(
|
||||
KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS,
|
||||
KC_TAB , _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, KC_BSLS,
|
||||
KC_C1R3, _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, KC_QUOT,
|
||||
KC_MLSF, _________________DVORAK_L3_________________, ALT_APP, OS_RGUI, _________________DVORAK_R3_________________, KC_MRSF,
|
||||
LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE
|
||||
|
||||
[_DVORAK] = LAYOUT_iris_base_wrapper(
|
||||
_________________DVORAK_L1_________________, _________________DVORAK_R1_________________,
|
||||
_________________DVORAK_L2_________________, _________________DVORAK_R2_________________,
|
||||
_________________DVORAK_L3_________________, _________________DVORAK_R3_________________
|
||||
),
|
||||
[_WORKMAN] = LAYOUT_wrapper(
|
||||
KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS,
|
||||
KC_TAB , _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, KC_BSLS,
|
||||
KC_C1R3, _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, KC_QUOT,
|
||||
KC_MLSF, _________________WORKMAN_L3________________, ALT_APP, OS_RGUI, _________________WORKMAN_R3________________, KC_MRSF,
|
||||
LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE
|
||||
|
||||
[_WORKMAN] = LAYOUT_iris_base_wrapper(
|
||||
_________________WORKMAN_L1________________, _________________WORKMAN_R1________________,
|
||||
_________________WORKMAN_L2________________, _________________WORKMAN_R2________________,
|
||||
_________________WORKMAN_L3________________, _________________WORKMAN_R3________________
|
||||
),
|
||||
|
||||
[_MODS] = LAYOUT_wrapper(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RSFT,
|
||||
_______, ___________________BLANK___________________, ___________________BLANK___________________, _______,
|
||||
_______, ___________________BLANK___________________, ___________________BLANK___________________, _______,
|
||||
_______, ___________________BLANK___________________, ___________________BLANK___________________, _______,
|
||||
KC_LSFT, ___________________BLANK___________________, _______, _______, ___________________BLANK___________________, KC_RSFT,
|
||||
_______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@ RGBLIGHT_ENABLE = yes
|
||||
AUDIO_ENABLE = yes
|
||||
NKRO_ENABLE = yes
|
||||
BACKLIGHT_ENABLE = no
|
||||
SWAP_HANDS_ENABLE = no
|
||||
SWAP_HANDS_ENABLE = yes
|
||||
|
||||
INDICATOR_LIGHTS = yes
|
||||
MACROS_ENABLED = no
|
||||
RGBLIGHT_TWINKLE = no
|
||||
RGBLIGHT_TWINKLE = yes
|
||||
|
||||
BOOTLOADER = qmk-dfu
|
||||
|
||||
34
keyboards/iris/keymaps/vyolle_steno/config.h
Normal file
34
keyboards/iris/keymaps/vyolle_steno/config.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
Copyright 2017 Danny Nguyen <danny@hexwire.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/* Use I2C or Serial, not both */
|
||||
|
||||
#define USE_I2C
|
||||
// #define USE_SERIAL
|
||||
|
||||
|
||||
#define FORCE_NKRO //For Steno.
|
||||
|
||||
/* Select hand configuration */
|
||||
|
||||
#define MASTER_LEFT
|
||||
// #define MASTER_RIGHT
|
||||
// #define EE_HANDS
|
||||
|
||||
|
||||
149
keyboards/iris/keymaps/vyolle_steno/keymap.c
Normal file
149
keyboards/iris/keymaps/vyolle_steno/keymap.c
Normal file
@@ -0,0 +1,149 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "keymap_steno.h"
|
||||
|
||||
extern keymap_config_t keymap_config;
|
||||
|
||||
#define _QWERTY 0
|
||||
#define _LOWER 1
|
||||
#define _RAISE 2
|
||||
#define _PLOVER 3
|
||||
#define _ADJUST 4
|
||||
|
||||
enum custom_keycodes {
|
||||
QWERTY = SAFE_RANGE,
|
||||
LOWER,
|
||||
RAISE,
|
||||
ADJUST,
|
||||
PLOVER,
|
||||
EXT_PLV,
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[_QWERTY] = LAYOUT(
|
||||
//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, PLOVER,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
RAISE, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_RBRC,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BSPC, KC_RSFT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LGUI,
|
||||
//└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘
|
||||
KC_LCTL, LOWER, KC_SPC, KC_BSPC, KC_ENT, KC_LALT
|
||||
// └────────┴────────┴────────┘ └────────┴────────┴────────┘
|
||||
),
|
||||
|
||||
[_LOWER] = LAYOUT(
|
||||
//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
|
||||
KC_DEL, KC_0, KC_9, KC_8, KC_7, KC_6, _______, _______, _______, _______, _______, _______,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
KC_SCLN, KC_P, KC_O, KC_I, KC_U, KC_Y, _______, _______, _______, _______, _______, _______,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
_______, KC_QUOT, KC_L, KC_K, KC_J, KC_H, _______, KC_LEFT, KC_UP, KC_RGHT, KC_SCLN, _______,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
KC_ENT, KC_SLSH, KC_DOT, KC_COMM, KC_M, KC_N, KC_LALT, _______, _______, _______, KC_DOWN, _______, _______, _______,
|
||||
//└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘
|
||||
_______, _______, KC_LGUI, _______, _______, _______
|
||||
// └────────┴────────┴────────┘ └────────┴────────┴────────┘
|
||||
),
|
||||
|
||||
[_RAISE] = LAYOUT(
|
||||
//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
|
||||
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_VOLU, KC_LEFT, KC_UP, KC_RGHT, KC_INS, _______, _______, _______, _______, _______, _______,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
KC_MUTE, KC_VOLD, KC_PGUP, KC_DOWN, KC_PGDN, KC_DEL, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
//└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘
|
||||
_______, _______, KC_LALT, _______, _______, _______
|
||||
// └────────┴────────┴────────┘ └────────┴────────┴────────┘
|
||||
),
|
||||
|
||||
[_ADJUST] = LAYOUT(
|
||||
//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
|
||||
KC_GRV, KC_HOME, KC_LBRC, KC_RBRC, KC_PIPE, KC_APP, KC_SLCK, _______, _______, _______, _______, _______,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
KC_PSCR, KC_END, KC_LCBR, KC_RCBR, KC_PLUS, KC_EQL, KC_PAUS, _______, _______, _______, _______, _______,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
_______, _______, _______, KC_BSLS, KC_MINS, KC_UNDS, _______, _______, _______, _______, _______, _______,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
//└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘
|
||||
_______, _______, _______, _______, _______, _______
|
||||
// └────────┴────────┴────────┘ └────────┴────────┴────────┘
|
||||
),
|
||||
|
||||
[_PLOVER] = LAYOUT(
|
||||
//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
|
||||
STN_PWR, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, EXT_PLV,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
STN_N1, STN_N2, STN_N3, STN_N4, STN_N5, STN_N6, STN_N7, STN_N8, STN_N9, STN_NA, STN_NB, STN_NC,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
STN_FN, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
XXXXXXX, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_RE1, STN_RE2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR,
|
||||
//└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘
|
||||
XXXXXXX, STN_A, STN_O, STN_E, STN_U, XXXXXXX
|
||||
// └────────┴────────┴────────┘ └────────┴────────┴────────┘
|
||||
)
|
||||
};
|
||||
|
||||
|
||||
void matrix_init_user() {
|
||||
steno_set_mode(STENO_MODE_GEMINI); // or STENO_MODE_BOLT
|
||||
}
|
||||
|
||||
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 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 ADJUST:
|
||||
if (record->event.pressed) {
|
||||
layer_on(_ADJUST);
|
||||
} else {
|
||||
layer_off(_ADJUST);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case PLOVER:
|
||||
if (!record->event.pressed) {
|
||||
layer_on(_PLOVER);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case EXT_PLV:
|
||||
if (record->event.pressed) {
|
||||
layer_off(_PLOVER);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
7
keyboards/iris/keymaps/vyolle_steno/rules.mk
Normal file
7
keyboards/iris/keymaps/vyolle_steno/rules.mk
Normal file
@@ -0,0 +1,7 @@
|
||||
EXTRAKEY_ENABLE = no
|
||||
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
|
||||
STENO_ENABLE = yes # Additional protocols for Stenography(+1700), requires VIRTSER
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
MIDI_ENABLE = no # MIDI controls
|
||||
NKRO_ENABLE = yes
|
||||
BOOTMAGIC_ENABLE = yes
|
||||
@@ -65,8 +65,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGB_DI_PIN D3
|
||||
#define RGBLIGHT_TIMER
|
||||
#define RGBLED_NUM 12 // Number of LEDs
|
||||
#define ws2812_PORTREG PORTD
|
||||
#define ws2812_DDRREG DDRD
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
|
||||
@@ -65,8 +65,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGB_DI_PIN D3
|
||||
#define RGBLIGHT_TIMER
|
||||
#define RGBLED_NUM 12 // Number of LEDs
|
||||
#define ws2812_PORTREG PORTD
|
||||
#define ws2812_DDRREG DDRD
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
|
||||
@@ -65,8 +65,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGB_DI_PIN D3
|
||||
#define RGBLIGHT_TIMER
|
||||
#define RGBLED_NUM 12 // Number of LEDs
|
||||
#define ws2812_PORTREG PORTD
|
||||
#define ws2812_DDRREG DDRD
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
|
||||
85
keyboards/iris/rev3/config.h
Normal file
85
keyboards/iris/rev3/config.h
Normal file
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
Copyright 2017 Danny Nguyen <danny@keeb.io>
|
||||
|
||||
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/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include QMK_KEYBOARD_CONFIG_H
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xCEEB
|
||||
#define PRODUCT_ID 0x1256
|
||||
#define DEVICE_VER 0x0300
|
||||
#define MANUFACTURER Keebio
|
||||
#define PRODUCT Iris Keyboard
|
||||
#define DESCRIPTION Split 50 percent ergonomic keyboard
|
||||
|
||||
/* key matrix size */
|
||||
// Rows are doubled-up
|
||||
#define MATRIX_ROWS 10
|
||||
#define MATRIX_COLS 6
|
||||
|
||||
// wiring of each half
|
||||
#define MATRIX_ROW_PINS { D2, D3, D5, D7, D6 }
|
||||
#define MATRIX_COL_PINS { F1, F4, F5, F6, D4, B4 }
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/* define if matrix has ghost */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* number of backlight levels */
|
||||
// #define BACKLIGHT_LEVELS 3
|
||||
|
||||
/* Set 0 if debouncing isn't needed */
|
||||
#define DEBOUNCING_DELAY 5
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/* key combination for command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
#define BACKLIGHT_PIN B5
|
||||
#define BACKLIGHT_LEVELS 5
|
||||
|
||||
/* ws2812 RGB LED */
|
||||
#define RGB_DI_PIN F7
|
||||
#define RGBLIGHT_TIMER
|
||||
#define RGBLED_NUM 12 // Number of LEDs
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
*/
|
||||
|
||||
/* disable debug print */
|
||||
// #define NO_DEBUG
|
||||
|
||||
/* disable print */
|
||||
// #define NO_PRINT
|
||||
|
||||
/* disable action features */
|
||||
//#define NO_ACTION_LAYER
|
||||
//#define NO_ACTION_TAPPING
|
||||
//#define NO_ACTION_ONESHOT
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
42
keyboards/iris/rev3/rev3.c
Normal file
42
keyboards/iris/rev3/rev3.c
Normal file
@@ -0,0 +1,42 @@
|
||||
#include "rev3.h"
|
||||
|
||||
#ifdef SSD1306OLED
|
||||
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);
|
||||
}
|
||||
#endif
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
|
||||
// // green led on
|
||||
// DDRD |= (1<<5);
|
||||
// PORTD &= ~(1<<5);
|
||||
|
||||
// // orange led on
|
||||
// DDRB |= (1<<0);
|
||||
// PORTB &= ~(1<<0);
|
||||
|
||||
matrix_init_user();
|
||||
};
|
||||
|
||||
|
||||
#ifdef SWAP_HANDS_ENABLE
|
||||
__attribute__ ((weak))
|
||||
// swap-hands action needs a matrix to define the swap
|
||||
const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Left hand, matrix positions */
|
||||
{{0,5}, {1,5}, {2,5}, {3,5}, {4,5}, {5,5}},
|
||||
{{0,6}, {1,6}, {2,6}, {3,6}, {4,6}, {5,6}},
|
||||
{{0,7}, {1,7}, {2,7}, {3,7}, {4,7}, {5,7}},
|
||||
{{0,8}, {1,8}, {2,8}, {3,8}, {4,8}, {5,8}},
|
||||
{{0,9}, {1,9}, {2,9}, {3,9}, {4,9}, {5,9}},
|
||||
/* Right hand, matrix positions */
|
||||
{{0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {5,0}},
|
||||
{{0,1}, {1,1}, {2,1}, {3,1}, {4,1}, {5,1}},
|
||||
{{0,2}, {1,2}, {2,2}, {3,2}, {4,2}, {5,2}},
|
||||
{{0,3}, {1,3}, {2,3}, {3,3}, {4,3}, {5,3}},
|
||||
{{0,4}, {1,4}, {2,4}, {3,4}, {4,4}, {5,4}},
|
||||
};
|
||||
#endif
|
||||
|
||||
35
keyboards/iris/rev3/rev3.h
Normal file
35
keyboards/iris/rev3/rev3.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include "iris.h"
|
||||
#include "quantum.h"
|
||||
|
||||
|
||||
#ifdef USE_I2C
|
||||
#include <stddef.h>
|
||||
#ifdef __AVR__
|
||||
#include <avr/io.h>
|
||||
#include <avr/interrupt.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//void promicro_bootloader_jmp(bool program);
|
||||
|
||||
#define LAYOUT( \
|
||||
L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \
|
||||
L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \
|
||||
L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \
|
||||
L30, L31, L32, L33, L34, L35, LT4, RT4, R30, R31, R32, R33, R34, R35, \
|
||||
LT1, LT2, LT3, RT3, RT2, RT1 \
|
||||
) \
|
||||
{ \
|
||||
{ L00, L01, L02, L03, L04, L05 }, \
|
||||
{ L10, L11, L12, L13, L14, L15 }, \
|
||||
{ L20, L21, L22, L23, L24, L25 }, \
|
||||
{ L30, L31, L32, L33, L34, L35 }, \
|
||||
{ KC_NO, KC_NO, LT4, LT1, LT2, LT3 }, \
|
||||
{ R05, R04, R03, R02, R01, R00 }, \
|
||||
{ R15, R14, R13, R12, R11, R10 }, \
|
||||
{ R25, R24, R23, R22, R21, R20 }, \
|
||||
{ R35, R34, R33, R32, R31, R30 }, \
|
||||
{ KC_NO, KC_NO, RT4, RT1, RT2, RT3 } \
|
||||
}
|
||||
2
keyboards/iris/rev3/rules.mk
Normal file
2
keyboards/iris/rev3/rules.mk
Normal file
@@ -0,0 +1,2 @@
|
||||
RGBLIGHT_ENABLE = yes
|
||||
BACKLIGHT_ENABLE = yes
|
||||
@@ -37,7 +37,11 @@ F_USB = $(F_CPU)
|
||||
# This definition is optional, and if your keyboard supports multiple bootloaders of
|
||||
# different sizes, comment this out, and the correct address will be loaded
|
||||
# automatically (+60). See bootloader.mk for all options.
|
||||
BOOTLOADER = caterina
|
||||
ifeq ($(strip $(KEYBOARD)), iris/rev3)
|
||||
BOOTLOADER = dfu
|
||||
else
|
||||
BOOTLOADER = caterina
|
||||
endif
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
219
keyboards/jj40/keymaps/skewwhiffy/keymap.c
Normal file
219
keyboards/jj40/keymaps/skewwhiffy/keymap.c
Normal file
@@ -0,0 +1,219 @@
|
||||
/* Copyright 2017 Kenny Hung
|
||||
*
|
||||
* 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 "keymap_uk.h"
|
||||
|
||||
// Layer shorthand
|
||||
enum Layers {
|
||||
cm, // colemak
|
||||
dv, // dvorak
|
||||
qw, // qwerty
|
||||
nbl, // numbers left
|
||||
nbr, // numbers right
|
||||
syl, // symbols left
|
||||
syr, // symbols right
|
||||
nal, // navigation left
|
||||
nar // navigation right
|
||||
};
|
||||
|
||||
// Layer buttons
|
||||
#define _Z_SFT SFT_T(UK_Z)
|
||||
#define _SCLSH SFT_T(UK_SCLN)
|
||||
#define _SLSH SFT_T(UK_SLSH)
|
||||
|
||||
#define _X_NB LT(nbl, UK_X)
|
||||
#define _Q_NB LT(nbl, UK_Q)
|
||||
#define _DOT_NB LT(nbr, UK_DOT)
|
||||
#define _V_NB LT(nbr, UK_V)
|
||||
#define __NBL LT(nbl, _______)
|
||||
#define __NBR LT(nbr, _______)
|
||||
|
||||
#define _C_SY LT(syl, UK_C)
|
||||
#define _J_SY LT(syl, UK_J)
|
||||
#define _W_SY LT(syr, UK_W)
|
||||
#define _COM_SY LT(syr, UK_COMM)
|
||||
#define __SYL LT(syl, _______)
|
||||
#define __SYR LT(syr, _______)
|
||||
|
||||
#define _V_NAL LT(nal, UK_V)
|
||||
#define _K_NAL LT(nal, UK_K)
|
||||
#define _M_NAR LT(nar, UK_M)
|
||||
#define __NAL LT(nal, _______)
|
||||
#define __NAR LT(nar, _______)
|
||||
|
||||
// Custom hotkeys
|
||||
#define _TERM LCTL(UK_QUOT) // Hotkey for terminal
|
||||
#define _S_TAB S(UK_TAB)
|
||||
#define _C_LEFT LCTL(UK_LEFT)
|
||||
#define _C_RGHT LCTL(UK_RGHT)
|
||||
#define _A_LEFT LALT(UK_LEFT)
|
||||
#define _A_RGHT LALT(UK_RGHT)
|
||||
|
||||
// Custom hotkeys
|
||||
#define _TERM LCTL(UK_QUOT) // Hotkey for terminal
|
||||
#define _S_TAB S(UK_TAB)
|
||||
#define _C_LEFT LCTL(UK_LEFT)
|
||||
#define _C_RGHT LCTL(UK_RGHT)
|
||||
#define _A_LEFT LALT(UK_LEFT)
|
||||
#define _A_RGHT LALT(UK_RGHT)
|
||||
|
||||
enum custom_keycodes {
|
||||
IJ_OMN = SAFE_RANGE // IntelliJ Omnibox
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* Colemak
|
||||
* .-----------------------------------------------------------------------------------------------------------.
|
||||
* | Q | W | F | P | G | | | J | L | U | Y | ; |
|
||||
* |-----------------------------------------------------------------------------------------------------------|
|
||||
* | A | R | S | T | D | | | H | N | E | I | O |
|
||||
* |-----------------------------------------------------------------------------------------------------------|
|
||||
* | Z | X | C | V | B | | | K | M | , | . | / |
|
||||
* | SHIFT | NUMBER | SYMBOL | NAV | | | | | NAV | SYMBOL | FUNC | SHIFT |
|
||||
* |-----------------------------------------------------------------------------------------------------------|
|
||||
* | LSHIFT | LCTRL | LALT | LGUI | SPACE | ENT | DEL | BKSPC | RGUI | RALT | RCTRL | RSHIFT |
|
||||
* .-----------------------------------------------------------------------------------------------------------.
|
||||
*/
|
||||
[cm] = LAYOUT_ortho_4x12( \
|
||||
UK_Q, UK_W, UK_F, UK_P, UK_G, _______, _______, UK_J, UK_L, UK_U, UK_Y, UK_SCLN, \
|
||||
UK_A, UK_R, UK_S, UK_T, UK_D, _______, _______, UK_H, UK_N, UK_E, UK_I, UK_O, \
|
||||
_Z_SFT, _X_NB, _C_SY, _V_NAL, UK_B, _______, _______, UK_K, _M_NAR, _COM_SY, _DOT_NB, _SLSH, \
|
||||
UK_LSFT, UK_LCTL, UK_LALT, UK_LGUI, UK_SPC, UK_ENT, UK_DEL, UK_BSPC, UK_RGUI, UK_RALT, UK_RCTL, UK_RSFT \
|
||||
),
|
||||
|
||||
/* Dvorak
|
||||
* .-----------------------------------------------------------------------------------------------------------.
|
||||
* | ' | , | . | P | Y | | | F | G | C | R | L |
|
||||
* |-----------------------------------------------------------------------------------------------------------|
|
||||
* | A | O | E | U | I | | | D | H | T | N | S |
|
||||
* |-----------------------------------------------------------------------------------------------------------|
|
||||
* | ; | Q | J | K | X | | | B | M | W | V | Z |
|
||||
* | SHIFT | NUMBER | SYMBOL | NAV | | | | | NAV | SYMBOL | FUNC | SHIFT |
|
||||
* |-----------------------------------------------------------------------------------------------------------|
|
||||
* | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------------------------|
|
||||
*/
|
||||
[dv] = LAYOUT_ortho_4x12( \
|
||||
UK_QUOT, UK_COMM, UK_DOT, UK_P, UK_Y, _______, _______, UK_F, UK_G, UK_C, UK_R, UK_L, \
|
||||
UK_A, UK_O, UK_E, UK_U, UK_I, _______, _______, UK_D, UK_H, UK_T, UK_N, UK_S, \
|
||||
_SCLSH, _Q_NB, _J_SY, _K_NAL, UK_X, _______, _______, UK_B, _M_NAR, _W_SY, _V_NB, _Z_SFT, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||
),
|
||||
|
||||
/* QWERTY
|
||||
* .-----------------------------------------------------------------------------------------------------------.
|
||||
* | Q | W | E | R | T | | | Y | U | I | O | P |
|
||||
* |-----------------------------------------------------------------------------------------------------------|
|
||||
* | A | S | D | F | G | | | H | J | K | L | ; |
|
||||
* |-----------------------------------------------------------------------------------------------------------|
|
||||
* | Z | X | C | V | B | | | N | M | , | . | / |
|
||||
* | SHIFT | NUMBER | SYMBOL | NAV | | | | | NAV | SYMBOL | FUNC | SHIFT |
|
||||
* |-----------------------------------------------------------------------------------------------------------|
|
||||
* | | | | | | | | | | | | |
|
||||
* .-----------------------------------------------------------------------------------------------------------.
|
||||
*/
|
||||
[qw] = LAYOUT_ortho_4x12( \
|
||||
UK_Q, UK_W, UK_E, UK_R, UK_T, _______, _______, UK_Y, UK_U, UK_I, UK_O, UK_P, \
|
||||
UK_A, UK_S, UK_D, UK_F, UK_G, _______, _______, UK_H, UK_J, UK_K, UK_L, UK_SCLN, \
|
||||
_Z_SFT, _X_NB, _C_SY, _V_NAL, UK_B, _______, _______, UK_N, _M_NAR, _COM_SY, _DOT_NB, _SLSH, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||
),
|
||||
|
||||
/* Numbers _NB
|
||||
* .-----------------------------------------------------------------------------------------------------------.
|
||||
* | | F7 | F8 | F9 | F10 | | | | 7 | 8 | 9 | |
|
||||
* |-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
|
||||
* | | F4 | F5 | F6 | F11 | | | | 4 | 5 | 6 | |
|
||||
* |-----------------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
|
||||
* | | F1 | F2 | F3 | F12 | | | 0 | 1 | 2 | 3 | . |
|
||||
* |-----------------+--------+--------+--------+--------+--------+--------+-----------------+--------+--------|
|
||||
* | | | | | | | | | | | | |
|
||||
* '-----------------------------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[nbl] = LAYOUT_ortho_4x12( \
|
||||
_______, UK_F7, UK_F8, UK_F9, UK_F10, _______, _______, _______, UK_7, UK_8, UK_9, _______, \
|
||||
_______, UK_F4, UK_F5, UK_F6, UK_F11, _______, _______, _______, UK_4, UK_5, UK_6, _______, \
|
||||
_______, __NBL, UK_F2, UK_F3, UK_F12, _______, _______, UK_0, UK_1, UK_2, UK_3, UK_DOT, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||
),
|
||||
[nbr] = LAYOUT_ortho_4x12( \
|
||||
_______, UK_F7, UK_F8, UK_F9, UK_F10, _______, _______, _______, UK_7, UK_8, UK_9, _______, \
|
||||
_______, UK_F4, UK_F5, UK_F6, UK_F11, _______, _______, _______, UK_4, UK_5, UK_6, _______, \
|
||||
_______, UK_F1, UK_F2, UK_F3, UK_F12, _______, _______, UK_0, UK_1, UK_2, __NBR, UK_DOT, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||
),
|
||||
|
||||
/* Symbols _SY
|
||||
* .-----------------------------------------------------------------------------------------------------------.
|
||||
* | ! | £ | _ | - | ~ | | | \ | { | } | / | # |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
|
||||
* | $ | % | + | = | | | | " | ( | ) | ' | @ |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
|
||||
* | ^ | & | * | | | | | | < | [ | ] | > | ` |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
|
||||
* | | | | | | | | | | | | |
|
||||
* '-----------------------------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[syl] = LAYOUT_ortho_4x12( \
|
||||
UK_EXLM, UK_PND, UK_UNDS, UK_MINS, UK_TILD, _______, _______, UK_BSLS, UK_LCBR, UK_RCBR, UK_SLSH, UK_HASH, \
|
||||
UK_DLR, UK_PERC, UK_PLUS, UK_EQL, _______, _______, _______, UK_DQUO, UK_LPRN, UK_RPRN, UK_QUOT, UK_AT, \
|
||||
UK_CIRC, UK_AMPR, __SYL, UK_PIPE, _______, _______, _______, UK_LABK, UK_LBRC, UK_RBRC, UK_RABK, UK_GRV, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||
),
|
||||
[syr] = LAYOUT_ortho_4x12( \
|
||||
UK_EXLM, UK_PND, UK_UNDS, UK_MINS, UK_TILD, _______, _______, UK_BSLS, UK_LCBR, UK_RCBR, UK_SLSH, UK_HASH, \
|
||||
UK_DLR, UK_PERC, UK_PLUS, UK_EQL, _______, _______, _______, UK_DQUO, UK_LPRN, UK_RPRN, UK_QUOT, UK_AT, \
|
||||
UK_CIRC, UK_AMPR, UK_ASTR, UK_PIPE, _______, _______, _______, UK_LABK, UK_LBRC, __SYR, UK_RABK, UK_GRV, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||
),
|
||||
|
||||
/*
|
||||
* Navigation
|
||||
* .-----------------------------------------------------------------------------------------------------------.
|
||||
* | Esc | Ctrl L | Up | Ctrl R | RGB RMD| RGB HD | RGB HI | RGB_TG | PtSn | ScLk | Pause | DVORAK |
|
||||
* +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
|
||||
* | Tab | Left | Down | Right | RGB MD | RGB SD | RGB SI | COLEMAK| Insert | Home | PgUp | Term |
|
||||
* +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
|
||||
* | ShTab | Alt L | IJ Omni| Alt R | | RGB VD | RGB VI | | ScLk | End | PgDn | QWERTY |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
|
||||
* | | | | | | | | | | | | |
|
||||
* '-----------------------------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[nal] = LAYOUT_ortho_4x12( \
|
||||
UK_ESC, _C_LEFT, UK_UP, _C_RGHT, RGB_RMOD,RGB_HUD, RGB_HUI, RGB_TOG, UK_PSCR, UK_SLCK, UK_PAUS, DF(dv), \
|
||||
UK_TAB, UK_LEFT, UK_DOWN, UK_RGHT, RGB_MOD, RGB_SAD, RGB_SAI, DF(cm), UK_INS, UK_HOME, UK_PGUP, _TERM, \
|
||||
_S_TAB, _A_LEFT, IJ_OMN, __NAL, _______, RGB_VAD, RGB_VAI, _______, UK_SLCK, UK_END, UK_PGDN, DF(qw), \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||
),
|
||||
[nar] = LAYOUT_ortho_4x12( \
|
||||
UK_ESC, _C_LEFT, UK_UP, _C_RGHT, RGB_RMOD,RGB_HUD, RGB_HUI, RGB_TOG, UK_PSCR, UK_SLCK, UK_PAUS, DF(dv), \
|
||||
UK_TAB, UK_LEFT, UK_DOWN, UK_RGHT, RGB_MOD, RGB_SAD, RGB_SAI, DF(cm), UK_INS, UK_HOME, UK_PGUP, _TERM, \
|
||||
_S_TAB, _A_LEFT, IJ_OMN, _A_RGHT, _______, RGB_VAD, RGB_VAI, _______, __NAR, UK_END, UK_PGDN, DF(qw), \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||
),
|
||||
};
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (record->event.pressed) {
|
||||
switch(keycode) {
|
||||
case IJ_OMN:
|
||||
SEND_STRING(SS_TAP(X_LSHIFT)SS_TAP(X_LSHIFT));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -33,25 +33,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
),
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
// MACRODOWN only works in this function
|
||||
switch(id) {
|
||||
case 0:
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_RSFT);
|
||||
} else {
|
||||
unregister_code(KC_RSFT);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
|
||||
void matrix_init_user(void) {
|
||||
|
||||
|
||||
50
keyboards/kbd6x/keymaps/hhkb-default-improved/keymap.c
Normal file
50
keyboards/kbd6x/keymaps/hhkb-default-improved/keymap.c
Normal file
@@ -0,0 +1,50 @@
|
||||
/* Copyright 2018 MechMerlin
|
||||
*
|
||||
* 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
|
||||
|
||||
// iproved hhkb layout with more functionality
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT(
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC,
|
||||
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1),
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_RALT, KC_RGUI, KC_RCTL
|
||||
),
|
||||
|
||||
[1] = LAYOUT(
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, RESET,
|
||||
KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_DEL,
|
||||
KC_RCTL, KC_VOLU, KC_VOLD, KC_MUTE, KC_MPLY, KC_MSTP, KC_ASTR, KC_SLSH, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PLUS, KC_UNDS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
|
||||
),
|
||||
};
|
||||
|
||||
|
||||
void matrix_init_user(void) {
|
||||
|
||||
}
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
|
||||
1
keyboards/kbd6x/keymaps/hhkb-default-improved/readme.md
Normal file
1
keyboards/kbd6x/keymaps/hhkb-default-improved/readme.md
Normal file
@@ -0,0 +1 @@
|
||||
# this is the default hhkb layout in a more useable normalized form (aka the way i use mine)
|
||||
51
keyboards/kbd6x/keymaps/hhkb-default/keymap.c
Normal file
51
keyboards/kbd6x/keymaps/hhkb-default/keymap.c
Normal file
@@ -0,0 +1,51 @@
|
||||
/* Copyright 2018 MechMerlin
|
||||
*
|
||||
* 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
|
||||
|
||||
// stock hhkb as referenced by https://i.imgur.com/QoBTDHf.png
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT(
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC,
|
||||
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1),
|
||||
KC_TRNS, KC_LALT, KC_LGUI, KC_SPACE, KC_RGUI, KC_RALT, KC_TRNS
|
||||
),
|
||||
|
||||
[1] = LAYOUT(
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL,
|
||||
KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, RESET,
|
||||
KC_TRNS, KC_VOLU, KC_VOLD, KC_MUTE, KC_MSTP, KC_TRNS, KC_ASTR, KC_SLSH, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PLUS, KC_UNDS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
|
||||
),
|
||||
};
|
||||
|
||||
|
||||
|
||||
void matrix_init_user(void) {
|
||||
|
||||
}
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
|
||||
1
keyboards/kbd6x/keymaps/hhkb-default/readme.md
Normal file
1
keyboards/kbd6x/keymaps/hhkb-default/readme.md
Normal file
@@ -0,0 +1 @@
|
||||
# default hhkb layout adapted to the 6x (for tofu hhkb)
|
||||
@@ -45,7 +45,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
#define RGB_DI_PIN D3
|
||||
#define RGBLED_NUM 16 // Number of LEDs
|
||||
#define RGBLIGHT_ANIMATIONS
|
||||
|
||||
#define RGBLIGHT_HUE_STEP 12
|
||||
#define RGBLIGHT_SAT_STEP 12
|
||||
#define RGBLIGHT_VAL_STEP 12
|
||||
|
||||
@@ -30,41 +30,47 @@ uint8_t last_led;
|
||||
uint8_t last_osm;
|
||||
#endif
|
||||
|
||||
// Each layer gets a name for readability, which is then used in the keymap matrix below.
|
||||
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
|
||||
// Layer names don't all need to be of the same length, obviously, and you can also skip them
|
||||
// entirely and just use numbers.
|
||||
|
||||
// Fillers to make layering more clear
|
||||
#define _______ KC_TRNS
|
||||
#define XXXXXXX KC_NO
|
||||
#define LAYOUT_orthodox_base( \
|
||||
K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \
|
||||
K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \
|
||||
K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \
|
||||
) \
|
||||
LAYOUT_wrapper( \
|
||||
KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \
|
||||
KC_TAB, K11, K12, K13, K14, K15, ALT_APP, OS_LGUI, KC_LALT, OS_RGUI, K16, K17, K18, K19, K1A, KC_QUOT, \
|
||||
KC_MLSF, CTL_T(K21), K22, K23, K24, K25, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, K26, K27, K28, K29, CTL_T(K2A), KC_MRSF \
|
||||
)
|
||||
#define LAYOUT_orthodox_base_wrapper(...) LAYOUT_orthodox_base(__VA_ARGS__)
|
||||
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[_QWERTY] = LAYOUT_wrapper(\
|
||||
KC_ESC, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC,
|
||||
KC_TAB, _________________QWERTY_L2_________________, ___________ORTHODOX_THUMP_TOP_____________, _________________QWERTY_R2_________________, KC_QUOT,
|
||||
KC_MLSF, _________________QWERTY_L3_________________, ___________________ORTHODOX_THUMB_BOTTOM____________________, _________________QWERTY_R3_________________, KC_MRSF
|
||||
[_QWERTY] = LAYOUT_orthodox_base_wrapper(
|
||||
_________________QWERTY_L1_________________, _________________QWERTY_R1_________________,
|
||||
_________________QWERTY_L2_________________, _________________QWERTY_R2_________________,
|
||||
_________________QWERTY_L3_________________, _________________QWERTY_R3_________________
|
||||
),
|
||||
|
||||
[_COLEMAK] = LAYOUT_wrapper(\
|
||||
KC_ESC, _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, KC_BSPC,
|
||||
KC_TAB, _________________COLEMAK_L2________________, ___________ORTHODOX_THUMP_TOP_____________, _________________COLEMAK_R2________________, KC_QUOT,
|
||||
KC_MLSF, _________________COLEMAK_L3________________, ___________________ORTHODOX_THUMB_BOTTOM____________________, _________________COLEMAK_R3________________, KC_MRSF
|
||||
[_COLEMAK] = LAYOUT_orthodox_base_wrapper(
|
||||
_________________COLEMAK_L1________________, _________________COLEMAK_R1________________,
|
||||
_________________COLEMAK_L2________________, _________________COLEMAK_R2________________,
|
||||
_________________COLEMAK_L3________________, _________________COLEMAK_R3________________
|
||||
),
|
||||
|
||||
[_DVORAK] = LAYOUT_wrapper(\
|
||||
KC_ESC, _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, KC_BSPC,
|
||||
KC_TAB, _________________DVORAK_L2_________________, ___________ORTHODOX_THUMP_TOP_____________, _________________DVORAK_R2_________________, KC_MINS,
|
||||
KC_MLSF, _________________DVORAK_L3_________________, ___________________ORTHODOX_THUMB_BOTTOM____________________, _________________DVORAK_R3_________________, KC_MRSF
|
||||
[_DVORAK] = LAYOUT_orthodox_base_wrapper(
|
||||
_________________DVORAK_L1_________________, _________________DVORAK_R1_________________,
|
||||
_________________DVORAK_L2_________________, _________________DVORAK_R2_________________,
|
||||
_________________DVORAK_L3_________________, _________________DVORAK_R3_________________
|
||||
),
|
||||
[_WORKMAN] = LAYOUT_wrapper(\
|
||||
KC_ESC, _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, KC_BSPC,
|
||||
KC_TAB, _________________WORKMAN_L2________________, ___________ORTHODOX_THUMP_TOP_____________, _________________WORKMAN_R2________________, KC_MINS,
|
||||
KC_MLSF, _________________WORKMAN_L3________________, ___________________ORTHODOX_THUMB_BOTTOM____________________, _________________WORKMAN_R3________________, KC_MRSF
|
||||
|
||||
[_WORKMAN] = LAYOUT_orthodox_base_wrapper(
|
||||
_________________WORKMAN_L1________________, _________________WORKMAN_R1________________,
|
||||
_________________WORKMAN_L2________________, _________________WORKMAN_R2________________,
|
||||
_________________WORKMAN_L3________________, _________________WORKMAN_R3________________
|
||||
),
|
||||
|
||||
[_MODS] = LAYOUT_wrapper(\
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
|
||||
@@ -10,6 +10,6 @@ NKRO_ENABLE = yes
|
||||
|
||||
INDICATOR_LIGHTS = yes
|
||||
MACROS_ENABLED = no
|
||||
RGBLIGHT_TWINKLE = no
|
||||
RGBLIGHT_TWINKLE = yes
|
||||
|
||||
BOOTLOADER = qmk-dfu
|
||||
|
||||
@@ -1,13 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
// Override SpaceCadet Settings
|
||||
#undef LSPO_KEY
|
||||
#undef RSPC_KEY
|
||||
#define LSPO_KEY KC_8 // Nordic Left SpaceCadet
|
||||
#define RSPC_KEY KC_9 // Nordic Right SpaceCadet
|
||||
|
||||
// Audio
|
||||
#ifdef AUDIO_ENABLE
|
||||
#define STARTUP_SONG SONG(PLANCK_SOUND)
|
||||
// #define STARTUP_SONG SONG(NO_SOUND)
|
||||
#define STARTUP_SONG SONG(COIN_SOUND)
|
||||
|
||||
#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
|
||||
SONG(COLEMAK_SOUND), \
|
||||
SONG(DVORAK_SOUND) \
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* MIDI options
|
||||
@@ -35,5 +42,3 @@
|
||||
|
||||
// Most tactile encoders have detents every 4 stages
|
||||
#define ENCODER_RESOLUTION 4
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2015-2017 Jack Humbert
|
||||
/* Copyright 2015-2017 Jack Humbert, Christoffer Holmberg
|
||||
*
|
||||
* 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
|
||||
@@ -15,158 +15,124 @@
|
||||
*/
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "keymap_swedish.h"
|
||||
#include "muse.h"
|
||||
|
||||
extern keymap_config_t keymap_config;
|
||||
|
||||
enum planck_layers {
|
||||
_QWERTY,
|
||||
_COLEMAK,
|
||||
_DVORAK,
|
||||
_DEFAULT,
|
||||
_LOWER,
|
||||
_RAISE,
|
||||
_PLOVER,
|
||||
_UTILITY,
|
||||
_ADJUST
|
||||
};
|
||||
|
||||
enum planck_keycodes {
|
||||
QWERTY = SAFE_RANGE,
|
||||
COLEMAK,
|
||||
DVORAK,
|
||||
PLOVER,
|
||||
DEFAULT = SAFE_RANGE,
|
||||
RAISE,
|
||||
LOWER,
|
||||
UTILITY,
|
||||
BACKLIT,
|
||||
EXT_PLV
|
||||
S1, S2, S3, S4, S5, S6, S7, S8, S9
|
||||
};
|
||||
|
||||
#define LOWER MO(_LOWER)
|
||||
#define RAISE MO(_RAISE)
|
||||
#define ESC_LOW LT(_LOWER, KC_ESC)
|
||||
#define BSP_RAI LT(_RAISE, KC_BSPC)
|
||||
#define LFT_CTR CTL_T(NO_APOS)
|
||||
#define RGT_CTR CTL_T(KC_TILD)
|
||||
#define UTILITY MO(_UTILITY)
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* Qwerty
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
||||
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Å |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Esc | A | S | D | F | G | H | J | K | L | ; | " |
|
||||
* | Fn | A | S | D | F | G | H | J | K | L | Ö | Ä |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
|
||||
* | Shift| Z | X | C | V | B | N | M | , | . | - |Shift |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
|
||||
* | Ctrl | Super| Alt | |L/Esc | Ret | Space|R/Bspc| |AltGr | * | ¨ |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_QWERTY] = LAYOUT_planck_grid(
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
|
||||
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
|
||||
BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
|
||||
),
|
||||
|
||||
/* Colemak
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Esc | A | R | S | T | D | H | N | E | I | O | " |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_COLEMAK] = LAYOUT_planck_grid(
|
||||
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC,
|
||||
KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
|
||||
BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
|
||||
),
|
||||
|
||||
/* Dvorak
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | 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_planck_grid(
|
||||
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC,
|
||||
KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH,
|
||||
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT ,
|
||||
BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
|
||||
),
|
||||
|
||||
/* Lower
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | | Next | Vol- | Vol+ | Play |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_LOWER] = LAYOUT_planck_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_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
|
||||
[_DEFAULT] = LAYOUT_planck_grid(
|
||||
KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , NO_AA ,
|
||||
UTILITY, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , NO_OSLH, NO_AE ,
|
||||
KC_LSPO, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , NO_MINS, KC_RSPC,
|
||||
LFT_CTR, KC_LALT, KC_LGUI, NO_AT , ESC_LOW, KC_ENT , KC_SPC , BSP_RAI, _______, NO_ALGR, NO_ASTR, RGT_CTR
|
||||
),
|
||||
|
||||
/* Raise
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
|
||||
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | + |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
|
||||
* | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | |
|
||||
* | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | | Next | Vol- | Vol+ | Play |
|
||||
* | | | | | | | | | | | | |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_RAISE] = LAYOUT_planck_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_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
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PLUS,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, NO_GRTR, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
/* Plover layer (http://opensteno.org)
|
||||
/* Lower
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | # | # | # | # | # | # | # | # | # | # | # | # |
|
||||
* | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | | S | T | P | H | * | * | F | P | L | T | D |
|
||||
* | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | S | K | W | R | * | * | R | B | G | S | Z |
|
||||
* | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Exit | | | A | O | | E | U | | | |
|
||||
* | | | | | | | | | | | | |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_LOWER] = LAYOUT_planck_grid(
|
||||
NO_HALF, LSFT(KC_1), NO_QUO2, LSFT(KC_3), NO_BULT, LSFT(KC_5), NO_AMPR, NO_SLSH, NO_LPRN, NO_RPRN, NO_EQL , NO_QUES,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, NO_LESS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
/* Utility layer
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | | | up | | | | | | S1 | S2 | S3 | |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | | left | down | right| | | | | S4 | S5 | S6 | |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | | | | | | | | S7 | S8 | S9 | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | | Del | | | | |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
|
||||
[_PLOVER] = LAYOUT_planck_grid(
|
||||
KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 ,
|
||||
XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
|
||||
XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
|
||||
EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX
|
||||
[_UTILITY] = LAYOUT_planck_grid(
|
||||
_______, _______, KC_UP , _______, _______, _______, _______, _______, S1 , S2 , S3 , _______,
|
||||
_______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, S4 , S5 , S6 , _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, S7 , S8 , S9 , _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, KC_DEL , _______, _______, _______, _______
|
||||
),
|
||||
|
||||
/* Adjust (Lower + Raise)
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | | Reset| | | | | | | | | | Del |
|
||||
* | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| |
|
||||
* | |Reset | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | |Utilit| |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | |
|
||||
* | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | |
|
||||
* | | | | | | | | | | | | |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_ADJUST] = LAYOUT_planck_grid(
|
||||
_______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL ,
|
||||
_______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______,
|
||||
_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______,
|
||||
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 , MU_MOD , AU_ON , AU_OFF , AG_NORM, AG_SWAP, DEFAULT, XXXXXXX , XXXXXXX, UTILITY, _______,
|
||||
_______, NO_PIPE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
)
|
||||
|
||||
@@ -176,6 +142,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
#ifdef AUDIO_ENABLE
|
||||
float plover_song[][2] = SONG(PLOVER_SOUND);
|
||||
float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND);
|
||||
float s1[][2] = SONG(NUMBER_ONE);
|
||||
float s2[][2] = SONG(ZELDA_PUZZLE);
|
||||
float s3[][2] = SONG(ZELDA_TREASURE);
|
||||
float s4[][2] = SONG(OVERWATCH_THEME);
|
||||
float s5[][2] = SONG(IMPERIAL_MARCH);
|
||||
float s6[][2] = SONG(E1M1_DOOM);
|
||||
float s7[][2] = SONG(COIN_SOUND);
|
||||
float s8[][2] = SONG(ONE_UP_SOUND);
|
||||
float s9[][2] = SONG(SONIC_RING);
|
||||
#endif
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
@@ -184,22 +159,9 @@ uint32_t layer_state_set_user(uint32_t state) {
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case QWERTY:
|
||||
case DEFAULT:
|
||||
if (record->event.pressed) {
|
||||
print("mode just switched to qwerty and this is a huge string\n");
|
||||
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);
|
||||
set_single_persistent_default_layer(_DEFAULT);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
@@ -220,31 +182,75 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case PLOVER:
|
||||
case S1:
|
||||
if (record->event.pressed) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
stop_all_notes();
|
||||
PLAY_SONG(plover_song);
|
||||
#endif
|
||||
layer_off(_RAISE);
|
||||
layer_off(_LOWER);
|
||||
layer_off(_ADJUST);
|
||||
layer_on(_PLOVER);
|
||||
if (!eeconfig_is_enabled()) {
|
||||
eeconfig_init();
|
||||
}
|
||||
keymap_config.raw = eeconfig_read_keymap();
|
||||
keymap_config.nkro = 1;
|
||||
eeconfig_update_keymap(keymap_config.raw);
|
||||
PLAY_SONG(s1);
|
||||
#endif //AUDIO_ENABLE
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case EXT_PLV:
|
||||
case S2:
|
||||
if (record->event.pressed) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_SONG(plover_gb_song);
|
||||
#endif
|
||||
layer_off(_PLOVER);
|
||||
PLAY_SONG(s2);
|
||||
#endif //AUDIO_ENABLE
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case S3:
|
||||
if (record->event.pressed) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_SONG(s3);
|
||||
#endif //AUDIO_ENABLE
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case S4:
|
||||
if (record->event.pressed) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_SONG(s4);
|
||||
#endif //AUDIO_ENABLE
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case S5:
|
||||
if (record->event.pressed) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_SONG(s5);
|
||||
#endif //AUDIO_ENABLE
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case S6:
|
||||
if (record->event.pressed) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_SONG(s6);
|
||||
#endif //AUDIO_ENABLE
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case S7:
|
||||
if (record->event.pressed) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_SONG(s7);
|
||||
#endif //AUDIO_ENABLE
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case S8:
|
||||
if (record->event.pressed) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_SONG(s8);
|
||||
#endif //AUDIO_ENABLE
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case S9:
|
||||
if (record->event.pressed) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_SONG(s9);
|
||||
#endif //AUDIO_ENABLE
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||

|
||||
|
||||
# Nordic Planck
|
||||
|
||||
TODO: Add layout image
|
||||
This is my attempt at making a Nordic layout for the planck with all nordic
|
||||
characters available in the default layer, things to note are the bottom row
|
||||
with Esc, Enter, Space and Backspace in the middle for easy thumb access and
|
||||
an arrow cluster on the left.
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
SRC += muse.c
|
||||
EXTRAKEY_ENABLE = no
|
||||
CONSOLE_ENABLE = no
|
||||
|
||||
@@ -19,16 +19,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
#undef RGBLED_NUM
|
||||
#define RGBLIGHT_ANIMATIONS
|
||||
#define RGBLED_NUM 16
|
||||
|
||||
#define RGBLIGHT_HUE_STEP 8
|
||||
#define RGBLIGHT_SAT_STEP 8
|
||||
#define RGBLIGHT_VAL_STEP 8
|
||||
#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2
|
||||
#define RGBLIGHT_EFFECT_SNAKE_LENGTH 2
|
||||
#define RGBLIGHT_EFFECT_BREATHE_CENTER 1
|
||||
#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 300
|
||||
#define RGBLIGHT_EFFECT_CHRISTMAS_STEP 1
|
||||
#endif // RGBLIGHT_ENABLE
|
||||
|
||||
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
/* Copyright 2017 REPLACE_WITH_YOUR_NAME
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "../../config.h"
|
||||
|
||||
// place overrides here
|
||||
|
||||
#endif
|
||||
@@ -13,41 +13,49 @@
|
||||
* 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 "xd75.h"
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "keymap_uk.h"
|
||||
// Fillers to make layering more clear
|
||||
#define _______ KC_TRNS
|
||||
|
||||
// Layer shorthand
|
||||
#define _CM 0 // Colemak
|
||||
#define _DV 1 // Dvorak
|
||||
#define _QW 2 // QWERTY
|
||||
#define _NB 3 // Numbers
|
||||
#define _SY 4 // Symbols
|
||||
#define _NAV 5 // Navigation
|
||||
enum Layers {
|
||||
cm, // colemak
|
||||
dv, // dvorak
|
||||
qw, // qwerty
|
||||
nbl, // numbers left
|
||||
nbr, // numbers right
|
||||
syl, // symbols left
|
||||
syr, // symbols right
|
||||
nal, // navigation left
|
||||
nar // navigation right
|
||||
};
|
||||
|
||||
// Layer buttons
|
||||
#define _Z_SFT SFT_T(UK_Z)
|
||||
#define _SCLSH SFT_T(UK_SCLN)
|
||||
#define _SLSH SFT_T(UK_SLSH)
|
||||
#define _X_NB LT(_NB, UK_X)
|
||||
#define _Q_NB LT(_NB, UK_Q)
|
||||
#define _DOT_NB LT(_NB, UK_DOT)
|
||||
#define _V_NB LT(_NB, UK_V)
|
||||
#define _C_SY LT(_SY, UK_C)
|
||||
#define _J_SY LT(_SY, UK_J)
|
||||
#define _W_SY LT(_SY, UK_W)
|
||||
#define _COM_SY LT(_SY, UK_COMM)
|
||||
#define _AST_SY LT(_SY, UK_PAST)
|
||||
#define _B_NAV LT(_NAV, UK_B)
|
||||
#define _X_NAV LT(_NAV, UK_X)
|
||||
#define _K_NAV LT(_NAV, UK_K)
|
||||
#define _N_NAV LT(_NAV, UK_N)
|
||||
#define _F1_NB LT(_NB, UK_F1)
|
||||
#define _3_NB LT(_NB, UK_3)
|
||||
|
||||
#define _X_NB LT(nbl, UK_X)
|
||||
#define _Q_NB LT(nbl, UK_Q)
|
||||
#define _DOT_NB LT(nbr, UK_DOT)
|
||||
#define _V_NB LT(nbr, UK_V)
|
||||
#define __NBL LT(nbl, _______)
|
||||
#define __NBR LT(nbr, _______)
|
||||
|
||||
#define _C_SY LT(syl, UK_C)
|
||||
#define _J_SY LT(syl, UK_J)
|
||||
#define _W_SY LT(syr, UK_W)
|
||||
#define _COM_SY LT(syr, UK_COMM)
|
||||
#define __SYL LT(syl, _______)
|
||||
#define __SYR LT(syr, _______)
|
||||
|
||||
#define _V_NAL LT(nal, UK_V)
|
||||
#define _K_NAL LT(nal, UK_K)
|
||||
#define _M_NAR LT(nar, UK_M)
|
||||
#define __NAL LT(nal, _______)
|
||||
#define __NAR LT(nar, _______)
|
||||
|
||||
// Custom hotkeys
|
||||
#define _TERM LCTL(UK_QUOT) // Hotkey for Cmder or iTerm
|
||||
#define _TERM LCTL(UK_QUOT) // Hotkey for terminal
|
||||
#define _S_TAB S(UK_TAB)
|
||||
#define _C_LEFT LCTL(UK_LEFT)
|
||||
#define _C_RGHT LCTL(UK_RGHT)
|
||||
@@ -55,35 +63,34 @@
|
||||
#define _A_RGHT LALT(UK_RGHT)
|
||||
|
||||
enum custom_keycodes {
|
||||
L_NEXT = SAFE_RANGE,
|
||||
L_SB
|
||||
IJ_OMN = SAFE_RANGE // IntelliJ Omnibox
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* Colemak _CM
|
||||
/* Colemak
|
||||
* .--------------------------------------------------------------------------------------------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | L_NEXT | L_SB |
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |--------------------------------------------------------------------------------------------------------------------------------------|
|
||||
* | Q | W | F | P | G | | | | | | J | L | U | Y | ; |
|
||||
* |--------------------------------------------------------------------------------------------------------------------------------------|
|
||||
* | A | R | S | T | D | | | | | | H | N | E | I | O |
|
||||
* |--------------------------------------------------------------------------------------------------------------------------------------|
|
||||
* | Z | X | C | V | B | | | | | | K | M | , | . | / |
|
||||
* | SHIFT | NUMBER | SYMBOL | | NAV | | | | | | NAV | | SYMBOL | FUNC | SHIFT |
|
||||
* | SHIFT | NUMBER | SYMBOL | NAV | | | | | | | | NAV | SYMBOL | FUNC | SHIFT |
|
||||
* |--------------------------------------------------------------------------------------------------------------------------------------|
|
||||
* | LSHIFT | LCTRL | LALT | LGUI | SPACE | ENT | | | | DEL | BKSPC | RGUI | RALT | RCTRL | RSHIFT |
|
||||
* .--------------------------------------------------------------------------------------------------------------------------------------.
|
||||
*/
|
||||
[_CM] = {
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, L_NEXT, L_SB },
|
||||
{ UK_Q, UK_W, UK_F, UK_P, UK_G, _______, _______, _______, _______, _______, UK_J, UK_L, UK_U, UK_Y, UK_SCLN },
|
||||
{ UK_A, UK_R, UK_S, UK_T, UK_D, _______, _______, _______, _______, _______, UK_H, UK_N, UK_E, UK_I, UK_O },
|
||||
{ _Z_SFT, _X_NB, _C_SY, UK_V, _B_NAV, _______, _______, _______, _______, _______, _K_NAV, UK_M, _COM_SY, _DOT_NB, _SLSH },
|
||||
{ UK_LSFT, UK_LCTL, UK_LALT, UK_LGUI, UK_SPC, UK_ENT, _______, _______, _______, UK_DEL, UK_BSPC, UK_RGUI, UK_RALT, UK_RCTL, UK_RSFT }
|
||||
},
|
||||
[cm] = LAYOUT_ortho_5x15( \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
UK_Q, UK_W, UK_F, UK_P, UK_G, _______, _______, _______, _______, _______, UK_J, UK_L, UK_U, UK_Y, UK_SCLN, \
|
||||
UK_A, UK_R, UK_S, UK_T, UK_D, _______, _______, _______, _______, _______, UK_H, UK_N, UK_E, UK_I, UK_O , \
|
||||
_Z_SFT, _X_NB, _C_SY, _V_NAL, UK_B, _______, _______, _______, _______, _______, UK_K, _M_NAR, _COM_SY, _DOT_NB, _SLSH , \
|
||||
UK_LSFT, UK_LCTL, UK_LALT, UK_LGUI, UK_SPC, UK_ENT, _______, _______, _______, UK_DEL, UK_BSPC, UK_RGUI, UK_RALT, UK_RCTL, UK_RSFT \
|
||||
),
|
||||
|
||||
/* DVORAK _DV
|
||||
/* Dvorak
|
||||
* .--------------------------------------------------------------------------------------------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |--------------------------------------------------------------------------------------------------------------------------------------|
|
||||
@@ -92,18 +99,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* | A | O | E | U | I | | | | | | D | H | T | N | S |
|
||||
* |--------------------------------------------------------------------------------------------------------------------------------------|
|
||||
* | ; | Q | J | K | X | | | | | | B | M | W | V | Z |
|
||||
* | SHIFT | NUMBER | SYMBOL | | NAV | | | | | | NAV | | SYMBOL | FUNC | SHIFT |
|
||||
* | SHIFT | NUMBER | SYMBOL | NAV | | | | | | | | NAV | SYMBOL | FUNC | SHIFT |
|
||||
* |--------------------------------------------------------------------------------------------------------------------------------------|
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |--------------------------------------------------------------------------------------------------------------------------------------|
|
||||
*/
|
||||
[_DV] = {
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
|
||||
{ UK_QUOT, UK_COMM, UK_DOT, UK_P, UK_Y, _______, _______, _______, _______, _______, UK_F, UK_G, UK_C, UK_R, UK_L },
|
||||
{ UK_A, UK_O, UK_E, UK_U, UK_I, _______, _______, _______, _______, _______, UK_D, UK_H, UK_T, UK_N, UK_S },
|
||||
{ _SCLSH, _Q_NB, _J_SY, UK_K, _X_NAV, _______, _______, _______, _______, _______, _B_NAV, UK_M, _W_SY, _V_NB, _Z_SFT },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }
|
||||
},
|
||||
[dv] = LAYOUT_ortho_5x15( \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
UK_QUOT, UK_COMM, UK_DOT, UK_P, UK_Y, _______, _______, _______, _______, _______, UK_F, UK_G, UK_C, UK_R, UK_L , \
|
||||
UK_A, UK_O, UK_E, UK_U, UK_I, _______, _______, _______, _______, _______, UK_D, UK_H, UK_T, UK_N, UK_S , \
|
||||
_SCLSH, _Q_NB, _J_SY, _K_NAL, UK_X, _______, _______, _______, _______, _______, UK_B, _M_NAR, _W_SY, _V_NB, _Z_SFT , \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||
),
|
||||
|
||||
/* QWERTY _QW
|
||||
* .--------------------------------------------------------------------------------------------------------------------------------------.
|
||||
@@ -114,20 +121,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* | A | S | D | F | G | | | | | | H | J | K | L | ; |
|
||||
* |--------------------------------------------------------------------------------------------------------------------------------------|
|
||||
* | Z | X | C | V | B | | | | | | N | M | , | . | / |
|
||||
* | SHIFT | NUMBER | SYMBOL | | NAV | | | | | | NAV | | SYMBOL | FUNC | SHIFT |
|
||||
* | SHIFT | NUMBER | SYMBOL | NAV | | | | | | | | NAV | SYMBOL | FUNC | SHIFT |
|
||||
* |--------------------------------------------------------------------------------------------------------------------------------------|
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |--------------------------------------------------------------------------------------------------------------------------------------|
|
||||
* | LSHIFT | LCTRL | LALT | LGUI | SPACE | ENT | | | | DEL | BKSPC | RGUI | RALT | RCTRL | RSHIFT |
|
||||
* .--------------------------------------------------------------------------------------------------------------------------------------.
|
||||
*/
|
||||
[_QW] = {
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
|
||||
{ UK_Q, UK_W, UK_E, UK_R, UK_T, _______, _______, _______, _______, _______, UK_Y, UK_U, UK_I, UK_O, UK_P },
|
||||
{ UK_A, UK_S, UK_D, UK_F, UK_G, _______, _______, _______, _______, _______, UK_H, UK_J, UK_K, UK_L, UK_SCLN },
|
||||
{ _Z_SFT, _X_NB, _C_SY, UK_V, _B_NAV, _______, _______, _______, _______, _______, _N_NAV, UK_M, _COM_SY, _DOT_NB, _SLSH },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }
|
||||
},
|
||||
[qw] = LAYOUT_ortho_5x15( \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
UK_Q, UK_W, UK_E, UK_R, UK_T, _______, _______, _______, _______, _______, UK_Y, UK_U, UK_I, UK_O, UK_P , \
|
||||
UK_A, UK_S, UK_D, UK_F, UK_G, _______, _______, _______, _______, _______, UK_H, UK_J, UK_K, UK_L, UK_SCLN, \
|
||||
_Z_SFT, _X_NB, _C_SY, _V_NAL, UK_B, _______, _______, _______, _______, _______, UK_N, _M_NAR, _COM_SY, _DOT_NB, _SLSH , \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||
),
|
||||
|
||||
/* Numbers _NB
|
||||
* .--------------------------------------------------------------------------------------------------------------------------------------.
|
||||
@@ -142,15 +149,22 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* '--------------------------------------------------------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_NB] = {
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
|
||||
{ _______, UK_F7, UK_F8, UK_F9, UK_F10, _______, _______, _______, _______, _______, _______, UK_7, UK_8, UK_9, _______ },
|
||||
{ _______, UK_F4, UK_F5, UK_F6, UK_F11, _______, _______, _______, _______, _______, _______, UK_4, UK_5, UK_6, _______ },
|
||||
{ _______, _F1_NB, UK_F2, UK_F3, UK_F12, _______, _______, _______, _______, _______, UK_0, UK_1, UK_2, _3_NB, UK_DOT },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }
|
||||
},
|
||||
[nbl] = LAYOUT_ortho_5x15( \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, UK_F7, UK_F8, UK_F9, UK_F10, _______, _______, _______, _______, _______, _______, UK_7, UK_8, UK_9, _______, \
|
||||
_______, UK_F4, UK_F5, UK_F6, UK_F11, _______, _______, _______, _______, _______, _______, UK_4, UK_5, UK_6, _______, \
|
||||
_______, __NBL, UK_F2, UK_F3, UK_F12, _______, _______, _______, _______, _______, UK_0, UK_1, UK_2, UK_3, UK_DOT, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||
),
|
||||
[nbr] = LAYOUT_ortho_5x15( \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, UK_F7, UK_F8, UK_F9, UK_F10, _______, _______, _______, _______, _______, _______, UK_7, UK_8, UK_9, _______, \
|
||||
_______, UK_F4, UK_F5, UK_F6, UK_F11, _______, _______, _______, _______, _______, _______, UK_4, UK_5, UK_6, _______, \
|
||||
_______, UK_F1, UK_F2, UK_F3, UK_F12, _______, _______, _______, _______, _______, UK_0, UK_1, UK_2, __NBR, UK_DOT , \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||
),
|
||||
|
||||
/* Symbols _SY
|
||||
/* Symbols _SY
|
||||
* .--------------------------------------------------------------------------------------------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
|
||||
@@ -163,17 +177,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* '--------------------------------------------------------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_SY] = {
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
|
||||
{ UK_EXLM, UK_PND, UK_UNDS, UK_MINS, UK_TILD, _______, _______, _______, _______, _______, UK_BSLS, UK_LCBR, UK_RCBR, UK_SLSH, UK_HASH },
|
||||
{ UK_DLR, UK_PERC, UK_PLUS, UK_EQL, _______, _______, _______, _______, _______, _______, UK_DQUO, UK_LPRN, UK_RPRN, UK_QUOT, UK_AT },
|
||||
{ UK_CIRC, UK_AMPR, _AST_SY, UK_PIPE, _______, _______, _______, _______, _______, _______, UK_LABK, UK_LBRC, _COM_SY, UK_RABK, UK_GRV },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }
|
||||
},
|
||||
[syl] = LAYOUT_ortho_5x15( \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
UK_EXLM, UK_PND, UK_UNDS, UK_MINS, UK_TILD, _______, _______, _______, _______, _______, UK_BSLS, UK_LCBR, UK_RCBR, UK_SLSH, UK_HASH, \
|
||||
UK_DLR, UK_PERC, UK_PLUS, UK_EQL, _______, _______, _______, _______, _______, _______, UK_DQUO, UK_LPRN, UK_RPRN, UK_QUOT, UK_AT , \
|
||||
UK_CIRC, UK_AMPR, __SYL, UK_PIPE, _______, _______, _______, _______, _______, _______, UK_LABK, UK_LBRC, UK_RBRC, UK_RABK, UK_GRV , \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||
),
|
||||
[syr] = LAYOUT_ortho_5x15( \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
UK_EXLM, UK_PND, UK_UNDS, UK_MINS, UK_TILD, _______, _______, _______, _______, _______, UK_BSLS, UK_LCBR, UK_RCBR, UK_SLSH, UK_HASH, \
|
||||
UK_DLR, UK_PERC, UK_PLUS, UK_EQL, _______, _______, _______, _______, _______, _______, UK_DQUO, UK_LPRN, UK_RPRN, UK_QUOT, UK_AT , \
|
||||
UK_CIRC, UK_AMPR, UK_ASTR, UK_PIPE, _______, _______, _______, _______, _______, _______, UK_LABK, UK_LBRC, __SYR, UK_RABK, UK_GRV , \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||
),
|
||||
/*
|
||||
* Navigation
|
||||
* Navigation _NA
|
||||
* .--------------------------------------------------------------------------------------------------------------------------------------.
|
||||
* | RESET | COLEMA | DVORAK | QWERTY | | | | | | | | | | | |
|
||||
* | RESET | COLEMA | DVORAK | QWERTY | | RGB_TG | | | | | | | | | |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
|
||||
* | Esc | Ctrl L | Up | Ctrl R | | RGB HD | RGB HI | | | | | PtSn | ScLk | Pause | |
|
||||
* +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
|
||||
@@ -184,105 +205,29 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* | | | | | | RGB RMD| RGB MD | | | | | | | | |
|
||||
* '--------------------------------------------------------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_NAV] = {
|
||||
{ RESET, DF(_CM), DF(_DV), DF(_QW), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
|
||||
{ UK_ESC, _C_LEFT, UK_UP , _C_RGHT, _______, RGB_HUD, RGB_HUI, _______, _______, _______, _______, UK_PSCR, UK_SLCK, UK_PAUS, _______ },
|
||||
{ UK_TAB, UK_LEFT, UK_DOWN, UK_RGHT, _______, RGB_SAD, RGB_SAI, _______, _______, _______, _______, UK_INS, UK_HOME, UK_PGUP, _TERM },
|
||||
{ _S_TAB, _A_LEFT, UK_LSFT, _A_RGHT, _B_NAV, RGB_VAD, RGB_VAI, _______, _______, _______, _K_NAV, UK_SLCK, UK_END, UK_PGDN, _______ },
|
||||
{ _______, _______, _______, _______, _______, RGB_RMOD,RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______ }
|
||||
},
|
||||
[nal] = LAYOUT_ortho_5x15( \
|
||||
RESET, DF(cm), DF(dv), DF(qw), _______, RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
UK_ESC, _C_LEFT, UK_UP , _C_RGHT, _______, RGB_HUD, RGB_HUI, _______, _______, _______, _______, UK_PSCR, UK_SLCK, UK_PAUS, _______, \
|
||||
UK_TAB, UK_LEFT, UK_DOWN, UK_RGHT, _______, RGB_SAD, RGB_SAI, _______, _______, _______, _______, UK_INS, UK_HOME, UK_PGUP, _TERM , \
|
||||
_S_TAB, _A_LEFT, IJ_OMN, __NAL, _______, RGB_VAD, RGB_VAI, _______, _______, _______, _______, UK_SLCK, UK_END, UK_PGDN, _______, \
|
||||
_______, _______, _______, _______, _______, RGB_RMOD,RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||
),
|
||||
[nar] = LAYOUT_ortho_5x15( \
|
||||
RESET, DF(cm), DF(dv), DF(qw), _______, RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
UK_ESC, _C_LEFT, UK_UP , _C_RGHT, _______, RGB_HUD, RGB_HUI, _______, _______, _______, _______, UK_PSCR, UK_SLCK, UK_PAUS, _______, \
|
||||
UK_TAB, UK_LEFT, UK_DOWN, UK_RGHT, _______, RGB_SAD, RGB_SAI, _______, _______, _______, _______, UK_INS, UK_HOME, UK_PGUP, _TERM , \
|
||||
_S_TAB, _A_LEFT, IJ_OMN, _A_RGHT, _______, RGB_VAD, RGB_VAI, _______, _______, _______, _______, __NAR, UK_END, UK_PGDN, _______, \
|
||||
_______, _______, _______, _______, _______, RGB_RMOD,RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||
)
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
// MACRODOWN only works in this function
|
||||
switch(id) {
|
||||
case 0:
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_RSFT);
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
backlight_step();
|
||||
#endif
|
||||
} else {
|
||||
unregister_code(KC_RSFT);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
bool lightsOn = true;
|
||||
int keyPresses = 0;
|
||||
int effect = 0;
|
||||
uint32_t key_timer;
|
||||
|
||||
void resetCounts(void) {
|
||||
effect++;
|
||||
keyPresses = 0;
|
||||
key_timer = timer_read32();
|
||||
}
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
if (!lightsOn) {
|
||||
rgblight_setrgb(0, 0, 0);
|
||||
return;
|
||||
}
|
||||
if (timer_elapsed32(key_timer) > 60000) {
|
||||
resetCounts();
|
||||
}
|
||||
switch (effect) {
|
||||
case 0:
|
||||
rgblight_effect_breathing(3);
|
||||
break;
|
||||
case 1:
|
||||
rgblight_effect_knight(3);
|
||||
break;
|
||||
case 2:
|
||||
rgblight_effect_rainbow_swirl(128);
|
||||
break;
|
||||
case 3:
|
||||
rgblight_effect_snake(30);
|
||||
break;
|
||||
case 4:
|
||||
rgblight_effect_rainbow_swirl(128);
|
||||
break;
|
||||
case 5:
|
||||
rgblight_effect_rainbow_mood(128);
|
||||
break;
|
||||
case 6:
|
||||
rgblight_effect_christmas();
|
||||
break;
|
||||
case 7:
|
||||
rgblight_effect_rgbtest();
|
||||
break;
|
||||
default:
|
||||
effect = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!record->event.pressed) return true;
|
||||
if (keycode == L_SB) {
|
||||
lightsOn = !lightsOn;
|
||||
if (!lightsOn) {
|
||||
keyPresses = 0;
|
||||
} else {
|
||||
resetCounts();
|
||||
if (record->event.pressed) {
|
||||
switch(keycode) {
|
||||
case IJ_OMN:
|
||||
SEND_STRING(SS_TAP(X_LSHIFT)SS_TAP(X_LSHIFT));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (keycode == L_NEXT) {
|
||||
resetCounts();
|
||||
return true;
|
||||
}
|
||||
keyPresses++;
|
||||
if (keyPresses > 100) {
|
||||
resetCounts();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
#undef RGBLIGHT_SAT_STEP
|
||||
#define RGBLIGHT_SAT_STEP 12
|
||||
#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 7
|
||||
#define RGBLIGHT_EFFECT_SNAKE_LENGTH 7
|
||||
|
||||
#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 3
|
||||
#define RGBLIGHT_EFFECT_SNAKE_LENGTH 3
|
||||
#define RGBLIGHT_EFFECT_BREATHE_CENTER 1
|
||||
#endif // RGBLIGHT_ENABLE
|
||||
|
||||
|
||||
@@ -30,6 +30,24 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//define layer change stuff for underglow indicator
|
||||
bool skip_leds = false;
|
||||
|
||||
#define LAYOUT_ergodox_pretty_base( \
|
||||
K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \
|
||||
K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \
|
||||
K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \
|
||||
) \
|
||||
LAYOUT_ergodox_pretty_wrapper( \
|
||||
KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, \
|
||||
KC_TAB, K01, K02, K03, K04, K05, TG(_DIABLO), TG(_DIABLO), K06, K07, K08, K09, K0A, KC_BSLS, \
|
||||
KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \
|
||||
KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, CTL_T(K2A), KC_MRSF, \
|
||||
KC_GRV, OSM(MOD_MEH),OSM(MOD_LGUI),KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC_IRNY, \
|
||||
ALT_T(KC_APP), OSM(MOD_LGUI), OSM(MOD_RGUI), CTL_T(KC_ESCAPE), \
|
||||
KC_HOME, KC_PGUP, \
|
||||
LT(_LOWER, KC_SPACE),KC_BSPC, KC_END, KC_PGDN, KC_DEL, LT(_RAISE, KC_ENTER) \
|
||||
)
|
||||
|
||||
#define LAYOUT_ergodox_pretty_base_wrapper(...) LAYOUT_ergodox_pretty_base(__VA_ARGS__)
|
||||
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
@@ -55,15 +73,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* | | | End | | PgDn | | |
|
||||
* `---------------------' `---------------------'
|
||||
*/
|
||||
[_QWERTY] = LAYOUT_ergodox_pretty_wrapper(
|
||||
// left hand // right hand
|
||||
KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS,
|
||||
KC_TAB, _________________QWERTY_L1_________________, TG(_DIABLO), TG(_DIABLO), _________________QWERTY_R1_________________, KC_BSLS,
|
||||
KC_C1R3, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT,
|
||||
KC_MLSF, _________________QWERTY_L3_________________, TG(_GAMEPAD), TG(_GAMEPAD), _________________QWERTY_R3_________________, KC_MRSF,
|
||||
KC_GRV, ___________ERGODOX_BOTTOM_LEFT_____________, ___________ERGODOX_BOTTOM_RIGHT____________, UC_IRNY,
|
||||
__________________ERGODOX_THUMB_CLUSTER_____________________
|
||||
),
|
||||
[_QWERTY] = LAYOUT_ergodox_pretty_base_wrapper(
|
||||
_________________QWERTY_L1_________________, _________________QWERTY_R1_________________,
|
||||
_________________QWERTY_L2_________________, _________________QWERTY_R2_________________,
|
||||
_________________QWERTY_L3_________________, _________________QWERTY_R3_________________
|
||||
),
|
||||
/* Keymap 0: COLEMAK layer
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
@@ -87,15 +101,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
*/
|
||||
// If it accepts an argument (i.e, is a function), it doesn't need KC_.
|
||||
// Otherwise, it needs KC_*
|
||||
[_COLEMAK] = LAYOUT_ergodox_pretty_wrapper(
|
||||
// left hand // right hand
|
||||
KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS,
|
||||
KC_TAB, _________________COLEMAK_L1________________, TG(_DIABLO), TG(_DIABLO), _________________COLEMAK_R1________________, KC_BSLS,
|
||||
KC_C1R3, _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, KC_QUOT,
|
||||
KC_MLSF, _________________COLEMAK_L3________________, TG(_GAMEPAD), TG(_GAMEPAD), _________________COLEMAK_R3________________, KC_MRSF,
|
||||
KC_GRV, ___________ERGODOX_BOTTOM_LEFT_____________, ___________ERGODOX_BOTTOM_RIGHT____________, UC_IRNY,
|
||||
__________________ERGODOX_THUMB_CLUSTER_____________________
|
||||
),
|
||||
[_COLEMAK] = LAYOUT_ergodox_pretty_base_wrapper(
|
||||
_________________COLEMAK_L1________________, _________________COLEMAK_R1________________,
|
||||
_________________COLEMAK_L2________________, _________________COLEMAK_R2________________,
|
||||
_________________COLEMAK_L3________________, _________________COLEMAK_R3________________
|
||||
),
|
||||
/* Keymap 0: DVORAK Layout
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
@@ -119,15 +129,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
*/
|
||||
// If it accepts an argument (i.e, is a function), it doesn't need KC_.
|
||||
// Otherwise, it needs KC_*
|
||||
[_DVORAK] = LAYOUT_ergodox_pretty_wrapper(
|
||||
// left hand // right hand
|
||||
KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_BSLS,
|
||||
KC_TAB, _________________DVORAK_L1_________________, TG(_DIABLO), TG(_DIABLO), _________________DVORAK_R1_________________, KC_SLSH,
|
||||
KC_C1R3, _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, KC_MINS,
|
||||
KC_MLSF, _________________DVORAK_L3_________________, TG(_GAMEPAD), TG(_GAMEPAD), _________________DVORAK_R3_________________, KC_MRSF,
|
||||
KC_GRV, ___________ERGODOX_BOTTOM_LEFT_____________, ___________ERGODOX_BOTTOM_RIGHT____________, UC_IRNY,
|
||||
__________________ERGODOX_THUMB_CLUSTER_____________________
|
||||
),
|
||||
[_DVORAK] = LAYOUT_ergodox_pretty_base_wrapper(
|
||||
_________________DVORAK_L1_________________, _________________DVORAK_R1_________________,
|
||||
_________________DVORAK_L2_________________, _________________DVORAK_R2_________________,
|
||||
_________________DVORAK_L3_________________, _________________DVORAK_R3_________________
|
||||
),
|
||||
/* Keymap 0: WORKMAN layer
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
@@ -149,17 +155,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* | |ace | End | | PgDn | | |
|
||||
* `--------------------' `----------------------'
|
||||
*/
|
||||
// If it accepts an argument (i.e, is a function), it doesn't need KC_.
|
||||
// Otherwise, it needs KC_*
|
||||
[_WORKMAN] = LAYOUT_ergodox_pretty_wrapper(
|
||||
// left hand
|
||||
KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS,
|
||||
KC_TAB, _________________WORKMAN_L1________________, TG(_DIABLO), TG(_DIABLO), _________________WORKMAN_R1________________, KC_BSLS,
|
||||
KC_C1R3, _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, KC_QUOT,
|
||||
KC_MLSF, _________________WORKMAN_L3________________, TG(_GAMEPAD), TG(_GAMEPAD), _________________WORKMAN_R3________________, KC_MRSF,
|
||||
KC_GRV, ___________ERGODOX_BOTTOM_LEFT_____________, ___________ERGODOX_BOTTOM_RIGHT____________, UC_IRNY,
|
||||
__________________ERGODOX_THUMB_CLUSTER_____________________
|
||||
),
|
||||
|
||||
[_WORKMAN] = LAYOUT_ergodox_pretty_base_wrapper(
|
||||
_________________WORKMAN_L1________________, _________________WORKMAN_R1________________,
|
||||
_________________WORKMAN_L2________________, _________________WORKMAN_R2________________,
|
||||
_________________WORKMAN_L3________________, _________________WORKMAN_R3________________
|
||||
),
|
||||
|
||||
// Reverts OSM(Shift) to normal Shifts. However, may not need since we fixed the issue with RDP (LOCAL RESOURCES)
|
||||
[_MODS] = LAYOUT_ergodox_pretty_wrapper(
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM)
|
||||
#define RGB_DI_PIN D3
|
||||
#define RGBLED_NUM 16 // Number of LEDs
|
||||
#define RGBLIGHT_ANIMATIONS
|
||||
|
||||
#define RGBLIGHT_HUE_STEP 12
|
||||
#define RGBLIGHT_SAT_STEP 12
|
||||
#define RGBLIGHT_VAL_STEP 12
|
||||
|
||||
@@ -25,34 +25,44 @@ enum planck_keycodes {
|
||||
#define BACKLIT OSM(MOD_LSFT)
|
||||
#endif
|
||||
|
||||
#define LAYOUT_ortho_4x12_base( \
|
||||
K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \
|
||||
K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \
|
||||
K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \
|
||||
) \
|
||||
LAYOUT_ortho_4x12_wrapper( \
|
||||
KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \
|
||||
KC_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \
|
||||
KC_MLSF, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, CTL_T(K2A), KC_ENT, \
|
||||
BACKLIT, OS_LCTL, OS_LALT, OS_LGUI, SP_LWER, BK_LWER, DL_RAIS, ET_RAIS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
|
||||
)
|
||||
#define LAYOUT_ortho_4x12_base_wrapper(...) LAYOUT_ortho_4x12_base(__VA_ARGS__)
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[_QWERTY] = LAYOUT_ortho_4x12_wrapper(
|
||||
KC_ESC, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC,
|
||||
KC_TAB, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT,
|
||||
KC_MLSF, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_ENT,
|
||||
BACKLIT, OS_LCTL, OS_LALT, OS_LGUI, SP_LWER, BK_LWER, DL_RAIS, ET_RAIS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
|
||||
[_QWERTY] = LAYOUT_ortho_4x12_base_wrapper(
|
||||
_________________QWERTY_L1_________________, _________________QWERTY_R1_________________,
|
||||
_________________QWERTY_L2_________________, _________________QWERTY_R2_________________,
|
||||
_________________QWERTY_L3_________________, _________________QWERTY_R3_________________
|
||||
),
|
||||
|
||||
[_COLEMAK] = LAYOUT_ortho_4x12_wrapper(
|
||||
KC_ESC, _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, KC_BSPC,
|
||||
KC_TAB, _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, KC_QUOT,
|
||||
KC_MLSF, _________________COLEMAK_L3________________, _________________COLEMAK_R3________________, KC_ENT,
|
||||
BACKLIT, OS_LCTL, OS_LALT, OS_LGUI, SP_LWER, BK_LWER, DL_RAIS, ET_RAIS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
|
||||
[_COLEMAK] = LAYOUT_ortho_4x12_base_wrapper(
|
||||
_________________COLEMAK_L1________________, _________________COLEMAK_R1________________,
|
||||
_________________COLEMAK_L2________________, _________________COLEMAK_R2________________,
|
||||
_________________COLEMAK_L3________________, _________________COLEMAK_R3________________
|
||||
),
|
||||
|
||||
[_DVORAK] = LAYOUT_ortho_4x12_wrapper(
|
||||
KC_ESC, _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, KC_BSPC,
|
||||
KC_TAB, _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, KC_SLSH,
|
||||
KC_MLSF, _________________DVORAK_L3_________________, _________________DVORAK_R3_________________, KC_ENT,
|
||||
BACKLIT, OS_LCTL, OS_LALT, OS_LGUI, SP_LWER, BK_LWER, DL_RAIS, ET_RAIS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
|
||||
[_DVORAK] = LAYOUT_ortho_4x12_base_wrapper(
|
||||
_________________DVORAK_L1_________________, _________________DVORAK_R1_________________,
|
||||
_________________DVORAK_L2_________________, _________________DVORAK_R2_________________,
|
||||
_________________DVORAK_L3_________________, _________________DVORAK_R3_________________
|
||||
),
|
||||
|
||||
[_WORKMAN] = LAYOUT_ortho_4x12_wrapper(
|
||||
KC_TAB, _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, KC_BSPC,
|
||||
KC_ESC, _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, KC_QUOT,
|
||||
KC_MLSF, _________________WORKMAN_L3________________, _________________WORKMAN_R3________________, KC_ENT,
|
||||
BACKLIT, OS_LCTL, OS_LALT, OS_LGUI, SP_LWER, BK_LWER, DL_RAIS, ET_RAIS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
|
||||
[_WORKMAN] = LAYOUT_ortho_4x12_base_wrapper(
|
||||
_________________WORKMAN_L1________________, _________________WORKMAN_R1________________,
|
||||
_________________WORKMAN_L2________________, _________________WORKMAN_R2________________,
|
||||
_________________WORKMAN_L3________________, _________________WORKMAN_R3________________
|
||||
),
|
||||
|
||||
[_MODS] = LAYOUT_ortho_4x12_wrapper(
|
||||
|
||||
106
quantum/keymap_extras/keymap_slovenian.h
Normal file
106
quantum/keymap_extras/keymap_slovenian.h
Normal file
@@ -0,0 +1,106 @@
|
||||
/* Copyright 2018 Žan Pevec
|
||||
*
|
||||
* 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 KEYMAP_SLOVENIAN
|
||||
#define KEYMAP_SLOVENIAN
|
||||
#include "keymap.h"
|
||||
|
||||
|
||||
//Swapped Z and Y
|
||||
#define SI_Z KC_Y
|
||||
#define SI_Y KC_Z
|
||||
|
||||
//Special characters
|
||||
#define SI_CV KC_SCLN
|
||||
#define SI_SV KC_LBRC
|
||||
#define SI_ZV KC_BSLS
|
||||
|
||||
#define SI_A KC_A
|
||||
#define SI_B KC_B
|
||||
#define SI_C KC_C
|
||||
#define SI_D KC_D
|
||||
#define SI_E KC_E
|
||||
#define SI_F KC_F
|
||||
#define SI_G KC_G
|
||||
#define SI_H KC_H
|
||||
#define SI_I KC_I
|
||||
#define SI_J KC_J
|
||||
#define SI_K KC_K
|
||||
#define SI_L KC_L
|
||||
#define SI_M KC_M
|
||||
#define SI_N KC_N
|
||||
#define SI_O KC_O
|
||||
#define SI_P KC_P
|
||||
#define SI_Q KC_Q
|
||||
#define SI_R KC_R
|
||||
#define SI_S KC_S
|
||||
#define SI_T KC_T
|
||||
#define SI_U KC_U
|
||||
#define SI_V KC_V
|
||||
#define SI_W KC_W
|
||||
#define SI_X KC_X
|
||||
|
||||
#define SI_0 KC_0
|
||||
#define SI_1 KC_1
|
||||
#define SI_2 KC_2
|
||||
#define SI_3 KC_3
|
||||
#define SI_4 KC_4
|
||||
#define SI_5 KC_5
|
||||
#define SI_6 KC_6
|
||||
#define SI_7 KC_7
|
||||
#define SI_8 KC_8
|
||||
#define SI_9 KC_9
|
||||
|
||||
#define SI_DOT KC_DOT
|
||||
#define SI_COMM KC_COMM
|
||||
|
||||
#define SI_PLUS KC_EQL // + and * and ~
|
||||
#define SI_QOT KC_MINS // Single quote
|
||||
#define SI_MINS KC_SLSH // - and _
|
||||
|
||||
// shifted characters
|
||||
#define SI_EXLM LSFT(KC_1) // !
|
||||
#define SO_DQOT LSFT(KC_2) // "
|
||||
#define SI_HASH LSFT(KC_3) // #
|
||||
#define SI_DLR LSFT(KC_4) // $
|
||||
#define SI_PERC LSFT(KC_5) // %
|
||||
#define SI_AMPR LSFT(KC_6) // &
|
||||
#define SI_SLSH LSFT(KC_7) // /
|
||||
#define SI_LPRN LSFT(KC_8) // (
|
||||
#define SI_RPRN LSFT(KC_9) // )
|
||||
#define SI_EQL LSFT(KC_0) // =
|
||||
#define SI_QST LSFT(SI_QOT) // ?
|
||||
#define SI_ASTR LSFT(SI_PLUS) // *
|
||||
#define SI_COLN LSFT(KC_DOT) // :
|
||||
#define SI_SCLN LSFT(KC_COMM) // ;
|
||||
#define SI_UNDS LSFT(SI_MINS) // _
|
||||
|
||||
// Alt Gr-ed characters
|
||||
#define SI_CIRC ALGR(KC_3) // ^
|
||||
#define SI_DEG ALGR(KC_5) // °
|
||||
#define SI_GRV ALGR(KC_7) // `
|
||||
#define SI_ACCU ALGR(KC_9) // ´
|
||||
#define SI_LCBR ALGR(KC_B) // {
|
||||
#define SI_RCBR ALGR(KC_N) // }
|
||||
#define SI_LBRC ALGR(KC_F) // [
|
||||
#define SI_RBRC ALGR(KC_G) // ]
|
||||
#define SI_BSLS ALGR(KC_Q) // backslash
|
||||
#define SI_AT ALGR(KC_V) // @
|
||||
#define SI_EURO ALGR(KC_E) // €
|
||||
#define SI_TILD ALGR(KC_1) // ~
|
||||
#define SI_PIPE ALGR(KC_W) // |
|
||||
|
||||
#endif
|
||||
@@ -19,10 +19,12 @@
|
||||
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
#define RGBLIGHT_SLEEP
|
||||
#undef RGBLIGHT_ANIMATIONS
|
||||
#define RGBLIGHT_EFFECT_BREATHING
|
||||
#define RGBLIGHT_EFFECT_SNAKE
|
||||
#define RGBLIGHT_EFFECT_KNIGHT
|
||||
#endif // RGBLIGHT_ENABLE
|
||||
|
||||
|
||||
|
||||
#ifndef ONESHOT_TAP_TOGGLE
|
||||
#define ONESHOT_TAP_TOGGLE 2
|
||||
#endif // !ONESHOT_TAP_TOGGLE
|
||||
|
||||
@@ -36,11 +36,11 @@ bool send_game_macro(const char *str, keyrecord_t *record, bool override) {
|
||||
keycode = KC_ENTER;
|
||||
}
|
||||
clear_keyboard();
|
||||
tap(keycode);
|
||||
tap_code(keycode);
|
||||
wait_ms(50);
|
||||
send_string_with_delay(str, MACRO_TIMER);
|
||||
wait_ms(50);
|
||||
tap(KC_ENTER);
|
||||
tap_code(KC_ENTER);
|
||||
}
|
||||
if (override) wait_ms(3000);
|
||||
return false;
|
||||
@@ -127,13 +127,13 @@ uint32_t default_layer_state_set_keymap (uint32_t state) {
|
||||
__attribute__ ((weak))
|
||||
void led_set_keymap(uint8_t usb_led) {}
|
||||
|
||||
|
||||
__attribute__ ((weak))
|
||||
void eeconfig_init_keymap(void) {}
|
||||
|
||||
// Call user matrix init, set default RGB colors and then
|
||||
// call the keymap's init function
|
||||
void matrix_init_user(void) {
|
||||
userspace_config.raw = eeprom_read_dword(EECONFIG_USERSPACE);
|
||||
|
||||
userspace_config.raw = eeconfig_read_user();
|
||||
|
||||
#ifdef BOOTLOADER_CATERINA
|
||||
DDRD &= ~(1<<5);
|
||||
@@ -250,7 +250,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
|
||||
case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader
|
||||
if (!record->event.pressed) {
|
||||
send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP
|
||||
uint8_t temp_mod = get_mods();
|
||||
clear_mods();
|
||||
send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), 10);
|
||||
if (temp_mod & MODS_SHIFT_MASK) {
|
||||
send_string_with_delay_P(PSTR(
|
||||
#if defined(__ARM__)
|
||||
":dfu-util"
|
||||
#elif defined(BOOTLOADER_DFU)
|
||||
@@ -260,7 +264,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
#elif defined(BOOTLOADER_CATERINA)
|
||||
":avrdude"
|
||||
#endif // bootloader options
|
||||
SS_TAP(X_ENTER)), 10);
|
||||
), 10);
|
||||
}
|
||||
if (temp_mod & MODS_CTRL_MASK) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), 10); }
|
||||
send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10);
|
||||
set_mods(temp_mod);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
@@ -268,8 +276,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
case EPRM: // Resets EEPROM
|
||||
if (record->event.pressed) {
|
||||
eeconfig_init();
|
||||
default_layer_set(1UL<<eeconfig_read_default_layer());
|
||||
layer_state_set(layer_state);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
@@ -295,7 +301,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
// to save on firmware space, since it's limited.
|
||||
#ifdef MACROS_ENABLED
|
||||
case KC_OVERWATCH: // Toggle's if we hit "ENTER" or "BACKSPACE" to input macros
|
||||
if (record->event.pressed) { userspace_config.is_overwatch ^= 1; eeprom_update_dword(EECONFIG_USERSPACE, userspace_config.raw); }
|
||||
if (record->event.pressed) { userspace_config.is_overwatch ^= 1; eeconfig_update_user(userspace_config.raw); }
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
userspace_config.is_overwatch ? rgblight_mode_noeeprom(17) : rgblight_mode_noeeprom(18);
|
||||
#endif //RGBLIGHT_ENABLE
|
||||
@@ -344,11 +350,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
} else {
|
||||
if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy
|
||||
register_code(KC_LCTL);
|
||||
tap(KC_C);
|
||||
tap_code(KC_C);
|
||||
unregister_code(KC_LCTL);
|
||||
} else { // Tap, paste
|
||||
register_code(KC_LCTL);
|
||||
tap(KC_V);
|
||||
tap_code(KC_V);
|
||||
unregister_code(KC_LCTL);
|
||||
}
|
||||
}
|
||||
@@ -413,3 +419,8 @@ uint32_t default_layer_state_set_user(uint32_t state) {
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
led_set_keymap(usb_led);
|
||||
}
|
||||
|
||||
void eeconfig_init_user(void) {
|
||||
userspace_config.raw = 0;
|
||||
eeconfig_update_user(userspace_config.raw);
|
||||
}
|
||||
|
||||
@@ -19,14 +19,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "quantum.h"
|
||||
#include "version.h"
|
||||
#include "eeprom.h"
|
||||
#include "send_unicode.h"
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
#include "rgb_matrix.h"
|
||||
#endif
|
||||
|
||||
|
||||
// Define layer names
|
||||
/* Define layer names */
|
||||
enum userspace_layers {
|
||||
_QWERTY = 0,
|
||||
_NUMLOCK = 0,
|
||||
@@ -43,28 +42,27 @@ enum userspace_layers {
|
||||
_ADJUST,
|
||||
};
|
||||
|
||||
//define modifiers
|
||||
/*
|
||||
define modifiers here, since MOD_* doesn't seem to work for these
|
||||
*/
|
||||
#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
|
||||
#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL))
|
||||
#define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
|
||||
#define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI))
|
||||
|
||||
|
||||
// RGB color codes are no longer located here anymore. Instead, you will want to
|
||||
// head to https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight_list.h
|
||||
|
||||
extern bool rgb_layer_change;
|
||||
/*
|
||||
RGB color codes are no longer located here anymore. Instead, you will want to
|
||||
head to https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight_list.h
|
||||
*/
|
||||
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
void rgblight_sethsv_default_helper(uint8_t index);
|
||||
#endif // RGBLIGHT_ENABLE
|
||||
|
||||
inline void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); };
|
||||
bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed);
|
||||
bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer);
|
||||
|
||||
#define EECONFIG_USERSPACE (uint32_t *)19
|
||||
|
||||
typedef union {
|
||||
uint32_t raw;
|
||||
struct {
|
||||
@@ -149,7 +147,7 @@ enum userspace_custom_keycodes {
|
||||
#define DL_RAIS LT(_RAISE, KC_DEL)
|
||||
#define ET_RAIS LT(_RAISE, KC_ENTER)
|
||||
|
||||
// OSM keycodes, to keep things clean and easy to change
|
||||
/* OSM keycodes, to keep things clean and easy to change */
|
||||
#define KC_MLSF OSM(MOD_LSFT)
|
||||
#define KC_MRSF OSM(MOD_RSFT)
|
||||
|
||||
@@ -178,9 +176,11 @@ enum {
|
||||
#endif // TAP_DANCE_ENABLE
|
||||
|
||||
|
||||
// Custom Keycodes for Diablo 3 layer
|
||||
// But since TD() doesn't work when tap dance is disabled
|
||||
// We use custom codes here, so we can substitute the right stuff
|
||||
/*
|
||||
Custom Keycodes for Diablo 3 layer
|
||||
But since TD() doesn't work when tap dance is disabled
|
||||
We use custom codes here, so we can substitute the right stuff
|
||||
*/
|
||||
#ifdef TAP_DANCE_ENABLE
|
||||
#define KC_D3_1 TD(TD_D3_1)
|
||||
#define KC_D3_2 TD(TD_D3_2)
|
||||
@@ -193,11 +193,11 @@ enum {
|
||||
#define KC_D3_4 KC_4
|
||||
#endif // TAP_DANCE_ENABLE
|
||||
|
||||
|
||||
|
||||
// Since our quirky block definitions are basically a list of comma separated
|
||||
// arguments, we need a wrapper in order for these definitions to be
|
||||
// expanded before being used as arguments to the LAYOUT_xxx macro.
|
||||
/*
|
||||
Since our quirky block definitions are basically a list of comma separated
|
||||
arguments, we need a wrapper in order for these definitions to be
|
||||
expanded before being used as arguments to the LAYOUT_xxx macro.
|
||||
*/
|
||||
#if (!defined(LAYOUT) && defined(KEYMAP))
|
||||
#define LAYOUT KEYMAP
|
||||
#endif
|
||||
@@ -208,112 +208,114 @@ enum {
|
||||
#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__)
|
||||
#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__)
|
||||
|
||||
// Blocks for each of the four major keyboard layouts
|
||||
// Organized so we can quickly adapt and modify all of them
|
||||
// at once, rather than for each keyboard, one at a time.
|
||||
// And this allows for much cleaner blocks in the keymaps.
|
||||
// For instance Tap/Hold for Control on all of the layouts
|
||||
/*
|
||||
Blocks for each of the four major keyboard layouts
|
||||
Organized so we can quickly adapt and modify all of them
|
||||
at once, rather than for each keyboard, one at a time.
|
||||
And this allows for much cleaner blocks in the keymaps.
|
||||
For instance Tap/Hold for Control on all of the layouts
|
||||
|
||||
// NOTE: These are all the same length. If you do a search/replace
|
||||
// then you need to add/remove underscores to keep the
|
||||
// lengths consistent.
|
||||
NOTE: These are all the same length. If you do a search/replace
|
||||
then you need to add/remove underscores to keep the
|
||||
lengths consistent.
|
||||
*/
|
||||
|
||||
#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T
|
||||
#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G
|
||||
#define _________________QWERTY_L3_________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B
|
||||
#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B
|
||||
|
||||
#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P
|
||||
#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN
|
||||
#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH)
|
||||
#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH
|
||||
|
||||
|
||||
#define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_G
|
||||
#define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_D
|
||||
#define _________________COLEMAK_L3________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B
|
||||
#define _________________COLEMAK_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_B
|
||||
|
||||
#define _________________COLEMAK_R1________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN
|
||||
#define _________________COLEMAK_R2________________ KC_H, KC_N, KC_E, KC_I, KC_O
|
||||
#define _________________COLEMAK_R3________________ KC_K, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH)
|
||||
#define _________________COLEMAK_R3________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLASH
|
||||
|
||||
#define ______________COLEMAK_MOD_DH_L1____________ KC_Q, KC_W, KC_F, KC_P, KC_B
|
||||
#define ______________COLEMAK_MOD_DH_L2____________ KC_A, KC_R, KC_S, KC_T, KC_G
|
||||
#define ______________COLEMAK_MOD_DH_L3____________ CTL_T(KC_Z), KC_X, KC_C, KC_D, KC_V
|
||||
#define ______________COLEMAK_MOD_DH_L3____________ KC_Z, KC_X, KC_C, KC_D, KC_V
|
||||
|
||||
#define ______________COLEMAK_MOD_DH_R1____________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN
|
||||
#define ______________COLEMAK_MOD_DH_R2____________ KC_M, KC_N, KC_E, KC_I, KC_O
|
||||
#define ______________COLEMAK_MOD_DH_R3____________ KC_K, KC_H, KC_COMM, KC_DOT, CTL_T(KC_SLASH)
|
||||
#define ______________COLEMAK_MOD_DH_R3____________ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLASH
|
||||
|
||||
|
||||
#define _________________DVORAK_L1_________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y
|
||||
#define _________________DVORAK_L2_________________ KC_A, KC_O, KC_E, KC_U, KC_I
|
||||
#define _________________DVORAK_L3_________________ CTL_T(KC_SCLN),KC_Q, KC_J, KC_K, KC_X
|
||||
#define _________________DVORAK_L3_________________ KC_SCLN, KC_Q, KC_J, KC_K, KC_X
|
||||
|
||||
#define _________________DVORAK_R1_________________ KC_F, KC_G, KC_C, KC_R, KC_L
|
||||
#define _________________DVORAK_R2_________________ KC_D, KC_H, KC_T, KC_N, KC_S
|
||||
#define _________________DVORAK_R3_________________ KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z)
|
||||
#define _________________DVORAK_R3_________________ KC_B, KC_M, KC_W, KC_V, KC_Z
|
||||
|
||||
|
||||
#define _________________WORKMAN_L1________________ KC_Q, KC_D, KC_R, KC_W, KC_B
|
||||
#define _________________WORKMAN_L2________________ KC_A, KC_S, KC_H, KC_T, KC_G
|
||||
#define _________________WORKMAN_L3________________ CTL_T(KC_Z), KC_X, KC_M, KC_C, KC_V
|
||||
#define _________________WORKMAN_L3________________ KC_Z, KC_X, KC_M, KC_C, KC_V
|
||||
|
||||
#define _________________WORKMAN_R1________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN
|
||||
#define _________________WORKMAN_R2________________ KC_Y, KC_N, KC_E, KC_O, KC_I
|
||||
#define _________________WORKMAN_R3________________ KC_K, KC_L, KC_COMM, KC_DOT, CTL_T(KC_SLASH)
|
||||
#define _________________WORKMAN_R3________________ KC_K, KC_L, KC_COMM, KC_DOT, KC_SLASH
|
||||
|
||||
|
||||
#define _________________NORMAN_L1_________________ KC_Q, KC_W, KC_D, KC_F, KC_K
|
||||
#define _________________NORMAN_L2_________________ KC_A, KC_S, KC_E, KC_T, KC_G
|
||||
#define _________________NORMAN_L3_________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B
|
||||
#define _________________NORMAN_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B
|
||||
|
||||
#define _________________NORMAN_R1_________________ KC_J, KC_U, KC_R, KC_L, KC_SCLN
|
||||
#define _________________NORMAN_R2_________________ KC_Y, KC_N, KC_I, KC_O, KC_U
|
||||
#define _________________NORMAN_R3_________________ KC_P, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH)
|
||||
#define _________________NORMAN_R3_________________ KC_P, KC_M, KC_COMM, KC_DOT, KC_SLASH
|
||||
|
||||
|
||||
#define _________________MALTRON_L1________________ KC_Q, KC_P, KC_Y, KC_C, KC_B
|
||||
#define _________________MALTRON_L2________________ KC_A, KC_N, KC_I, KC_S, KC_F
|
||||
#define _________________MALTRON_L3________________ CTL_T(KC_SCLN), KC_SLSH, KC_J KC_G, KC_COMM
|
||||
#define _________________MALTRON_L3________________ KC_SCLN, KC_SLSH, KC_J KC_G, KC_COMM
|
||||
|
||||
#define _________________MALTRON_R1________________ KC_V, KC_M, KC_U, KC_Z, KC_L
|
||||
#define _________________MALTRON_R2________________ KC_D, KC_T, KC_D, KC_O, KC_R
|
||||
#define _________________MALTRON_R3________________ KC_DOT, KC_W, KC_K, KC_MINS, CTL_T(KC_x)
|
||||
#define _________________MALTRON_R3________________ KC_DOT, KC_W, KC_K, KC_MINS, KC_X
|
||||
|
||||
|
||||
#define _________________EUCALYN_L1________________ KC_SLSH, KC_COMM, KC_DOT, KC_F, KC_Q
|
||||
#define _________________EUCALYN_L2________________ KC_A, KC_O, KC_E, KC_I, KC_U
|
||||
#define _________________EUCALYN_L3________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_W
|
||||
#define _________________EUCALYN_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_W
|
||||
|
||||
#define _________________EUCALYN_R1________________ KC_M, KC_R, KC_D, KC_Y, KC_P
|
||||
#define _________________EUCALYN_R2________________ KC_G, KC_T, KC_K, KC_S, KC_N
|
||||
#define _________________EUCALYN_R3________________ KC_B, KC_H, KC_J, KC_L, CTL_T(KC_SCLN)
|
||||
#define _________________EUCALYN_R3________________ KC_B, KC_H, KC_J, KC_L, KC_SCLN
|
||||
|
||||
|
||||
#define _____________CARPLAX_QFMLWY_L1_____________ KC_Q, KC_F, KC_M, KC_L, KC_W
|
||||
#define _____________CARPLAX_QFMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R
|
||||
#define _____________CARPLAX_QFMLWY_L3_____________ CTL_T(KC_Z), KC_V, KC_G, KC_C, KC_X
|
||||
#define _____________CARPLAX_QFMLWY_L3_____________ KC_Z, KC_V, KC_G, KC_C, KC_X
|
||||
|
||||
#define _____________CARPLAX_QFMLWY_R1_____________ KC_Y, KC_U, KC_O, KC_B, KC_J
|
||||
#define _____________CARPLAX_QFMLWY_R2_____________ KC_I, KC_A, KC_E, KC_H, KC_SCLN
|
||||
#define _____________CARPLAX_QFMLWY_R3_____________ KC_P, KC_K, KC_COMM, KC_DOT, CTL_T(KC_SLSH)
|
||||
#define _____________CARPLAX_QFMLWY_R3_____________ KC_P, KC_K, KC_COMM, KC_DOT, KC_SLSH
|
||||
|
||||
|
||||
#define _____________CARPLAX_QGMLWB_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W
|
||||
#define _____________CARPLAX_QGMLWB_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R
|
||||
#define _____________CARPLAX_QGMLWB_L3_____________ CTL_T(KC_Z), KC_X, KC_C, KC_F, KC_J
|
||||
#define _____________CARPLAX_QGMLWB_L3_____________ KC_Z, KC_X, KC_C, KC_F, KC_J
|
||||
|
||||
#define _____________CARPLAX_QGMLWB_R1_____________ KC_B, KC_Y, KC_U, KC_V, KC_SCLN
|
||||
#define _____________CARPLAX_QGMLWB_R2_____________ KC_I, KC_A, KC_E, KC_O, KC_H
|
||||
#define _____________CARPLAX_QGMLWB_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, CTL_T(KC_SLSH)
|
||||
#define _____________CARPLAX_QGMLWB_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH
|
||||
|
||||
|
||||
#define _____________CARPLAX_QGMLWY_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W
|
||||
#define _____________CARPLAX_QGMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R
|
||||
#define _____________CARPLAX_QGMLWY_L3_____________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_J
|
||||
#define _____________CARPLAX_QGMLWY_L3_____________ KC_Z, KC_X, KC_C, KC_V, KC_J
|
||||
|
||||
#define _____________CARPLAX_QGMLWY_R1_____________ KC_Y, KC_F, KC_U, KC_B, KC_SCLN
|
||||
#define _____________CARPLAX_QGMLWY_R2_____________ KC_I, KC_A, KC_E, KC_O, KC_H
|
||||
#define _____________CARPLAX_QGMLWY_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, CTL_T(KC_SLSH)
|
||||
#define _____________CARPLAX_QGMLWY_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH
|
||||
|
||||
|
||||
#define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5
|
||||
@@ -352,21 +354,3 @@ enum {
|
||||
#define _________________ADJUST_R2_________________ AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN
|
||||
#define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT
|
||||
|
||||
|
||||
// Since we have 4 default layouts (QWERTY, DVORAK, COLEMAK and WORKMAN),
|
||||
// this allows us to quickly modify the bottom row for all of the layouts
|
||||
// so we don't have to alter it 4 times and hope that we haven't missed
|
||||
// anything
|
||||
#define ___________ERGODOX_BOTTOM_LEFT_____________ OSM(MOD_MEH), OSM(MOD_LGUI), KC_LBRC, KC_RBRC
|
||||
#define ___________ERGODOX_BOTTOM_RIGHT____________ KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
|
||||
|
||||
|
||||
#define ___________ORTHODOX_THUMP_TOP_____________ ALT_APP, OS_LGUI, KC_LALT, OS_RGUI
|
||||
#define ___________________ORTHODOX_THUMB_BOTTOM____________________ LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE
|
||||
|
||||
|
||||
#define __________________ERGODOX_THUMB_CLUSTER_____________________ ALT_T(KC_APP), OSM(MOD_LGUI), OSM(MOD_RGUI), CTL_T(KC_ESCAPE), \
|
||||
KC_HOME, KC_PGUP, \
|
||||
LT(_LOWER, KC_SPACE),KC_BSPC, KC_END, KC_PGDN, KC_DEL, LT(_RAISE, KC_ENTER)
|
||||
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (record->event.pressed) {
|
||||
userspace_config.rgb_layer_change ^= 1;
|
||||
xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change);
|
||||
eeprom_update_dword(EECONFIG_USERSPACE, userspace_config.raw);
|
||||
eeconfig_update_user(userspace_config.raw);
|
||||
if (userspace_config.rgb_layer_change) {
|
||||
layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better)
|
||||
}
|
||||
@@ -243,7 +243,7 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (userspace_config.rgb_layer_change) {
|
||||
userspace_config.rgb_layer_change = false;
|
||||
xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change);
|
||||
eeprom_update_dword(EECONFIG_USERSPACE, userspace_config.raw);
|
||||
eeconfig_update_user(userspace_config.raw);
|
||||
}
|
||||
}
|
||||
return true; break;
|
||||
@@ -295,31 +295,31 @@ uint32_t layer_state_set_rgb(uint32_t state) {
|
||||
switch (biton32(state)) {
|
||||
case _MACROS:
|
||||
rgblight_sethsv_noeeprom_orange();
|
||||
userspace_config.is_overwatch ? rgblight_mode_noeeprom(17) : rgblight_mode_noeeprom(18);
|
||||
userspace_config.is_overwatch ? rgblight_effect_snake(RGBLIGHT_MODE_SNAKE + 2) : rgblight_effect_snake(RGBLIGHT_MODE_SNAKE + 3);
|
||||
break;
|
||||
case _MEDIA:
|
||||
rgblight_sethsv_noeeprom_chartreuse();
|
||||
rgblight_mode_noeeprom(22);
|
||||
rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 1);
|
||||
break;
|
||||
case _GAMEPAD:
|
||||
rgblight_sethsv_noeeprom_orange();
|
||||
rgblight_mode_noeeprom(17);
|
||||
rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 2);
|
||||
break;
|
||||
case _DIABLO:
|
||||
rgblight_sethsv_noeeprom_red();
|
||||
rgblight_mode_noeeprom(5);
|
||||
rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3);
|
||||
break;
|
||||
case _RAISE:
|
||||
rgblight_sethsv_noeeprom_yellow();
|
||||
rgblight_mode_noeeprom(5);
|
||||
rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3);
|
||||
break;
|
||||
case _LOWER:
|
||||
rgblight_sethsv_noeeprom_green();
|
||||
rgblight_mode_noeeprom(5);
|
||||
rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3);
|
||||
break;
|
||||
case _ADJUST:
|
||||
rgblight_sethsv_noeeprom_red();
|
||||
rgblight_mode_noeeprom(23);
|
||||
rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2);
|
||||
break;
|
||||
default: // for any other layers, or the default layer
|
||||
switch (biton32(default_layer_state)) {
|
||||
@@ -332,7 +332,7 @@ uint32_t layer_state_set_rgb(uint32_t state) {
|
||||
default:
|
||||
rgblight_sethsv_noeeprom_cyan(); break;
|
||||
}
|
||||
biton32(state) == _MODS ? rgblight_mode_noeeprom(2) : rgblight_mode_noeeprom(1); // if _MODS layer is on, then breath to denote it
|
||||
biton32(state) == _MODS ? rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING) : rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); // if _MODS layer is on, then breath to denote it
|
||||
break;
|
||||
}
|
||||
// layer_state_set_indicator(); // Runs every scan, so need to call this here .... since I can't get it working "right" anyhow
|
||||
|
||||
@@ -37,6 +37,3 @@ ifdef CONSOLE_ENABLE
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(UNICODE_ENABLE)), yes)
|
||||
SRC += send_unicode.c
|
||||
endif
|
||||
|
||||
@@ -38,16 +38,16 @@ qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
|
||||
// Sends the key press to system, but only if on the Diablo layer
|
||||
void send_diablo_keystroke(uint8_t diablo_key) {
|
||||
if (biton32(layer_state) == _DIABLO) {
|
||||
if (IS_LAYER_ON(_DIABLO)) {
|
||||
switch (diablo_key) {
|
||||
case 0:
|
||||
tap(KC_1); break;
|
||||
tap_code(KC_1); break;
|
||||
case 1:
|
||||
tap(KC_2); break;
|
||||
tap_code(KC_2); break;
|
||||
case 2:
|
||||
tap(KC_3); break;
|
||||
tap_code(KC_3); break;
|
||||
case 3:
|
||||
tap(KC_4); break;
|
||||
tap_code(KC_4); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
21
users/sigma/config.h
Normal file
21
users/sigma/config.h
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
Copyright 2018 Yann Hodique <yann.hodique@gmail.com> @sigma
|
||||
|
||||
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/>.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#define LEADER_TIMEOUT 1000
|
||||
|
||||
#define MACRO_TIMER 5
|
||||
3
users/sigma/rules.mk
Normal file
3
users/sigma/rules.mk
Normal file
@@ -0,0 +1,3 @@
|
||||
LEADER_ENABLE = yes
|
||||
|
||||
SRC += sigma.c
|
||||
276
users/sigma/sigma.c
Normal file
276
users/sigma/sigma.c
Normal file
@@ -0,0 +1,276 @@
|
||||
/*
|
||||
Copyright 2018 Yann Hodique <yann.hodique@gmail.com> @sigma
|
||||
|
||||
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 "sigma.h"
|
||||
|
||||
userspace_config_t runtime_userspace_config;
|
||||
userspace_config_t stored_userspace_config;
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_keymap(void) {}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void startup_keymap(void) {}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void shutdown_keymap(void) {}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void suspend_power_down_keymap(void) {}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void suspend_wakeup_init_keymap(void) {}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_keymap(void) {}
|
||||
|
||||
__attribute__ ((weak))
|
||||
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
bool process_record_secrets(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
__attribute__ ((weak))
|
||||
uint32_t layer_state_set_keymap (uint32_t state) {
|
||||
return state;
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
uint32_t default_layer_state_set_keymap (uint32_t state) {
|
||||
return state;
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void led_set_keymap(uint8_t usb_led) {}
|
||||
|
||||
void set_os(uint8_t os) {
|
||||
runtime_userspace_config.os_target = os;
|
||||
|
||||
switch (os) {
|
||||
case _OS_MACOS:
|
||||
set_unicode_input_mode(UC_OSX);
|
||||
break;
|
||||
case _OS_LINUX:
|
||||
set_unicode_input_mode(UC_LNX);
|
||||
break;
|
||||
case _OS_WINDOWS:
|
||||
set_unicode_input_mode(UC_WIN);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void matrix_init_user(void) {
|
||||
stored_userspace_config.raw = eeconfig_read_user();
|
||||
runtime_userspace_config.raw = stored_userspace_config.raw;
|
||||
|
||||
set_os(runtime_userspace_config.os_target);
|
||||
}
|
||||
|
||||
void store_userspace_config(void) {
|
||||
eeconfig_update_user(stored_userspace_config.raw);
|
||||
}
|
||||
|
||||
LEADER_EXTERNS();
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
LEADER_DICTIONARY() {
|
||||
leading = false;
|
||||
leader_end();
|
||||
|
||||
SEQ_TWO_KEYS(KC_F1, KC_L) {
|
||||
set_os(_OS_LINUX);
|
||||
}
|
||||
SEQ_TWO_KEYS(KC_F1, KC_M) {
|
||||
set_os(_OS_MACOS);
|
||||
}
|
||||
SEQ_TWO_KEYS(KC_F1, KC_W) {
|
||||
set_os(_OS_WINDOWS);
|
||||
}
|
||||
SEQ_TWO_KEYS(KC_F1, KC_S) {
|
||||
stored_userspace_config.raw = runtime_userspace_config.raw;
|
||||
store_userspace_config();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
uint8_t os_target = runtime_userspace_config.os_target;
|
||||
bool pressed = record->event.pressed;
|
||||
|
||||
switch (keycode) {
|
||||
case KC_QWERTY:
|
||||
if (pressed) {
|
||||
set_single_persistent_default_layer(_QWERTY);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader
|
||||
if (!pressed) {
|
||||
send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP
|
||||
#if defined(__ARM__)
|
||||
":dfu-util"
|
||||
#elif defined(BOOTLOADER_DFU)
|
||||
":dfu"
|
||||
#elif defined(BOOTLOADER_HALFKAY)
|
||||
":teensy"
|
||||
#elif defined(BOOTLOADER_CATERINA)
|
||||
":avrdude"
|
||||
#endif // bootloader options
|
||||
SS_TAP(X_ENTER)), 10);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
case EPRM: // Resets EEPROM
|
||||
if (pressed) {
|
||||
eeconfig_init();
|
||||
default_layer_set(1UL<<eeconfig_read_default_layer());
|
||||
layer_state_set(layer_state);
|
||||
set_os(_OS_MACOS);
|
||||
store_userspace_config();
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case VRSN: // Prints firmware version
|
||||
if (pressed) {
|
||||
send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), MACRO_TIMER);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
case KC_OS_CUT:
|
||||
switch (os_target) {
|
||||
case _OS_MACOS:
|
||||
if (pressed)
|
||||
SEND_STRING(SS_LGUI("x"));
|
||||
break;
|
||||
case _OS_LINUX:
|
||||
pressed ?
|
||||
register_code(KC_CUT)
|
||||
: unregister_code(KC_CUT);
|
||||
break;
|
||||
default:
|
||||
if (pressed)
|
||||
SEND_STRING(SS_LCTRL("x"));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case KC_OS_COPY:
|
||||
switch (os_target) {
|
||||
case _OS_MACOS:
|
||||
if (pressed)
|
||||
SEND_STRING(SS_LGUI("c"));
|
||||
break;
|
||||
case _OS_LINUX:
|
||||
pressed ?
|
||||
register_code(KC_COPY)
|
||||
: unregister_code(KC_COPY);
|
||||
break;
|
||||
default:
|
||||
if (pressed)
|
||||
SEND_STRING(SS_LCTRL("c"));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case KC_OS_PASTE:
|
||||
switch (os_target) {
|
||||
case _OS_MACOS:
|
||||
if (pressed)
|
||||
SEND_STRING(SS_LGUI("v"));
|
||||
break;
|
||||
case _OS_LINUX:
|
||||
pressed ?
|
||||
register_code(KC_PASTE)
|
||||
: unregister_code(KC_PASTE);
|
||||
break;
|
||||
default:
|
||||
if (pressed)
|
||||
SEND_STRING(SS_LCTRL("v"));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case KC_OS_UNDO:
|
||||
switch (os_target) {
|
||||
case _OS_MACOS:
|
||||
if (pressed)
|
||||
SEND_STRING(SS_LGUI("z"));
|
||||
break;
|
||||
case _OS_LINUX:
|
||||
pressed ?
|
||||
register_code(KC_UNDO)
|
||||
: unregister_code(KC_UNDO);
|
||||
break;
|
||||
default:
|
||||
if (pressed)
|
||||
SEND_STRING(SS_LCTRL("z"));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case KC_OS_REDO:
|
||||
switch (os_target) {
|
||||
case _OS_MACOS:
|
||||
if (pressed)
|
||||
SEND_STRING(SS_LGUI(SS_LSFT("z")));
|
||||
break;
|
||||
case _OS_LINUX:
|
||||
pressed ?
|
||||
register_code(KC_AGAIN)
|
||||
: unregister_code(KC_AGAIN);
|
||||
break;
|
||||
default:
|
||||
if (pressed)
|
||||
SEND_STRING(SS_LCTRL(SS_LSFT("z")));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case KC_OS_LOCK:
|
||||
switch (os_target) {
|
||||
case _OS_MACOS:
|
||||
if (pressed)
|
||||
SEND_STRING(SS_LGUI(SS_LCTRL("q")));
|
||||
break;
|
||||
case _OS_LINUX:
|
||||
pressed ?
|
||||
register_code(KC_PWR)
|
||||
: unregister_code(KC_PWR);
|
||||
break;
|
||||
default:
|
||||
if (pressed)
|
||||
SEND_STRING(SS_LGUI("l"));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case KC_SCRT:
|
||||
if (pressed) {
|
||||
SEND_STRING(SS_LGUI("`"));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return process_record_keymap(keycode, record);
|
||||
}
|
||||
58
users/sigma/sigma.h
Normal file
58
users/sigma/sigma.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
Copyright 2018 Yann Hodique <yann.hodique@gmail.com> @sigma
|
||||
|
||||
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/>.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "quantum.h"
|
||||
#include "version.h"
|
||||
#include "eeprom.h"
|
||||
|
||||
// Define os types
|
||||
enum os_types
|
||||
{
|
||||
_OS_MACOS = 0,
|
||||
_OS_LINUX,
|
||||
_OS_WINDOWS,
|
||||
};
|
||||
|
||||
// Define layer names
|
||||
enum userspace_layers
|
||||
{
|
||||
_QWERTY = 0,
|
||||
};
|
||||
|
||||
typedef union {
|
||||
uint32_t raw;
|
||||
struct {
|
||||
uint8_t os_target :2;
|
||||
};
|
||||
} userspace_config_t;
|
||||
|
||||
enum userspace_custom_keycodes
|
||||
{
|
||||
EPRM = SAFE_RANGE, // Resets EEPROM
|
||||
VRSN, // Prints QMK Firmware and board info
|
||||
KC_QWERTY, // Sets default layer to QWERTY
|
||||
KC_MAKE, // Rebuild the current firmware
|
||||
KC_OS_CUT,
|
||||
KC_OS_COPY,
|
||||
KC_OS_PASTE,
|
||||
KC_OS_UNDO,
|
||||
KC_OS_REDO,
|
||||
KC_OS_LOCK,
|
||||
KC_SCRT,
|
||||
NEW_SAFE_RANGE //use NEW_SAFE_RANGE for keymap specific codes
|
||||
};
|
||||
Reference in New Issue
Block a user