Merge pull request #17 from t4corun/SpringCleaning

Spring cleaning - Simplified layers and keymap
This commit is contained in:
Victor 2024-08-20 20:37:13 -05:00 committed by GitHub
commit b3649afc23
Failed to generate hash of commit
31 changed files with 635 additions and 512 deletions

View file

@ -4,16 +4,16 @@ My userspace for building QMK firmware via GitHub Actions. This does not require
## Layout
The custom layout optimizes for programming (SQL, Powershell, C) and minimizes holds for comfort. It started from [Manna Harbor Miryoku](https://github.com/manna-harbour/miryoku) and took heavy influence from [Jonas Hietala T-34](https://www.jonashietala.se/series/t-34/). The keymap designed for split 3x5, two thumbs keys, dual encoders, and combined with a Ploopy Nano trackball mouse. Design themes:
The custom layout optimizes for programming (SQL, Powershell, C) and minimizes holds for comfort. It started from [Manna Harbor Miryoku](https://github.com/manna-harbour/miryoku) and took heavy influence from [Jonas Hietala T-34](https://www.jonashietala.se/series/t-34/). Design Themes:
- The keymap designed for my ideal board: split 3x5 boards with five thumb keys, right side encoder, combined with a Ploopy Nano trackball mouse
- The userspace supports a sixth thumb key and left side encoder as well
- Releasing all keys always brings you back to base layer
- Patterns to layout design to reduce learning curve (e.g., Shortcuts in same place on multiple layers)
- Symbols important for powershell / writing are positioned under stronger fingers
- Game keymap that doesn't require massive game key bind changes. Tested on Resident Evil 4 Remake
Notes:
- Outside thumb keys are encoder clicks. Some keyboards may have extra thumb keys
- Layers are designed orthogonally with a single purpose per hand and are accessed by holding a thumb key on the opposite hand
- Reworking Symbols for programming focus
- Common symbols are positioned under stronger fingers
- Custom behavior from holds
- Advanced encoder map functionality to minimize/simplify layers
![image](my_keymap.png)
@ -27,7 +27,7 @@ Notes:
A single keymap layout can be shared with multiple keyboards by using C preprocessor macros. These macros are referenced in the keyboard JSON files, and the build process will expand them into a transient keymap.c file during compile time.
In this userspace, the base split 3x5_3 layout can be adapted for other split keyboards by expanding it with macros. For example, there is a wrapper that will add extra columns to the base layout for a Corne's 42-key 3x6_3 layout.
In this userspace, the base split 3x5_3 with dual encoders layout can be adapted for other split keyboards by expanding it with macros. For example, there is a wrapper that will add extra columns to the base layout for a Corne's 42-key 3x6_3 layout.
### Tri-Layer
@ -77,26 +77,54 @@ Opted to implement overrides here instead of using built-in Key Override functio
### Combos
Enables additional keys to be mapped by pressing multiple keys simultaneously. Primarily used to implement mouse buttons and make important keys (tab, backspace, etc) available on base layer. Combos are mapped based on the QWERTY layout but will work on any layer*. All Combos are disabled when `CONFIG` layer is active
Enables additional keys to be mapped by pressing multiple keys simultaneously. Primarily used to enable mouse functionality on base layer
| Combo | Result | Comment |
| ------------- | -------------------- | ------------------------------------------------- |
| `C` + `V` | `KC_BTN1` | Left click. Mouse buttons only work on base layer |
| `X` + `V` | `Drag Scroll Toggle` | Actual command varies per board |
| `D` + `F` | `KC_ENT` | |
| `J` + `K` | `KC_TAB` | |
| `M` + `Comma` | `KC_BSPC` | |
| `C` + `V` | `KC_BTN2` | Left click. Mouse buttons only work on base layer |
| `X` + `V` | `Drag Scroll Hold` | Actual command varies per board |
### Key Overrides
### Advanced Encoder Functionality
Enables us to customize the result of applying certain mods to keycodes. For example, Shift + Backspace will give Delete. Primarily used to minimize the number of layers and the layout
Implemented custom keycodes for encoders to enable modifiers to change encoder output and enable window/tab switching and mouse wheel zoom. The purpose is to remove seldomly used feature configuration keys to simplify the keymap
| Shortcut | Result | Comment |
| ------------------- | --------- | ----------------------------------------------------------------------------- |
| `Shift` + `KC_BSPC` | `KC_DEL` | Backspace is a combo. There are no dedicated backspace and delete keys mapped |
| `Shift` + `HF_NEXT` | `HF_PREV` | Only works on `CONFIG` layer Only for keyboards with Haptic feedback enabled |
| `Shift` + `HF_CONU` | `HF_COND` | Only works on `CONFIG` layer. Only for keyboards with Haptic feedback enabled |
| `Shift` + `CK_UP` | `CK_DOWN` | Only works on `CONFIG` layer. Only for keyboards with Audio enabled |
#### Tabbing
The NUM layer right side encoder will `tab` and `shift+tab`. Holding `alt` or `ctrl` will allow Window or Browser tab switching
#### Zoom
The MOUSE_FUNCTION layer right side encoder will send `ctrl+mouse wheel up` and `ctrl+mouse wheel down` without having to hold modifiers
#### Configuration changes
The NAV layer right side encoder behavior depends on what modifier is held. Refer to the table below
| Held Modifier | Result |
| ------------- | ---------------------------------------------------- |
| None | Cycles through base layers: QWERTY, COLEMAK DH, GAME |
| Shift | Changes RGB Matrix Hue |
| Ctrl | Changes RGB Matrix Sat |
| Alt | Changes RGB Matrix Brightness |
| Gui | Changes RGB Matrix Animation Speed |
| Shift+Ctrl | Changes RGB Matrix Animation |
| Ctrl+Alt | Changes Haptic Feedback Frequency |
| Alt+Gui | Changes Audio Click Frequency |
### Advanced Config Toggle
Implemented a custom keycode to enable modifiers to affect which feature is toggled. Similar to the Advanced Encoder, the purpose is to remove seldomly used keycodes and simplify the keymap. Refer to the table below
| Held Modifier | Result |
| ------------- | ---------------------------------------------------- |
| None | Cycles through base layers: QWERTY, COLEMAK DH, GAME |
| Shift | Enter Bootloader |
| Ctrl | Enter Ploopy Nano Bootloader |
| Alt | Toggle RGB Matrix On/Off |
| Gui | Toggle Combos On/Off |
| Shift+Ctrl | Toggle Haptic Feedback On/Off |
| Ctrl+Alt | Toggle Audio On/Off |
| Alt+Gui | Toggle Audio Clicks On/Off |
## Optional Features

View file

@ -6,28 +6,26 @@
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, \
k32, k33, k34, k35, k36, k37 \
k32, k33, k34, k35, k36, k37, \
e01, e02 \
) \
LAYOUT_rollow_wrapper ( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, \
k32, k33, k34, k35, k36, k37 \
e01, k33, k34, k35, k36, e02 \
)
#define ROLLOW(...) LAYOUT_3x5_3_keymap(__VA_ARGS__)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = ROLLOW(LAYER_QWERTY),
[_COLEMAK_DH] = ROLLOW(LAYER_COLEMAK_DH),
[_GAME] = ROLLOW(LAYER_GAME),
[_NAVIGATION] = ROLLOW(LAYER_NAVIGATION),
[_NUMBER] = ROLLOW(LAYER_NUMBER),
[_SYMBOL] = ROLLOW(LAYER_SYMBOL),
[_MOUSE_FUNC] = ROLLOW(LAYER_MOUSE_FUNC),
[_CONFIG] = ROLLOW(LAYER_CONFIG)
[_MOUSE_FUNC] = ROLLOW(LAYER_MOUSE_FUNC)
};
@ -35,16 +33,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* These are horizontal encoders. Found I have to make it opposite the rotary encoders for it to feel intuitive*/
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[_QWERTY] = { ENCODER_CCW_CW(KC_WH_D, KC_WH_U), ENCODER_CCW_CW(KC_VOLU, KC_VOLD) },
[_COLEMAK_DH] = { ENCODER_CCW_CW(KC_WH_D, KC_WH_U), ENCODER_CCW_CW(KC_VOLU, KC_VOLD) },
[_GAME] = { ENCODER_CCW_CW(KC_WH_D, KC_WH_U), ENCODER_CCW_CW(KC_VOLU, KC_VOLD) },
[_NAVIGATION] = { ENCODER_CCW_CW(ZOOMIN, ZOOMOUT), ENCODER_CCW_CW(___x___, ___x___) },
[_NUMBER] = { ENCODER_CCW_CW(___x___, ___x___), ENCODER_CCW_CW(KC_RGHT, KC_LEFT) },
[_NAVIGATION] = { ENCODER_CCW_CW(KC_RGHT, KC_LEFT), ENCODER_CCW_CW(FWD_CFG, REV_CFG) },
[_NUMBER] = { ENCODER_CCW_CW(___x___, ___x___), ENCODER_CCW_CW(FWD_TAB, REV_TAB) },
[_SYMBOL] = { ENCODER_CCW_CW(___x___, ___x___), ENCODER_CCW_CW(___x___, ___x___) },
[_MOUSE_FUNC] = { ENCODER_CCW_CW(KC_WH_D, KC_WH_U), ENCODER_CCW_CW(KC_VOLU, KC_VOLD) },
[_CONFIG] = { ENCODER_CCW_CW(BASELYR, RBSELYR), ENCODER_CCW_CW(TR_RMOD, TR_RRMD) }
[_MOUSE_FUNC] = { ENCODER_CCW_CW(KC_WH_D, KC_WH_U), ENCODER_CCW_CW(ZOOMIN, ZOOMOUT) }
};
#endif

View file

@ -21,26 +21,24 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, \
k32, k33, k34, k35, k36, k37 \
k32, k33, k34, k35, k36, k37, \
e01, e02 \
) \
LAYOUT_cnano_wrapper ( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, \
KC_BTN1, k33, k34, k35, k36 \
k32, k33, k34, k35, k36 \
)
#define CNANO(...) LAYOUT_3x5_3_keymap(__VA_ARGS__)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = CNANO(LAYER_QWERTY),
[_COLEMAK_DH] = CNANO(LAYER_COLEMAK_DH),
[_GAME] = CNANO(LAYER_GAME),
[_NAVIGATION] = CNANO(LAYER_NAVIGATION),
[_NUMBER] = CNANO(LAYER_NUMBER),
[_SYMBOL] = CNANO(LAYER_SYMBOL),
[_MOUSE_FUNC] = CNANO(LAYER_MOUSE_FUNC),
[_CONFIG] = CNANO(LAYER_CONFIG)
[_MOUSE_FUNC] = CNANO(LAYER_MOUSE_FUNC)
};

View file

@ -18,3 +18,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define RGB_MATRIX_LED_COUNT 36
#define RGB_MATRIX_SPLIT { 18, 18 }
#undef ENCODER_RESOLUTION
#undef ENCODER_RESOLUTION_RIGHT
#define ENCODER_RESOLUTION 4
#define ENCODER_RESOLUTION_RIGHT 4

View file

@ -22,28 +22,26 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, \
k32, k33, k34, k35, k36, k37 \
k32, k33, k34, k35, k36, k37, \
e01, e02 \
) \
LAYOUT_swoop_wrapper ( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, \
k32, k33, k34, k35, k36, k37 \
k32, k33, k34, k35, k36, e02 \
)
#define SWOOP(...) LAYOUT_3x5_3_keymap(__VA_ARGS__)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = SWOOP(LAYER_QWERTY),
[_COLEMAK_DH] = SWOOP(LAYER_COLEMAK_DH),
[_GAME] = SWOOP(LAYER_GAME),
[_NAVIGATION] = SWOOP(LAYER_NAVIGATION),
[_NUMBER] = SWOOP(LAYER_NUMBER),
[_SYMBOL] = SWOOP(LAYER_SYMBOL),
[_MOUSE_FUNC] = SWOOP(LAYER_MOUSE_FUNC),
[_CONFIG] = SWOOP(LAYER_CONFIG)
[_MOUSE_FUNC] = SWOOP(LAYER_MOUSE_FUNC)
};
@ -51,16 +49,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* The encoder presses are handled in the keymap */
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[_QWERTY] = { ENCODER_CCW_CW(KC_WH_U, KC_WH_D), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[_COLEMAK_DH] = { ENCODER_CCW_CW(KC_WH_U, KC_WH_D), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[_GAME] = { ENCODER_CCW_CW(KC_WH_U, KC_WH_D), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[_NAVIGATION] = { ENCODER_CCW_CW(ZOOMOUT, ZOOMIN), ENCODER_CCW_CW(___x___, ___x___) },
[_NUMBER] = { ENCODER_CCW_CW(___x___, ___x___), ENCODER_CCW_CW(KC_LEFT, KC_RGHT) },
[_NAVIGATION] = { ENCODER_CCW_CW(KC_LEFT, KC_RGHT), ENCODER_CCW_CW(REV_CFG, FWD_CFG) },
[_NUMBER] = { ENCODER_CCW_CW(___x___, ___x___), ENCODER_CCW_CW(REV_TAB, FWD_TAB) },
[_SYMBOL] = { ENCODER_CCW_CW(___x___, ___x___), ENCODER_CCW_CW(___x___, ___x___) },
[_MOUSE_FUNC] = { ENCODER_CCW_CW(KC_WH_U, KC_WH_D), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[_CONFIG] = { ENCODER_CCW_CW(RBSELYR, BASELYR), ENCODER_CCW_CW(TR_RRMD, TR_RMOD) }
[_MOUSE_FUNC] = { ENCODER_CCW_CW(KC_WH_U, KC_WH_D), ENCODER_CCW_CW(ZOOMOUT, ZOOMIN) }
};
#endif //ENCODER_MAP_ENABLE

View file

@ -21,26 +21,24 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, \
k32, k33, k34, k35, k36, k37 \
k32, k33, k34, k35, k36, k37, \
e01, e02 \
) \
LAYOUT_crkbd_wrapper ( \
KC_NO, k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, KC_NO, \
KC_NO, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, KC_NO, \
KC_NO, k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, KC_NO, \
KC_BTN1, k33, k34, k35, k36, KC_BTN4 \
k32, k33, k34, k35, k36, k37 \
)
#define CRKBD(...) LAYOUT_3x5_3_keymap(__VA_ARGS__)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = CRKBD(LAYER_QWERTY),
[_COLEMAK_DH] = CRKBD(LAYER_COLEMAK_DH),
[_GAME] = CRKBD(LAYER_GAME),
[_NAVIGATION] = CRKBD(LAYER_NAVIGATION),
[_NUMBER] = CRKBD(LAYER_NUMBER),
[_SYMBOL] = CRKBD(LAYER_SYMBOL),
[_MOUSE_FUNC] = CRKBD(LAYER_MOUSE_FUNC),
[_CONFIG] = CRKBD(LAYER_CONFIG)
[_MOUSE_FUNC] = CRKBD(LAYER_MOUSE_FUNC)
};

View file

@ -187,7 +187,7 @@
},
"LAYOUT_saegewerk": {
"layout": [
{"label": "L01", "matrix": [0, 1], "x": 1, "y": 0.9},
{"label": "L01", "matrix": [0, 1], "x": 1, "y": 0},
{"label": "L02", "matrix": [0, 2], "x": 0.5, "y": 2},
{"label": "L03", "matrix": [0, 3], "x": 0, "y": 3},
{"label": "L04", "matrix": [0, 4], "x": 0.5, "y": 4},
@ -229,7 +229,7 @@
},
"LAYOUT_yubitsume": {
"layout": [
{"label": "L01", "matrix": [0, 1], "x": 1, "y": 0.9},
{"label": "L01", "matrix": [0, 1], "x": 1, "y": 0},
{"label": "L02", "matrix": [0, 2], "x": 0.5, "y": 2},
{"label": "L03", "matrix": [0, 3], "x": 0, "y": 3},
{"label": "L04", "matrix": [0, 4], "x": 0.5, "y": 4},

View file

@ -1 +1,7 @@
# pragma once
#pragma once
#undef ENCODER_RESOLUTION
#undef ENCODER_RESOLUTION_RIGHT
#define ENCODER_RESOLUTION 4
#define ENCODER_RESOLUTION_RIGHT 4

View file

@ -6,44 +6,39 @@
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, \
k32, k33, k34, k35, k36, k37 \
k32, k33, k34, k35, k36, k37, \
e01, e02 \
) \
LAYOUT_klor_wrapper ( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \
k20, k21, k22, k23, k24, k32, k37, k25, k26, k27, k28, k29, \
KC_BTN1, k33, k34, k35, k36, KC_BTN4 \
k20, k21, k22, k23, k24, e01, e02, k25, k26, k27, k28, k29, \
k32, k33, k34, k35, k36, k37 \
)
#define KLOR(...) LAYOUT_3x5_3_keymap(__VA_ARGS__)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = KLOR(LAYER_QWERTY),
[_COLEMAK_DH] = KLOR(LAYER_COLEMAK_DH),
[_GAME] = KLOR(LAYER_GAME),
[_NAVIGATION] = KLOR(LAYER_NAVIGATION),
[_NUMBER] = KLOR(LAYER_NUMBER),
[_SYMBOL] = KLOR(LAYER_SYMBOL),
[_MOUSE_FUNC] = KLOR(LAYER_MOUSE_FUNC),
[_CONFIG] = KLOR(LAYER_CONFIG)
[_MOUSE_FUNC] = KLOR(LAYER_MOUSE_FUNC)
};
#if defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[_QWERTY] = { ENCODER_CCW_CW(KC_WH_U, KC_WH_D), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[_COLEMAK_DH] = { ENCODER_CCW_CW(KC_WH_U, KC_WH_D), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[_GAME] = { ENCODER_CCW_CW(KC_WH_U, KC_WH_D), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[_NAVIGATION] = { ENCODER_CCW_CW(ZOOMOUT, ZOOMIN), ENCODER_CCW_CW(___x___, ___x___) },
[_NUMBER] = { ENCODER_CCW_CW(___x___, ___x___), ENCODER_CCW_CW(KC_LEFT, KC_RGHT) },
[_NAVIGATION] = { ENCODER_CCW_CW(KC_LEFT, KC_RGHT), ENCODER_CCW_CW(REV_CFG, FWD_CFG) },
[_NUMBER] = { ENCODER_CCW_CW(___x___, ___x___), ENCODER_CCW_CW(REV_TAB, FWD_TAB) },
[_SYMBOL] = { ENCODER_CCW_CW(___x___, ___x___), ENCODER_CCW_CW(___x___, ___x___) },
[_MOUSE_FUNC] = { ENCODER_CCW_CW(KC_WH_U, KC_WH_D), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[_CONFIG] = { ENCODER_CCW_CW(RBSELYR, BASELYR), ENCODER_CCW_CW(TR_RRMD, TR_RMOD) }
[_MOUSE_FUNC] = { ENCODER_CCW_CW(KC_WH_U, KC_WH_D), ENCODER_CCW_CW(ZOOMOUT, ZOOMIN) }
};
#endif

View file

@ -6,7 +6,8 @@
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, \
k32, k33, k34, k35, k36, k37 \
k32, k33, k34, k35, k36, k37, \
e01, e02 \
) \
LAYOUT_planck_wrapper ( \
k00, k01, k02, k03, k04, KC_NO, KC_NO, k05, k06, k07, k08, k09, \
@ -18,14 +19,11 @@ LAYOUT_planck_wrapper ( \
#define PLANCK(...) LAYOUT_3x5_keymap(__VA_ARGS__)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = PLANCK(LAYER_QWERTY),
[_COLEMAK_DH] = PLANCK(LAYER_COLEMAK_DH),
[_GAME] = PLANCK(LAYER_GAME),
[_NAVIGATION] = PLANCK(LAYER_NAVIGATION),
[_NUMBER] = PLANCK(LAYER_NUMBER),
[_SYMBOL] = PLANCK(LAYER_SYMBOL),
[_MOUSE_FUNC] = PLANCK(LAYER_MOUSE_FUNC),
[_CONFIG] = PLANCK(LAYER_CONFIG)
[_MOUSE_FUNC] = PLANCK(LAYER_MOUSE_FUNC)
};

View file

@ -15,8 +15,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#define NO_ACTION_ONESHOT
#define PLOOPY_DRAGSCROLL_INVERT
#define PLOOPY_DRAGSCROLL_DIVISOR_H 25.0
#define PLOOPY_DRAGSCROLL_DIVISOR_V 20.0

View file

@ -16,23 +16,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "t4corun.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT( KC_NO )
};
static bool num_lock_state = false;
static bool scroll_lock_state = false;
void keyboard_post_init_user(void) {
num_lock_state = host_keyboard_led_state().num_lock;
scroll_lock_state = host_keyboard_led_state().scroll_lock;
}
bool led_update_user(led_t led_state) {
// when scroll lock is pressed, toggle drag scroll state
if ( scroll_lock_state != led_state.scroll_lock ) {
toggle_drag_scroll();

View file

@ -0,0 +1,93 @@
{
"keyboard_name": "Waterfowl",
"manufacturer": "CyanDuck",
"url": "",
"maintainer": "JW2586",
"usb": {
"vid": "0xFEED",
"pid": "0x9CE3",
"device_version": "0.0.1"
},
"features": {
"bootmagic": true,
"encoder": true,
"extrakey": true,
"mousekey": true,
"nkro": true,
"oled": true
},
"matrix_pins": {
"cols": ["F4", "F5", "F6", "F7", "B1"],
"rows": ["D4", "C6", "D7", "E6"]
},
"diode_direction": "COL2ROW",
"encoder": {
"rotary": [
{"pin_a": "B4", "pin_b": "B5"},
{"pin_a": "B3", "pin_b": "B2", "resolution": 2}
]
},
"split": {
"enabled": true,
"soft_serial_pin": "D2",
"transport": {
"sync": {
"modifiers": true,
"wpm": true
}
}
},
"processor": "atmega32u4",
"bootloader": "atmel-dfu",
"layouts": {
"LAYOUT": {
"layout": [
{"matrix": [0, 0], "x": 0, "y": 1},
{"matrix": [0, 1], "x": 1, "y": 0.25},
{"matrix": [0, 2], "x": 2, "y": 0},
{"matrix": [0, 3], "x": 3, "y": 0.375},
{"matrix": [0, 4], "x": 4, "y": 0.5},
{"matrix": [4, 4], "x": 9, "y": 0.5},
{"matrix": [4, 3], "x": 10, "y": 0.375},
{"matrix": [4, 2], "x": 11, "y": 0},
{"matrix": [4, 1], "x": 12, "y": 0.25},
{"matrix": [4, 0], "x": 13, "y": 1},
{"matrix": [1, 0], "x": 0, "y": 2},
{"matrix": [1, 1], "x": 1, "y": 1.25},
{"matrix": [1, 2], "x": 2, "y": 1},
{"matrix": [1, 3], "x": 3, "y": 1.375},
{"matrix": [1, 4], "x": 4, "y": 1.5},
{"matrix": [5, 4], "x": 9, "y": 1.5},
{"matrix": [5, 3], "x": 10, "y": 1.375},
{"matrix": [5, 2], "x": 11, "y": 1},
{"matrix": [5, 1], "x": 12, "y": 1.25},
{"matrix": [5, 0], "x": 13, "y": 2},
{"matrix": [2, 0], "x": 0, "y": 3},
{"matrix": [2, 1], "x": 1, "y": 2.25},
{"matrix": [2, 2], "x": 2, "y": 2},
{"matrix": [2, 3], "x": 3, "y": 2.375},
{"matrix": [2, 4], "x": 4, "y": 2.5},
{"matrix": [6, 4], "x": 9, "y": 2.5},
{"matrix": [6, 3], "x": 10, "y": 2.375},
{"matrix": [6, 2], "x": 11, "y": 2},
{"matrix": [6, 1], "x": 12, "y": 2.25},
{"matrix": [6, 0], "x": 13, "y": 3},
{"matrix": [3, 1], "x": 2.9, "y": 3.5},
{"matrix": [3, 2], "x": 3.9, "y": 3.7},
{"matrix": [3, 3], "x": 4.9, "y": 4.1},
{"matrix": [3, 4], "x": 5.5, "y": 2.5},
{"matrix": [7, 4], "x": 7.5, "y": 2.5},
{"matrix": [7, 3], "x": 8.1, "y": 4.1},
{"matrix": [7, 2], "x": 9.1, "y": 3.7}
]
}
}
}

View file

@ -1,92 +1,95 @@
layout:
qmk_keyboard: bluebell/swoop
qmk_layout: LAYOUT_split_3x5_3
qmk_keyboard: waterfowl
qmk_layout: LAYOUT
layers:
base_QWERTY:
- [Q, W, E, R, T, Y, U, I ,O, P]
- [Q, W, E, R, T, Y, U, I, O, P]
- [A, S, D, F, G, H, J, K ,L, {h: "\"", t: "'"}]
- [{h: "MOUSE", t: "Z"}, X, C, V, B, N, M, {h: "(", t: ","} , {h: ")", t: "."}, {h: "_", t: "-"}]
- {type: ghost}
- MB1
- NUM
- Shift
- {t: "Ctrl Home", type: ghost}
- {t: "Mute", type: ghost}
- Space
- NAV
- {t: Mute, type: ghost}
base_COLEMAK_DH:
- [Q, W, F, P, B, J, L, U ,Y, {h: "\"", t: "'"}]
- [A, R, S, T, G, M, N, E ,I, O]
- [{h: "MOUSE", t: "Z"}, X, C, D, V, K, H, {h: "(", t: ","} , {h: ")", t: "."}, {h: "_", t: "-"}]
- {type: ghost}
- MB1
- NUM
- Shift
- {t: "Ctrl Home", type: ghost}
- {t: "Mute", type: ghost}
- Space
- NAV
- {t: Mute, type: ghost}
base_GAME:
- [Tab, Q, W, E, R, T, "7", "8" ,"9", Esc]
- [Ctrl, A, S, D, F, G, "4", "5" ,"6", {s: "~", t: "`"}]
- [Z, X, C, V, B, Alt, "1", "2" ,"3", Combo Toggle]
- {t: Enter, type: ghost}
- [Z, X, C, V, B, Alt, "1", "2" ,"3", null]
- Enter
- Space
- Shift
- {t: "Ctrl Home", type: ghost}
- {t: "Mute", type: ghost}
- Space
- NAV
- {t: Mute, type: ghost}
NAV:
- [Esc, Home, ▲, End, Page Up, null, null, null, Caps Lock, CONFIG ]
- [null, ◄, ▼, ►, Page Down, null, Shift, Ctrl, Alt, Gui ]
- [Undo, Cut, Copy, Paste, Redo, null, App, Vol -, Vol +, Mute ]
- {t: Zoom Reset, type: ghost}
- [Esc, Home, ▲, End, Page Up, Caps Lock, App, null, null, null ]
- [null, ◄, ▼, ►, Page Down, Back Space, Shift, Ctrl, Alt, Gui ]
- [Undo, Cut, Copy, Paste, Redo, Delete, Tab, Vol -, Vol +, Mute ]
- null
- NUM
- Ent
- Enter
- {t: "Ctrl Home", type: ghost}
- {t: "Config Toggle", type: ghost}
- null
- {type: held}
- {type: ghost}
- type: held
NUM:
- [Esc, Win Snip, File Explorer, null, {h: "~", t: "`"}, null, "7", "8" ,"9", {s: "<", t: ","} ]
- [Gui, Alt, Ctrl, Shift, {h: ":", t: ";"}, "0", "4", "5" ,"6", {s: ">", t: "."}]
- [Undo, Cut, Copy, Paste, Redo, null, "1", "2" ,"3", {s: "_", t: "-"}]
- {type: ghost}
- {type: held}
- [Esc, Snip Tool, File Explorer, MOUSE Toggle, Enter, null, "7", "8" ,"9", "," ]
- [Gui, Alt, Ctrl, Shift, Tab, Back Space, "4", "5" ,"6", "."]
- [Undo, Cut, Copy, Paste, Redo, Delete, "1", "2" ,"3", "-"]
- null
- Space
- type: held
- null
- type: ghost
- {t: "Win Tab", type: ghost}
- 0
- NAV
- {t: Mute, type: ghost}
SYM:
- [null, null, "@", "$", {h: "~", t: "`"}, {h: "+", t: "="}, "#", "*", null, {h: "\"\"", t: "\""}]
- [null, {h: "{}", t: "{"}, "}", "!", {h: ":", t: ";"}, "&", "?", {h: "[]", t: "]"}, "]", {h: "''", t: "'"}]
- [null, {h: "<>", t: "<"}, ">", {h: "\\\\", t: "\\"}, {h: "||", t: "|"}, {h: "%", t: "^"}, {h: "//", t: "/"}, {h: "()", t: "("}, ")", {h: "_", t: "-"}]
- {type: ghost}
- {type: held}
- ["&", {h: "{}", t: "{"}, "}", {h: "||", t: "|"}, {h: ":", t: ";"}, Back Space, "?", {h: "[]", t: "]"}, "]", {h: "''", t: "'"}]
- [{h: "%", t: "^"}, {h: "<>", t: "<"}, ">", {h: "\\\\", t: "\\"}, "!", Delete, {h: "//", t: "/"}, {h: "()", t: "("}, ")", {h: "_", t: "-"}]
- null
- type: held
- null
- {type: held}
- {type: ghost}
- type: ghost
- type: ghost
- null
- type: held
MOUSE_FUNCTION:
- [null, Prev Song, Next Song, Play Pause, Null, null, F7, F8 ,F9, F10]
- [Gui, Alt, Ctrl, Shift, Drag Scroll, null, F4, F5 ,F6, F11]
- [{type: held}, Mouse 5, Mouse 4, Mouse 3, Sniper, null, F1, F2 ,F3, F12]
- {type: ghost}
- "Mouse 1"
- "Mouse 2"
- "Pointer DPI"
- "Sniper DPI"
- {t: Mute, type: ghost}
CONFIG:
- [Haptic Reset, Haptic Strength+, Haptic Waveform+, Haptic Feedback Toggle, Haptic Toggle, null, Nano Reboot, EEPROM Clear, Boot Loader, {type: held}]
- [Audio Click Reset, Audio Click+, Audio Click Toggle, null, Audio Toggle, null, Shift, null, null, Base Layer]
- [null, null, null, null, RGB Toggle, RGB Mode, RGB Hue, RGB Sat, RGB Vib, RGB Spd]
- {t: Base Layer, type: ghost}
- Macro Rec 1
- Macro Play 1
- Macro Play 2
- Macro Rec 2
- {t: RGB Toggle, type: ghost}
- [MOUSE Toggle, null, null, Pointer DPI, Sniper DPI, Config Toggle, F7, F8 ,F9, F10]
- [Gui, Alt, Ctrl, Shift, Drag Scroll, Next Config, F4, F5 ,F6, F11]
- [{type: held}, MB1, MB5, MB4, Sniper, Prev Config, F1, F2 ,F3, F12]
- MB1
- MB3
- MB2
- {t: "Ctrl Home", type: ghost}
- {t: "Zoom Reset", type: ghost}
- "Macro Play"
- "Macro Rec"
combos:
- { p: [22, 23], k: MB1, l: [base_QWERTY] }
- { p: [21, 23], k: DrgScr Tog, l: [base_QWERTY] }
- { p: [16, 17], k: Tab, l: [base_QWERTY] }
- { p: [12, 13], k: Enter, l: [base_QWERTY] }
- { p: [26, 27], k: Bksp, l: [base_QWERTY] }
draw_config:
small_pad: 6
- { p: [22, 23], k: MB2, l: [base_QWERTY] }
- { p: [21, 23], k: Drag Scroll, l: [base_QWERTY], a: bottom }
- { p: [33, 33], k: "Enc: MWheel", l: [base_QWERTY], a: bottom, d: false, w: 50}
- { p: [34, 34], k: "Enc: Volume", l: [base_QWERTY], a: bottom, d: false, w: 50 }
- { p: [33, 33], k: "Enc: MWheel", l: [base_COLEMAK_DH], a: bottom, d: false, w: 50}
- { p: [34, 34], k: "Enc: Volume", l: [base_COLEMAK_DH], a: bottom, d: false }
- { p: [33, 33], k: "Enc: MWheel", l: [base_GAME], a: bottom, d: false, w: 50}
- { p: [34, 34], k: "Enc: Volume", l: [base_GAME], a: bottom, d: false, w: 50 }
- { p: [33, 33], k: "Enc: ◄,►", l: [NAV], a: bottom, d: false}
- { p: [34, 34], k: "Enc: Cfg", l: [NAV], a: bottom, d: false }
- { p: [34, 34], k: "Enc: Tab", l: [NUM], a: bottom, d: false }
- { p: [33, 33], k: "Enc: MWheel", l: [MOUSE_FUNCTION], a: bottom, d: false, w: 50}
- { p: [34, 34], k: "Enc: Zoom", l: [MOUSE_FUNCTION], a: bottom, d: false }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 KiB

After

Width:  |  Height:  |  Size: 164 KiB

Before After
Before After

View file

@ -25,12 +25,16 @@
* https://docs.qmk.fm/tap_hold
* https://docs.qmk.fm/one_shot_keys
*/
#define TAP_CODE_DELAY 5 //time before tap is released
#define TAP_HOLD_CAPS_DELAY TAP_CODE_DELAY //turning down delay for caps lock so ploopy can do DPI switching
#define WAIT_DELAY 5 //custom variable to configure time between taps
#undef TAP_CODE_DELAY
#undef TAPPING_TERM
#undef QUICK_TAP_TERM
#undef ONESHOT_TAP_TOGGLE
#undef ONESHOT_TIMEOUT
#define TAP_CODE_DELAY 5
#define TAPPING_TERM 175
#define QUICK_TAP_TERM 120
#define ONESHOT_TAP_TOGGLE 3
@ -46,6 +50,9 @@
* #undef CAPS_WORD_INVERT_ON_SHIFT
*/
#if defined(CAPS_WORD_ENABLE)
# undef DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD
# undef CAPS_WORD_IDLE_TIMEOUT
# define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD
# define CAPS_WORD_IDLE_TIMEOUT 2000
#endif //CAPS_WORD_ENABLE
@ -56,12 +63,14 @@
* https://docs.qmk.fm/features/combo
*/
#if defined(COMBO_ENABLE)
# undef COMBO_ONLY_FROM_LAYER
# undef EXTRA_SHORT_COMBOS
# undef COMBO_TERM
# undef COMBO_SHOULD_TRIGGER
# define COMBO_ONLY_FROM_LAYER 0 //this will always setup combos based off of QWERTY layout
# define EXTRA_SHORT_COMBOS
# define COMBO_TERM 35
# define COMBO_MUST_TAP_PER_COMBO
# define COMBO_SHOULD_TRIGGER
#endif //COMBO_ENABLE
@ -71,6 +80,15 @@
* https://docs.qmk.fm/features/split_keyboard
*/
#if defined(SPLIT_KEYBOARD)
# undef SPLIT_TRANSPORT_MIRROR
# undef SPLIT_LAYER_STATE_ENABLE
# undef SPLIT_LED_STATE_ENABLE
# undef SPLIT_MODS_ENABLE
# undef SPLIT_OLED_ENABLE
# undef SPLIT_ACTIVITY_ENABLE
# undef SPLIT_WPM_ENABLE
# undef MASTER_RIGHT
# define SPLIT_TRANSPORT_MIRROR
# define SPLIT_LAYER_STATE_ENABLE
# define SPLIT_LED_STATE_ENABLE
@ -87,6 +105,9 @@
* https://docs.qmk.fm/features/oled_driver
*/
#if defined(OLED_ENABLE)
# undef OLED_TIMEOUT
# undef OLED_FONT_H
# define OLED_TIMEOUT 60000 //1 min
# define OLED_FONT_H "./lib/font.c"
#endif //OLED_ENABLE
@ -98,6 +119,9 @@
*/
#if defined(HAPTIC_ENABLE)
# if defined(HAPTIC_DRV2605L)
# undef DRV2605L_GREETING
# undef DRV2605L_DEFAULT_MODE
# define DRV2605L_GREETING DRV2605L_EFFECT_750_MS_ALERT_100
# define DRV2605L_DEFAULT_MODE DRV2605L_EFFECT_STRONG_CLICK_1_100
# endif //HAPTIC_DRV2605L
@ -110,9 +134,16 @@
* https://docs.qmk.fm/squeezing_avr#audio-settings
*/
#if defined(AUDIO_ENABLE)
# undef KLOR_SOUND
# undef BYE_SOUND
# undef NO_MUSIC_MODE
# undef AUDIO_CLICKY
# undef STARTUP_SONG
# undef GOODBYE_SONG
# undef DEFAULT_LAYER_SONGS
# define KLOR_SOUND W__NOTE(_DS0), W__NOTE(_DS1), H__NOTE(_DS2), H__NOTE(_DS3), Q__NOTE(_DS4), Q__NOTE(_DS5), E__NOTE(_DS6), E__NOTE(_DS7), S__NOTE(_DS8), Q__NOTE(_GS0)
# define BYE_SOUND H__NOTE(_DS4), H__NOTE(_DS3), W__NOTE(_DS1)
# define NO_MUSIC_MODE
# define AUDIO_CLICKY
# define STARTUP_SONG SONG(KLOR_SOUND)
@ -130,7 +161,20 @@
* https://docs.qmk.fm/features/rgb_matrix
*/
#if defined(RGB_MATRIX_ENABLE)
# undef RGB_MATRIX_SLEEP
# undef RGB_MATRIX_TIMEOUT
# undef RGB_MATRIX_MAXIMUM_BRIGHTNESS
# undef RGB_MATRIX_DEFAULT_HUE
# undef RGB_MATRIX_DEFAULT_SAT
# undef RGB_MATRIX_DEFAULT_VAL
# undef RGB_MATRIX_DEFAULT_SPD
# undef RGB_MATRIX_TYPING_HEATMAP_DECREASE_DELAY_MS
# undef RGB_MATRIX_TYPING_HEATMAP_SPREAD
# undef RGB_MATRIX_TYPING_HEATMAP_AREA_LIMIT
# undef RGB_MATRIX_TYPING_HEATMAP_INCREASE_STEP
# define RGB_MATRIX_SLEEP
# define RGB_MATRIX_TIMEOUT 60000 //1 min

View file

@ -1,11 +1,7 @@
#include "capsword.h"
//static bool caps_word_state = false;
bool caps_word_press_user(uint16_t keycode) {
bool caps_word_press_user (uint16_t keycode) {
switch (keycode) {
// Keycodes that continue Caps Word, with shift applied.
case KC_A ... KC_Z:
@ -22,7 +18,5 @@ bool caps_word_press_user(uint16_t keycode) {
default:
return false; // Deactivate Caps Word.
}
}

View file

@ -1,25 +1,8 @@
#include "combo.h"
bool get_combo_must_tap(uint16_t index, combo_t *combo) {
switch (index) {
case KEY_ENT:
case KEY_TAB:
return true;
default:
return false;
}
}
bool combo_should_trigger(uint16_t combo_index, combo_t *combo, uint16_t keycode, keyrecord_t *record) {
// disable all combos on config layer
if ( get_highest_layer(layer_state | default_layer_state) == _CONFIG ) return false;
bool combo_should_trigger (uint16_t combo_index, combo_t *combo, uint16_t keycode, keyrecord_t *record) {
switch (combo_index) {
case MOUSE_BUTTON1:
case MOUSE_BUTTON2:
if ( get_highest_layer(layer_state | default_layer_state) > FIRST_DEFAULT_LAYER ) {
return false;
}

View file

@ -1,21 +1,12 @@
#pragma once
#include "t4corun.h"
const uint16_t PROGMEM mou_btn1_combo[] = { KC_C, KC_V, COMBO_END };
const uint16_t PROGMEM mou_btn2_combo[] = { KC_C, KC_V, COMBO_END };
const uint16_t PROGMEM mou_drg_combo[] = { KC_X, KC_V, COMBO_END };
const uint16_t PROGMEM key_ent_combo[] = { KC_D, KC_F, COMBO_END };
const uint16_t PROGMEM key_bspc_combo[] = { KC_M, TR_COMM, COMBO_END };
const uint16_t PROGMEM key_tab_combo[] = { KC_J, KC_K, COMBO_END };
enum combos {
MOUSE_BUTTON1,
MOUSE_BUTTON2,
MOUSE_DRGTOG,
KEY_ENT,
KEY_BSPC,
KEY_TAB,
COMBO_LENGTH
};
@ -23,9 +14,6 @@ enum combos {
uint16_t COMBO_LEN = COMBO_LENGTH;
combo_t key_combos[COMBO_LENGTH] = {
[MOUSE_BUTTON1] = COMBO(mou_btn1_combo, KC_BTN1),
[MOUSE_DRGTOG] = COMBO(mou_drg_combo, TR_DRGS),
[KEY_ENT] = COMBO(key_ent_combo, KC_ENT),
[KEY_BSPC] = COMBO(key_bspc_combo, KC_BSPC),
[KEY_TAB] = COMBO(key_tab_combo, KC_TAB)
[MOUSE_BUTTON2] = COMBO(mou_btn2_combo, KC_BTN2),
[MOUSE_DRGTOG] = COMBO(mou_drg_combo, TR_DRGS)
};

View file

@ -1,41 +0,0 @@
#include "keyoverride.h"
/*
Key Override
Here we will override some shifted versions of keys
https://docs.qmk.fm/#/feature_key_overrides?id=simple-example
Intentionally did not convert all the override/autoshit tap holds to this format
- Here I could type faster and be able to hold to repeat the keycodes however
- I had tons of same finger bigrams doing trying to get ~ and :
- I didn't feel the need to be able to repeat those symbols
*/
const key_override_t delete_override = ko_make_basic(MOD_MASK_SHIFT, KC_BSPC, KC_DEL);
#if defined(HAPTIC_ENABLE)
const key_override_t hfnext_override = ko_make_with_layers(MOD_MASK_SHIFT, HF_NEXT, HF_PREV, 1<<_CONFIG);
const key_override_t hfconu_override = ko_make_with_layers(MOD_MASK_SHIFT, HF_CONU, HF_COND, 1<<_CONFIG);
#endif //HAPTIC_ENABLE
#if defined(AUDIO_ENABLE)
const key_override_t ckup_override = ko_make_with_layers(MOD_MASK_SHIFT, CK_UP, CK_DOWN, 1<<_CONFIG);
#endif //AUDIO_ENABLE
const key_override_t **key_overrides = (const key_override_t *[]) {
&delete_override,
#if defined(HAPTIC_ENABLE)
&hfnext_override,
&hfconu_override,
#endif //HAPTIC_ENABLE
#if defined(AUDIO_ENABLE)
&ckup_override,
#endif //AUDIO_ENABLE
NULL // Null terminate the array of overrides!
};

View file

@ -1,3 +0,0 @@
#pragma once
#include "t4corun.h"

View file

@ -3,8 +3,7 @@
static uint32_t luna_anim_timer = 0;
static uint8_t luna_current_frame = 0;
void render_luna(void) {
void render_luna (void) {
#if OLED_TIMEOUT > 0
// the animation prevents the normal timeout from occuring
if (last_input_activity_elapsed() > OLED_TIMEOUT && last_led_activity_elapsed() > OLED_TIMEOUT) {
@ -19,13 +18,10 @@ void render_luna(void) {
luna_anim_timer = timer_read32();
animate_luna(OLED_LUNA_COL, OLED_LUNA_LINE);
}
}
void animate_luna(uint8_t col, uint8_t line) {
uint8_t current_mod = get_mods();
uint8_t current_osm = get_oneshot_mods();
void animate_luna (uint8_t col, uint8_t line) {
uint8_t current_mods = get_mods() | get_oneshot_mods();
// Make Luna Jump when spacebar is pressed
// Only works when Luna is rendered on Master Slide
@ -48,7 +44,7 @@ void animate_luna(uint8_t col, uint8_t line) {
// Animate based on status
if (host_keyboard_led_state().caps_lock || is_caps_word_on()) {
oled_write_raw_P(bark[luna_current_frame], OLED_LUNA_ANIM_SIZE);
} else if ((current_mod | current_osm) & MOD_MASK_CTRL) {
} else if (current_mods & MOD_MASK_CTRL) {
oled_write_raw_P(sneak[luna_current_frame], OLED_LUNA_ANIM_SIZE);
} else if (get_current_wpm() <= OLED_LUNA_MIN_WALK_SPEED) {
oled_write_raw_P(sit[luna_current_frame], OLED_LUNA_ANIM_SIZE);

View file

@ -1,8 +1,6 @@
#pragma once
#include "t4corun.h"
#if defined(OLED_DISPLAY_128X64)
# define OLED_LUNA_COL 15
# define OLED_LUNA_LINE 5

View file

@ -6,7 +6,7 @@
// Shows the currently enabled Layer name
void render_default_layer_state(uint8_t col, uint8_t line, bool moveCursor) {
void render_default_layer_state (uint8_t col, uint8_t line, bool moveCursor) {
if(moveCursor) {
oled_set_cursor(col, line);
}
@ -27,7 +27,7 @@ void render_default_layer_state(uint8_t col, uint8_t line, bool moveCursor) {
// Shows the currently enabled Layer name
// This only shows the name that is enabled
void render_layer_state(uint8_t col, uint8_t line, bool moveCursor) {
void render_layer_state (uint8_t col, uint8_t line, bool moveCursor) {
if(moveCursor) {
oled_set_cursor(col, line);
}
@ -45,9 +45,6 @@ void render_layer_state(uint8_t col, uint8_t line, bool moveCursor) {
case _MOUSE_FUNC:
oled_write_P(PSTR(OLED_RENDER_LAYER_5), false);
break;
case _CONFIG:
oled_write_P(PSTR(OLED_RENDER_LAYER_6), false);
break;
default:
oled_write_P(PSTR(OLED_RENDER_LAYER_1), false);
break;
@ -57,22 +54,23 @@ void render_layer_state(uint8_t col, uint8_t line, bool moveCursor) {
// Shows the currently enabled Layer name
// Renders a list of all the layers and highlights the active one
void render_layer_state_list(uint8_t col, uint8_t line, bool moveCursor) {
void render_layer_state_list (uint8_t col, uint8_t line, bool moveCursor) {
if(moveCursor) {
oled_set_cursor(col, line);
}
oled_write_P(PSTR(OLED_RENDER_LAYER_2), get_highest_layer(layer_state) == _NAVIGATION);
oled_write_P(PSTR(OLED_RENDER_LAYER_3), get_highest_layer(layer_state) == _NUMBER);
oled_write_P(PSTR(OLED_RENDER_LAYER_4), get_highest_layer(layer_state) == _SYMBOL);
oled_write_P(PSTR(OLED_RENDER_LAYER_5), get_highest_layer(layer_state) == _MOUSE_FUNC);
oled_write_P(PSTR(OLED_RENDER_LAYER_6), get_highest_layer(layer_state) == _CONFIG);
uint8_t current_layer = get_highest_layer(layer_state);
oled_write_P(PSTR(OLED_RENDER_LAYER_2), current_layer == _NAVIGATION);
oled_write_P(PSTR(OLED_RENDER_LAYER_3), current_layer == _NUMBER);
oled_write_P(PSTR(OLED_RENDER_LAYER_4), current_layer == _SYMBOL);
oled_write_P(PSTR(OLED_RENDER_LAYER_5), current_layer == _MOUSE_FUNC);
}
// Shows the Host LED State (Num lock, caps lock , scroll lock)
void render_lock_status(uint8_t col, uint8_t line) {
void render_lock_status (uint8_t col, uint8_t line) {
oled_set_cursor(col, line);
host_keyboard_led_state().num_lock ? oled_write_P(num_on, false ) : oled_write_P(num_off, false );
host_keyboard_led_state().caps_lock || is_caps_word_on() ? oled_write_P(caps_on, false ) : oled_write_P(caps_off, false );
@ -81,59 +79,57 @@ void render_lock_status(uint8_t col, uint8_t line) {
// Indicates which modifies are enabled
void render_mod_status(uint8_t col, uint8_t line) {
uint8_t current_mod = get_mods();
uint8_t current_osm = get_oneshot_mods();
void render_mod_status (uint8_t col, uint8_t line) {
uint8_t current_mods = get_mods() | get_oneshot_mods();
// draw the top line
oled_set_cursor(col, line);
(current_mod | current_osm) & MOD_MASK_SHIFT ? oled_write_P(shift_on_upper, false) : oled_write_P(shift_off_upper, false );
current_mods & MOD_MASK_SHIFT ? oled_write_P(shift_on_upper, false) : oled_write_P(shift_off_upper, false );
oled_write_P(mod_sep, false);
(current_mod | current_osm) & MOD_MASK_CTRL ? oled_write_P(ctrl_on_upper, false ) : oled_write_P(ctrl_off_upper, false );
current_mods & MOD_MASK_CTRL ? oled_write_P(ctrl_on_upper, false ) : oled_write_P(ctrl_off_upper, false );
oled_write_P(mod_sep, false);
(current_mod | current_osm) & MOD_MASK_ALT ? oled_write_P(alt_on_upper, false ) : oled_write_P(alt_off_upper, false );
current_mods & MOD_MASK_ALT ? oled_write_P(alt_on_upper, false ) : oled_write_P(alt_off_upper, false );
oled_write_P(mod_sep, false);
(current_mod | current_osm) & MOD_MASK_GUI ? oled_write_P(gui_on_upper, false ) : oled_write_P(gui_off_upper, false );
current_mods & MOD_MASK_GUI ? oled_write_P(gui_on_upper, false ) : oled_write_P(gui_off_upper, false );
// draw the lower line
oled_set_cursor(col, line + 1);
(current_mod | current_osm) & MOD_MASK_SHIFT ? oled_write_P(shift_on_lower, false) : oled_write_P(shift_off_lower, false );
current_mods & MOD_MASK_SHIFT ? oled_write_P(shift_on_lower, false) : oled_write_P(shift_off_lower, false );
oled_write_P(mod_sep, false);
(current_mod | current_osm) & MOD_MASK_CTRL ? oled_write_P(ctrl_on_lower, false ) : oled_write_P(ctrl_off_lower, false );
current_mods & MOD_MASK_CTRL ? oled_write_P(ctrl_on_lower, false ) : oled_write_P(ctrl_off_lower, false );
oled_write_P(mod_sep, false);
(current_mod | current_osm) & MOD_MASK_ALT ? oled_write_P(alt_on_lower, false ) : oled_write_P(alt_off_lower, false );
current_mods & MOD_MASK_ALT ? oled_write_P(alt_on_lower, false ) : oled_write_P(alt_off_lower, false );
oled_write_P(mod_sep, false);
(current_mod | current_osm) & MOD_MASK_GUI ? oled_write_P(gui_on_lower, false ) : oled_write_P(gui_off_lower, false );
current_mods & MOD_MASK_GUI ? oled_write_P(gui_on_lower, false ) : oled_write_P(gui_off_lower, false );
}
// Indicates which modifies are enabled
void render_mod_status_vertical(uint8_t col, uint8_t line) {
uint8_t current_mod = get_mods();
uint8_t current_osm = get_oneshot_mods();
void render_mod_status_vertical (uint8_t col, uint8_t line) {
uint8_t current_mods = get_mods() | get_oneshot_mods();
oled_set_cursor(col,line);
(current_mod | current_osm) & MOD_MASK_SHIFT ? oled_write_P(shift_on_upper, false) : oled_write_P(shift_off_upper, false );
current_mods & MOD_MASK_SHIFT ? oled_write_P(shift_on_upper, false) : oled_write_P(shift_off_upper, false );
oled_set_cursor(col,line+1);
(current_mod | current_osm) & MOD_MASK_SHIFT ? oled_write_P(shift_on_lower, false) : oled_write_P(shift_off_lower, false );
current_mods & MOD_MASK_SHIFT ? oled_write_P(shift_on_lower, false) : oled_write_P(shift_off_lower, false );
oled_set_cursor(col,line+3);
(current_mod | current_osm) & MOD_MASK_CTRL ? oled_write_P(ctrl_on_upper, false ) : oled_write_P(ctrl_off_upper, false );
current_mods & MOD_MASK_CTRL ? oled_write_P(ctrl_on_upper, false ) : oled_write_P(ctrl_off_upper, false );
oled_set_cursor(col,line+4);
(current_mod | current_osm) & MOD_MASK_CTRL ? oled_write_P(ctrl_on_lower, false ) : oled_write_P(ctrl_off_lower, false );
current_mods & MOD_MASK_CTRL ? oled_write_P(ctrl_on_lower, false ) : oled_write_P(ctrl_off_lower, false );
oled_set_cursor(col,line+6);
(current_mod | current_osm) & MOD_MASK_ALT ? oled_write_P(alt_on_upper, false ) : oled_write_P(alt_off_upper, false );
current_mods & MOD_MASK_ALT ? oled_write_P(alt_on_upper, false ) : oled_write_P(alt_off_upper, false );
oled_set_cursor(col,line+7);
(current_mod | current_osm) & MOD_MASK_ALT ? oled_write_P(alt_on_lower, false ) : oled_write_P(alt_off_lower, false );
current_mods & MOD_MASK_ALT ? oled_write_P(alt_on_lower, false ) : oled_write_P(alt_off_lower, false );
oled_set_cursor(col,line+9);
(current_mod | current_osm) & MOD_MASK_GUI ? oled_write_P(gui_on_upper, false ) : oled_write_P(gui_off_upper, false );
current_mods & MOD_MASK_GUI ? oled_write_P(gui_on_upper, false ) : oled_write_P(gui_off_upper, false );
oled_set_cursor(col,line+10);
(current_mod | current_osm) & MOD_MASK_GUI ? oled_write_P(gui_on_lower, false ) : oled_write_P(gui_off_lower, false );
current_mods & MOD_MASK_GUI ? oled_write_P(gui_on_lower, false ) : oled_write_P(gui_off_lower, false );
}
void render_feature_status(uint8_t col, uint8_t line) {
void render_feature_status (uint8_t col, uint8_t line) {
oled_set_cursor(col,line);
#if defined(RGB_MATRIX_ENABLE)
rgb_matrix_is_enabled() ? oled_write_P(rgb_matrix_on, false) : oled_write_P(rgb_matrix_off, false);
@ -156,18 +152,15 @@ void render_feature_status(uint8_t col, uint8_t line) {
#endif //HAPTIC_ENABLE
}
void render_klor_face_small(uint8_t col, uint8_t line) {
void render_klor_face_small (uint8_t col, uint8_t line) {
oled_set_cursor(col,line);
oled_write_P(klor_small_face_1, false);
oled_set_cursor(col,line+1);
oled_write_P(klor_small_face_2, false);
}
void render_oled_32x128(void) {
void render_oled_32x128 (void) {
//process_record_user is only processed on master side
//split side OLED does not respond to key presses custom behaviors
if (is_keyboard_master()) {
@ -184,7 +177,7 @@ void render_oled_32x128(void) {
// 21 x 8
void render_oled_128x64(void) {
void render_oled_128x64 (void) {
if (is_keyboard_master()) {
/*
@ -197,7 +190,6 @@ base lyr: current lyr
-------------- xxxxx
NCS xx xx xx xxxxx
*/
render_default_layer_state(0,0, true);
render_layer_state(0,0, false);
@ -219,9 +211,8 @@ base lyr: current lyr
}
// Coordinate the OLED rendering
bool oled_task_user(void) {
bool oled_task_user (void) {
#if defined(OLED_DISPLAY_128X64)
render_oled_128x64();
#else
@ -230,7 +221,7 @@ bool oled_task_user(void) {
return false;
}
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
oled_rotation_t oled_init_user (oled_rotation_t rotation) {
#if defined(OLED_DISPLAY_128X64)
//OLED_ROTATION_180 for KLOR
return OLED_ROTATION_180;

View file

@ -12,7 +12,6 @@
# define OLED_RENDER_LAYER_3 "Number "
# define OLED_RENDER_LAYER_4 "Symbol "
# define OLED_RENDER_LAYER_5 "Mouse+Func"
# define OLED_RENDER_LAYER_6 "Config "
#else
//128x32 are ? x 5 char wide
# define OLED_RENDER_DEFAULT_LAYER1 "Qwrty"
@ -24,21 +23,20 @@
# define OLED_RENDER_LAYER_3 " Num "
# define OLED_RENDER_LAYER_4 " Sym "
# define OLED_RENDER_LAYER_5 " MFn "
# define OLED_RENDER_LAYER_6 " Cfg "
#endif
void render_oled_128x64(void);
void render_oled_32x128(void);
void render_oled_128x64 (void);
void render_oled_32x128 (void);
void render_default_layer_state(uint8_t col, uint8_t line, bool moveCursor);
void render_layer_state(uint8_t col, uint8_t line, bool moveCursor);
void render_layer_state_list(uint8_t col, uint8_t line, bool moveCursor);
void render_default_layer_state (uint8_t col, uint8_t line, bool moveCursor);
void render_layer_state (uint8_t col, uint8_t line, bool moveCursor);
void render_layer_state_list (uint8_t col, uint8_t line, bool moveCursor);
void render_mod_status(uint8_t col, uint8_t line);
void render_mod_status_vertical(uint8_t col, uint8_t line);
void render_keylock_status(uint8_t col, uint8_t line);
void render_mod_status (uint8_t col, uint8_t line);
void render_mod_status_vertical (uint8_t col, uint8_t line);
void render_keylock_status (uint8_t col, uint8_t line);
void render_klor_face_small(uint8_t col, uint8_t line);
void render_klor_face_small (uint8_t col, uint8_t line);
static const char PROGMEM scroll_off[] = {0xC0, 0};
static const char PROGMEM scroll_on[] = {0xC1, 0};

View file

@ -1,49 +1,39 @@
#include "taphold.h"
void double_tap(uint16_t key, uint32_t ms) {
void double_tap( uint16_t key, uint32_t ms) {
tap_code16(key);
wait_ms(ms);
tap_code16(key);
}
void insert_brackets(uint16_t left, uint16_t right, uint32_t ms) {
void insert_brackets (uint16_t left, uint16_t right, uint32_t ms) {
tap_code16(left);
wait_ms(ms);
tap_code16(right);
wait_ms(ms);
tap_code16(KC_LEFT);
}
bool process_tap_hold_key(keyrecord_t* record, uint16_t tap_keycode, uint16_t hold_keycode, int mode) {
bool process_tap_hold_key (keyrecord_t* record, uint16_t tap_keycode, uint16_t hold_keycode, int mode) {
if (record->tap.count > 0) { // Key is being tapped
// register on press, unregister on release
record->event.pressed ? register_code16(tap_keycode) : unregister_code16(tap_keycode);
} else { // Key is being held
} else { // Key is being hel
switch (mode) {
case HOLD_BRACKETS:
record->event.pressed ? insert_brackets(tap_keycode, hold_keycode, WAIT_DELAY) : 0;
record->event.pressed ? insert_brackets(tap_keycode, hold_keycode, TAP_CODE_DELAY) : 0;
break;
case HOLD_DOUBLETP:
record->event.pressed ? double_tap(tap_keycode, WAIT_DELAY) : 0;
record->event.pressed ? double_tap(tap_keycode, TAP_CODE_DELAY) : 0;
break;
default:
record->event.pressed ? register_code16(hold_keycode) : unregister_code16(hold_keycode);
break;
}
}
return false;
}

View file

@ -6,7 +6,7 @@
#define HOLD_DOUBLETP 1
#define HOLD_BRACKETS 2
void single_tap(uint16_t key);
void double_tap(uint16_t key, uint32_t ms);
void insert_brackets(uint16_t left, uint16_t right, uint32_t ms);
bool process_tap_hold_key(keyrecord_t* record, uint16_t tap_keycode, uint16_t hold_keycode, int mode);
void single_tap (uint16_t key);
void double_tap (uint16_t key, uint32_t ms);
void insert_brackets (uint16_t left, uint16_t right, uint32_t ms);
bool process_tap_hold_key (keyrecord_t* record, uint16_t tap_keycode, uint16_t hold_keycode, int mode);

View file

@ -31,11 +31,10 @@ AUDIO_ENABLE ?= no
WPM_ENABLE ?= yes
# qmk features we will force as these are critical for my workflow
EXTRAKEY_ENABLE ?= yes
EXTRAKEY_ENABLE = yes
MOUSEKEY_ENABLE = yes
CAPS_WORD_ENABLE ?= yes
MOUSEKEY_ENABLE ?= yes
COMBO_ENABLE ?= yes
KEY_OVERRIDE_ENABLE ?= yes
# ---------------------------------------------------------
@ -52,10 +51,6 @@ ifeq ($(strip $(COMBO_ENABLE)), yes)
INTROSPECTION_KEYMAP_C += features/combo.c
endif
ifeq ($(strip $(KEY_OVERRIDE_ENABLE)), yes)
SRC += features/keyoverride.c
endif
ifeq ($(strip $(CAPS_WORD_ENABLE)), yes)
SRC += features/capsword.c
endif

View file

@ -1,9 +1,19 @@
#include "t4corun.h"
// Keeps track of base layer so we can make one key to cycle through them
// instead of making a key for each one */
// Keeps track of base layer so only one key is needed
// to cycle through them vs making three individual ones
static uint8_t current_base_layer = FIRST_DEFAULT_LAYER;
// keep track of current mods to override existing keys
static uint8_t current_mods;
// enables encoder to handle alt/ctrl tab and ctrl scroll wheel
static bool hold_forward_active = false;
static bool hold_reverse_active = false;
static uint16_t hold_mod_timer = 0;
#if defined(WPM_ENABLE)
// Luna Pet Variables
static bool isJumping = false;
static bool showedJump = true;
@ -13,8 +23,8 @@ bool isLunaJumping(void) { return isJumping; }
bool isJumpShown(void) { return showedJump; }
// Allows the OLED code to clear the space bar status when render is complete
void setLunaJumped(void) { showedJump = true;}
void setLunaJumped(void) { showedJump = true; }
#endif // WPM_ENABLE
// Hold Navigation and Number to get Symbol
@ -22,46 +32,49 @@ layer_state_t layer_state_set_user(layer_state_t state) {
return update_tri_layer_state(state, _NAVIGATION, _NUMBER, _SYMBOL);
}
// Customize behavior for existing keycodes or create new ones
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
// helper function to adjust default layer
void set_default_layer(bool forward) {
current_base_layer = forward ?
(current_base_layer + 1) % NUM_DEFAULT_LAYERS :
(current_base_layer - 1) % NUM_DEFAULT_LAYERS;
set_single_persistent_default_layer(current_base_layer);
}
switch (keycode) {
// use the host state status to boot the Ploopy Nano
// will effectively turn on num lock/caps lock/scroll lock then back off
case PN_BOOT:
if (record->event.pressed) {
// helper function to put ploopy nano into bootloader
// my ploopy nano will reset when num/caps/scroll lock is enabled
void reset_ploopynano(void) {
// turn on all three host states
if(!host_keyboard_led_state().num_lock) { tap_code(KC_NUM); }
if(!host_keyboard_led_state().caps_lock) { tap_code(KC_CAPS); }
if(!host_keyboard_led_state().scroll_lock) { tap_code(KC_SCRL); }
} else {
if(host_keyboard_led_state().num_lock) { tap_code(KC_NUM); }
if(host_keyboard_led_state().caps_lock) { tap_code(KC_CAPS); }
if(host_keyboard_led_state().scroll_lock) { tap_code(KC_SCRL); }
}
return false;
// then turn them off
tap_code(KC_NUM);
tap_code(KC_CAPS);
tap_code(KC_SCRL);
}
// Customize behavior for existing keycodes or create new ones
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
current_mods = get_mods() | get_oneshot_mods();
switch (keycode) {
// makes scroll lock a hold instead of toggle
// enables momentary drag scroll on ploopy nano
case KC_SCRL:
if (record->event.pressed) {
tap_code(KC_SCRL);
} else {
tap_code(KC_SCRL);
}
record->event.pressed ? tap_code(KC_SCRL) : tap_code(KC_SCRL);
return false;
// makes num lock a hold instead of toggle
// prevents accidental ploopy nano going into bootloader
case KC_NUM:
if (record->event.pressed) {
tap_code(KC_NUM);
} else {
tap_code(KC_NUM);
}
record->event.pressed ? tap_code(KC_NUM) : tap_code(KC_NUM);
return false;
// controls luna pet OLED animation
#if defined(WPM_ENABLE)
case KC_SPC:
if (record->event.pressed) {
isJumping = true;
@ -71,25 +84,130 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
isJumping = false;
}
break;
#endif // WPM_ENABLE
case BASELYR:
// turn encoder for tab and shift tab
// hold alt or ctrl while turning for window / tab switching
case FWD_TAB:
case REV_TAB:
if (record->event.pressed) {
current_base_layer = (current_base_layer + 1) % NUM_DEFAULT_LAYERS;
set_single_persistent_default_layer(current_base_layer);
if (keycode == FWD_TAB && !hold_forward_active) {
hold_forward_active = true;
hold_reverse_active = false;
unregister_mods(MOD_MASK_SHIFT);
}
if (keycode == REV_TAB && !hold_reverse_active) {
hold_forward_active = false;
hold_reverse_active = true;
register_mods(MOD_MASK_SHIFT);
}
hold_mod_timer = timer_read();
register_code(KC_TAB);
} else {
unregister_code(KC_TAB);
}
return false;
case RBSELYR:
// turn encoder for mouse wheel zoom
case ZOOMIN:
case ZOOMOUT:
if (record->event.pressed) {
current_base_layer = (current_base_layer - 1) % NUM_DEFAULT_LAYERS;
set_single_persistent_default_layer(current_base_layer);
if (!hold_forward_active) {
hold_forward_active = true;
register_mods(MOD_MASK_CTRL);
}
hold_mod_timer = timer_read();
keycode == ZOOMIN ? register_code(KC_WH_U) : register_code(KC_WH_D);
} else {
keycode == ZOOMIN ? unregister_code(KC_WH_U) : unregister_code(KC_WH_D);
}
return false;
// turn encoder while holding mod combinations to adjust features
// e.g. RGB settings, haptic frequency, click frequency, base layer
case FWD_CFG:
case REV_CFG:
if (record->event.pressed) {
if (!hold_forward_active) {
hold_forward_active = true;
}
hold_mod_timer = timer_read();
switch (current_mods) {
#if defined(RGB_MATRIX_ENABLE)
case MOD_BIT(KC_LSFT):
keycode == FWD_CFG ? rgb_matrix_increase_hue() : rgb_matrix_decrease_hue();
break;
case MOD_BIT(KC_LCTL):
keycode == FWD_CFG ? rgb_matrix_increase_sat() : rgb_matrix_decrease_sat();
break;
case MOD_BIT(KC_LALT):
keycode == FWD_CFG ? rgb_matrix_increase_val() : rgb_matrix_decrease_val();
break;
case MOD_BIT(KC_LGUI):
keycode == FWD_CFG ? rgb_matrix_increase_speed() : rgb_matrix_decrease_speed();
break;
case MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL):
keycode == FWD_CFG ? rgb_matrix_step() : rgb_matrix_step_reverse();
break;
#endif //RGB_MATRIX_ENABLE
#if defined(HAPTIC_ENABLE)
case MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT):
keycode == FWD_CFG ? haptic_mode_increase() : haptic_mode_decrease();
break;
#endif //HAPTIC_ENABLE
#if defined(AUDIO_ENABLE)
case MOD_BIT(KC_LALT) | MOD_BIT(KC_LGUI):
keycode == FWD_CFG ? clicky_freq_up() : clicky_freq_down();
break;
#endif //AUDIO_ENABLE
default:
keycode == FWD_CFG ? set_default_layer(true) : set_default_layer(false);
break;
}
}
return false;
// press key while holding mod combinations to toggle features or enter bootloader
case TOG_CFG:
if (record->event.pressed) {
switch (current_mods) {
case MOD_BIT(KC_LSFT):
reset_keyboard();
break;
case MOD_BIT(KC_LCTL):
reset_ploopynano();
break;
#if defined(RGB_MATRIX_ENABLE)
case MOD_BIT(KC_LALT):
rgb_matrix_toggle();
break;
#endif //RGB_MATRIX_ENABLE
#if defined(COMBO_ENABLE)
case MOD_BIT(KC_LGUI):
combo_toggle();
break;
#endif //COMBO_ENABLE
#if defined(HAPTIC_ENABLE)
case MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL):
haptic_toggle();
break;
#endif //HAPTIC_ENABLE
#if defined(AUDIO_ENABLE)
case MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT):
is_audio_on() ? audio_off(): audio_on();
break;
case MOD_BIT(KC_LALT) | MOD_BIT(KC_LGUI):
clicky_toggle();
break;
#endif //AUDIO_ENABLE
default:
set_default_layer(true);
break;
}
}
unregister_mods(MOD_MASK_CSAG);
return false;
//https://docs.qmk.fm/#/mod_tap?id=changing-both-tasp-and-hold
//https://getreuer.info/posts/keyboards/triggers/index.html#tap-vs.-long-press
@ -141,3 +259,14 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
// let QMK process the normal behavior if not handled above
return true;
}
void matrix_scan_user(void) {
// timer for the hold mods
if (hold_forward_active || hold_reverse_active) {
if (timer_elapsed(hold_mod_timer) > HOLD_MOD_TIMEOUT) {
unregister_mods(MOD_MASK_CSAG);
hold_forward_active = false;
hold_reverse_active = false;
}
}
}

View file

@ -2,9 +2,16 @@
#include QMK_KEYBOARD_H
#include "features/taphold.h"
void set_default_layer(bool forward);
void reset_ploopynano(void);
#if defined(WPM_ENABLE)
bool isLunaJumping(void);
bool isJumpShown(void);
void setLunaJumped(void);
#endif // WPM_ENABLE
#define HOLD_MOD_TIMEOUT 1000
// put the default base layers first
enum layers {
@ -15,8 +22,7 @@ enum layers {
_NAVIGATION,
_NUMBER,
_SYMBOL,
_MOUSE_FUNC,
_CONFIG
_MOUSE_FUNC
};
// start at the second layer
@ -47,10 +53,17 @@ enum keycodes {
TH_SCLN,
TH_QUOT,
PN_BOOT,
FWD_TAB, // turn encoder for tab and shift tab
REV_TAB, // hold alt or ctrl while turning for window / tab switching
ZOOMIN, // turn encoder for mouse wheel zoom
ZOOMOUT,
FWD_CFG, // turn encoder while holding mod combinations to adjust features
REV_CFG, // e.g. RGB settings, haptic frequency, click frequency, base layer
TOG_CFG // press key while holding mod combinations to toggle features or enter bootloader
BASELYR,
RBSELYR
};
#define ___x___ KC_NO
@ -70,15 +83,15 @@ enum keycodes {
#define SC_REDO LCTL(KC_Y)
#define SC_SNIP LGUI(LSFT(KC_S))
#define SC_FILE LGUI(KC_E)
#define SC_WIN LGUI(KC_TAB)
// Zoom for encoders
#define ZOOMIN LCTL(KC_WH_U)
#define ZOOMOUT LCTL(KC_WH_D)
// Encoders
#define ZOOMRST LCTL(KC_0)
#define SCR_TOP LCTL(KC_HOME)
/*
- Any keycodes with prefix TR has behavior dependent on if the feature is enabled.
- If the feature is disabled then the key is just the normal key
- Any keycodes with prefix TR has behavior dependent on if the feature is enabled.
- We will only define things that are used across different layers. Entire layers are turned off in the keymap
*/
@ -130,66 +143,6 @@ enum keycodes {
#endif //KEYBOARD_bastardkb_charybdis_3x5
#if defined(DYNAMIC_MACRO_ENABLE)
# define TR_DMR1 DM_REC1
# define TR_DMP1 DM_PLY1
# define TR_DMR2 DM_REC2
# define TR_DMP2 DM_PLY2
#else
# define TR_DMR1 ___x___
# define TR_DMP1 ___x___
# define TR_DMR2 ___x___
# define TR_DMP2 ___x___
#endif //DYNAMIC_MACRO_ENABLE
#if defined(RGB_MATRIX_ENABLE) || defined(RGBLIGHT_ENABLE)
# define TR_RHUI RGB_HUI
# define TR_RSAI RGB_SAI
# define TR_RVAI RGB_VAI
# define TR_RSPI RGB_SPI
# define TR_RTOG RGB_TOG
# define TR_RMOD RGB_MOD
# define TR_RRMD RGB_RMOD
#else
# define TR_RHUI ___x___
# define TR_RSAI ___x___
# define TR_RVAI ___x___
# define TR_RSPI ___x___
# define TR_RTOG ___x___
# define TR_RMOD ___x___
# define TR_RRMD ___x___
#endif //RGB_MATRIX_ENABLE || RGBLIGHT_ENABLE
#if defined(HAPTIC_ENABLE)
# define TR_HTOG HF_TOGG
# define TR_HFBK HF_FDBK
# define TR_HNXT HF_NEXT
# define TR_HCNU HF_CONU
# define TR_HRST HF_RST
#else
# define TR_HTOG ___x___
# define TR_HFBK ___x___
# define TR_HNXT ___x___
# define TR_HCNU ___x___
# define TR_HRST ___x___
#endif //HAPTIC_ENABLe
#if defined(AUDIO_ENABLE)
# define TR_ATOG AU_TOGG
# define TR_CTOG CK_TOGG
# define TR_CKUP CK_UP
# define TR_CRST CK_RST
#else
# define TR_ATOG ___x___
# define TR_CTOG ___x___
# define TR_CKUP ___x___
# define TR_CRST ___x___
#endif //AUDIO_ENABLE
#define _NONE_3__________________ ___x___, ___x___, ___x___
#define _NONE_5____________________________________ ___x___, ___x___, ___x___, ___x___, ___x___
#define _GACS_MODS________________________ TR_LGUI, TR_LALT, TR_LCTL, TR_LSFT
@ -197,7 +150,7 @@ enum keycodes {
#define _UCCPR_L___________________________________ SC_UNDO, SC_CUT, SC_COPY, SC_PAST, SC_REDO
#define _BASE_L4_________________ KC_BTN1, NUM, TR_LSFT
#define _BASE_R4_________________ KC_SPC, NAV, KC_MUTE
#define _BASE_R4_________________ KC_SPC, NAV, ___x___
#define _LAYER_TRANS_____________ ___x___, _______, ___x___
@ -207,53 +160,53 @@ enum keycodes {
KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \
KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, TR_QUOT, \
MF_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, TR_COMM, TR_DOT, TR_MINS, \
_BASE_L4_________________, _BASE_R4_________________
_BASE_L4_________________, _BASE_R4_________________, \
SCR_TOP, KC_MUTE
#define LAYER_COLEMAK_DH \
KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, TR_QUOT, \
KC_A, KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_O, \
MF_Z, KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, TR_COMM, TR_DOT, TR_MINS, \
_BASE_L4_________________, _BASE_R4_________________
_BASE_L4_________________, _BASE_R4_________________, \
SCR_TOP, KC_MUTE
#define LAYER_GAME \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_7, KC_8, KC_9, KC_ESC, \
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_4, KC_5, KC_6, KC_GRV, \
KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LALT, KC_1, KC_2, KC_3, CM_TOGG, \
KC_ENT, KC_SPC, KC_LSFT, _BASE_R4_________________
KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LALT, KC_1, KC_2, KC_3, ___x___, \
KC_ENT, KC_SPC, KC_LSFT, _BASE_R4_________________, \
SCR_TOP, KC_MUTE
#define LAYER_NAVIGATION \
KC_ESC, KC_HOME, KC_UP, KC_END, KC_PGUP, ___x___, ___x___, ___x___, KC_CAPS, CONFIG, \
___x___, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, ___x___, _SCAG_MODS________________________, \
_UCCPR_L___________________________________, ___x___, KC_APP, KC_VOLD, KC_VOLU, KC_MUTE, \
ZOOMRST, NUM, KC_ENT, _LAYER_TRANS_____________
KC_ESC, KC_HOME, KC_UP, KC_END, KC_PGUP, ___x___, KC_APP, ___x___, KC_CAPS, MOU_FUN, \
___x___, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_BSPC, _SCAG_MODS________________________, \
_UCCPR_L___________________________________, KC_DEL, KC_TAB, KC_VOLD, KC_VOLU, KC_MUTE, \
___x___, NUM, KC_ENT, _LAYER_TRANS_____________, \
SCR_TOP, TOG_CFG
#define LAYER_NUMBER \
KC_ESC, SC_SNIP, SC_FILE, MOU_FUN, TR_GRV, ___x___, KC_7, KC_8, KC_9, KC_COMM, \
_GACS_MODS________________________, TR_SCLN, KC_0, KC_4, KC_5, KC_6, KC_DOT, \
_UCCPR_L___________________________________, ___x___, KC_1, KC_2, KC_3, KC_MINS, \
_LAYER_TRANS_____________, _BASE_R4_________________
KC_ESC, SC_SNIP, SC_FILE, ___x___, ___x___, KC_TAB, KC_7, KC_8, KC_9, KC_COMM, \
_GACS_MODS________________________, ___x___, KC_BSPC, KC_4, KC_5, KC_6, KC_DOT, \
_UCCPR_L___________________________________, KC_DEL, KC_1, KC_2, KC_3, KC_MINS, \
_LAYER_TRANS_____________, KC_0, NAV, ___x___, \
___x___, SC_WIN
#define LAYER_SYMBOL \
___x___, ___x___, KC_AT, KC_DLR, TR_GRV, TR_EQL, KC_HASH, KC_ASTR, ___x___, TR_DQUO, \
___x___, TR_LCBR, KC_RCBR, KC_EXLM, TR_SCLN, KC_AMPR, KC_QUES, TR_LBRC, KC_RBRC, TR_SQUO, \
___x___, TR_LABK, KC_RABK, TR_BSLS, TR_PIPE, TR_PERC, TR_SLSH, TR_LPRN, KC_RPRN, TR_MINS, \
_LAYER_TRANS_____________, _LAYER_TRANS_____________
KC_AMPR, TR_LCBR, KC_RCBR, TR_PIPE, TR_SCLN, KC_BSPC, KC_QUES, TR_LBRC, KC_RBRC, TR_SQUO, \
TR_PERC, TR_LABK, KC_RABK, TR_BSLS, KC_EXLM, KC_DEL, TR_SLSH, TR_LPRN, KC_RPRN, TR_MINS, \
_LAYER_TRANS_____________, _LAYER_TRANS_____________, \
___x___, ___x___
#define LAYER_MOUSE_FUNC \
MOU_FUN, KC_MPRV, KC_MNXT, KC_MPLY, ___x___, ___x___, KC_F7, KC_F8, KC_F9, KC_F10, \
_GACS_MODS________________________, TR_DRGS, ___x___, KC_F4, KC_F5, KC_F6, KC_F11, \
_______, ___x___, KC_BTN5, KC_BTN4, TR_SNIP, ___x___, KC_F1, KC_F2, KC_F3, KC_F12, \
KC_BTN1, KC_BTN2, KC_BTN3, TR_PDPI, TR_SDPI, ___x___
#define LAYER_CONFIG \
TR_HRST, TR_HCNU, TR_HNXT, TR_HFBK, TR_HTOG, ___x___, PN_BOOT, EE_CLR, QK_BOOT, _______, \
TR_CRST, TR_CKUP, TR_CTOG, ___x___, TR_ATOG, ___x___, TR_LSFT, ___x___, ___x___, BASELYR, \
___x___, ___x___, ___x___, ___x___, TR_RTOG, TR_RMOD, TR_RHUI, TR_RSAI, TR_RVAI, TR_RSPI, \
BASELYR, TR_DMR1, TR_DMP1, TR_DMP2, TR_DMR2, TR_RTOG
MOU_FUN, ___x___, ___x___, TR_PDPI, TR_SDPI, TOG_CFG, KC_F7, KC_F8, KC_F9, KC_F10, \
_GACS_MODS________________________, TR_DRGS, FWD_CFG, KC_F4, KC_F5, KC_F6, KC_F11, \
_______, KC_BTN1, KC_BTN5, KC_BTN4, TR_SNIP, REV_CFG, KC_F1, KC_F2, KC_F3, KC_F12, \
KC_BTN1, KC_BTN3, KC_BTN2, DM_PLY1, DM_REC1, ___x___, \
SCR_TOP, ZOOMRST