1
0
Fork 0

Userspace: muppetjones (#1) (#13461)

* Userspace: muppetjones (#1)

Add and update lily58 to work with userspace
Add and update kyria keymap to work with userspace
Add and update planck keymap with userspace
Add etchamouse code and docs to userpace
Add userspace
Update mouse encoder for smoother movement.
Encoder + mouse
Added casemodes by andrewjrae

* Rollback lily58 state reader and add missing GPL

* Apply suggestions from code review

Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Joel Challis <git@zvecr.com>

* fix lily58 keymap

* Updates to user and lily for muppetjones.

Updated parameters for etchamouse for smoother mouse movement. Updated lily keymap and userspace to actually work together.

* Update keyboards/lily58/keymaps/muppetjones/config.h

Co-authored-by: Drashna Jaelre <drashna@live.com>

* Updated keymaps and userspace

* Little more cleanup.

* Update keyboards/lily58/keymaps/muppetjones/rules.mk

Co-authored-by: Ryan <fauxpark@gmail.com>

* Rollback accidental libchibios update

* Apply suggestions from code review

Co-authored-by: Drashna Jaelre <drashna@live.com>

* Update kyria keymap

* Move kyria keymap to splitkb/kyria

* Update planck keymap

* Remove all changes to keyboards/lily58/lib/layer_state_reader.c

* Update lily58 keymap

* Recommended change

* Update keymap readme

* Update kyria keymap and userspace

* Apply suggestions from code review

Co-authored-by: Drashna Jaelre <drashna@live.com>

* Renamed users/muppetjones/README.md to lc

* Update keyboards/lily58/keymaps/muppetjones/config.h

Co-authored-by: Drashna Jaelre <drashna@live.com>

Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Joel Challis <git@zvecr.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
This commit is contained in:
Stephen J Bush 2022-08-03 12:23:17 -05:00 committed by GitHub
parent 5f6cf24294
commit df8a538489
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 3046 additions and 0 deletions

View file

@ -0,0 +1,73 @@
# Tap Dance Layers
This feature creates a key that changes the current layer via tap dance. By
default, this assumes that you have the following layers defined:
- `_ADJUST`
- `_LOWER`
- `_RAISE`
- `_MOUSE`
And sets up the following tap dance:
| Count | Action | Layer |
| ----- | ------ | --------- |
| 1x | hold | `_ADJUST` |
| 1x | tap | `_MOUSE` |
| 2x | tap | `_LOWER` |
| 3x | tap | `_RAISE` |
| 4x | tap | `_ADJUST` |
## Usage
> NOTE: If you use other tap-dance functions, you may require additonal setup.
1. Copy `features/dancelayers.{c,h}` into your keymap or userspace directory.
2. Add the following to your `rules.mk`
```
TAP_DANCE_ENABLE = yes
SRC += ./features/dancelayers.c
```
3. Add the following to your `keymap.c`:
```
#ifdef TAP_DANCE_ENABLE
# include "features/dancelayers.h"
# define TD_LAYR TD(TD_LAYERS)
#else
# define TD_LAYR XXXXXXX
#endif
```
4. Add `TD_LYR` to your keymap.
## Functions and Enumerations
The following functions are available for use:
- `cur_dance`
The following tap dance enumerations are defined:
- `TD_1X_HOLD`
- `TD_1X_TAP`
- `TD_2X_TAP`
- `TD_3X_TAP`
- `TD_4X_TAP`
## Overriding the Defaults
If you want to define different layers to tap dance actions, you'll need to
define two additional functions in your `keymap.c`:
- `td_lyr_finished`
- `td_lyr_reset`
Both of these functions are necessary and require a certain pattern for each
layer. "Tap" actions are handled in `*_finished` while "hold" actions are
resolved in `*_finished` and `*_reset`.
See the implementation in `dancelayers.c` for an example.

View file

@ -0,0 +1,69 @@
# Etch-a-Mouse
Encoder-based mouse movement with acceleration!
## Usage
- Add the following to your rules.mk
```
ENCODER_ENABLE = yes
POINTING_DEVICE_ENABLE = yes
```
- Add the following block to your keymap.c
```
#ifdef ENCODER_ENABLE
void encoder_update_user(uint8_t index, bool clockwise) {
# ifdef POINTING_DEVICE_ENABLE
encoder_update_mouse(index, clockwise);
# endif
return;
#endif
```
> NOTE: I use the mousekey keycodes to add button one and two into my keymap.
## How It Works
> This implementation uses the pointing device library, but it reuses several
> of the same parameters from the mouse key acceleration.
> The PD library is very light weight, but it does not animate cursor movement.
> tl;dr: The mouse movement will not be smooth!
The acceleration has four parts:
```
initial speed + (delta * time * count)
```
1. **Initial Speed**. Uses the `MOUSEKEY_INITIAL_SPEED` parameter.
2. **Delta**. Uses the `MOUSEKEY_MOVE_DELTA` parameter.
3. **Time**. The faster you turn, the faster you move.
Subtract the time elapsed since the last actuation from a tapping term,
defined by `TAPPING_TERM_MOUSE_ENCODER`†, with a minimum value of 1.
4. **Count**. The more you turn, the faster you move.
Count of the total number of actuations. This value will decay over time.
† _I probably could and will eventually use `TAPPING_TERM`, but I did not want
to mess up my tap mods while experimenting with acceleration._
## Diagonal Movement
Counting the number of actuations for a given axis allows us to persist movement
along a given axis to give us some diagonal movement when moving both axes,
which also helps with the acceleration a bit and makes the movement less blocky.
## Time-based Decay (a.k.a., Deceleration)
Originally, the actuation count zeroed out once the tapping term elapsed, but
this made the movement very choppy. Instead, the count will degrade on every
refresh after the tapping term has been exceeded; unfortunately, a refresh only
occurs on an actuation on either axis, so once the time elapsed exceeds the
persistence term, the count is cleared, which also removes any movement in that
axis.

View file

@ -0,0 +1,60 @@
# Dynamic Underglow Lighting Per-Layer
This bit of code allows you to define layer lighting that respects your current eeprom settings, e.g., brightness. It does this by storing the base state rgb
## Setup
1. Enable RGB underglow in your `rules.mk`
```
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
```
2. (Optional) Add RGB configuration to your `config.h`
```
#ifdef RGBLIGHT_ENABLE
// # define RGBLIGHT_ANIMATIONS
# define RGBLIGHT_HUE_STEP 8
# define RGBLIGHT_SAT_STEP 16
# define RGBLIGHT_VAL_STEP 16
# define RGBLIGHT_LIMIT_VAL 150
# define RGBLIGHT_SLEEP
// # define RGBLIGHT_LAYERS
#endif
```
3. Add `set_layer_hsv` function. This is where you define your layer-specific colors by setting the HSV properties on the `layer_color` pointer. This example uses the QMK RGB configuration parameters to keep the layer colors offset based on the current EEPROM HSV.
> NOTE: The HSV values should be between 0 and 255, but setting the modulus on saturation causes the lights to go white on my board. I _think_ this is due to overflow, but I haven't had the chance to try and resolve it yet.
```
#ifdef RGBLIGHT_ENABLE
void set_layer_hsv(layer_state_t state, HSV* layer_color) {
int32_t h = layer_color->h, s = layer_color->s, v = layer_color->v;
switch (get_highest_layer(state)) {
case _RAISE:
h += 2 * RGBLIGHT_HUE_STEP;
break;
case _LOWER:
h += -2 * RGBLIGHT_HUE_STEP;
break;
case _NAV:
h += 1 * RGBLIGHT_HUE_STEP;
break;
case _MOUSE:
h += -7 * RGBLIGHT_HUE_STEP;
break;
default:
break;
}
layer_color->h = h % 255;
layer_color->s = s;
layer_color->v = v % 255;
return;
}
#endif
```
4. (Optional) If you're using `post_process_record_user`, you'll need to change the name in your keymap to `post_process_record_keymap`. We use the user function to update the HSV state after one of the RGB keycodes is pressed.

View file

@ -0,0 +1,25 @@
# Tap Mods
## Standard Keys
| Keycode | Tap | Hold | Description |
| -------- | ------- | ----- | ---------------------------------------------------- |
| `HY_ESC` | Esc | Hyper | Esc on tap; hyper when held |
| `HR_*` | A, O | LGUI | Home-row for Colemak mod-DH and right-handed numpad. |
| \'\' | R, I, 6 | LALT | Home-row for Colemak mod-DH and right-handed numpad. |
| \'\' | S, E, 5 | LCTL | Home-row for Colemak mod-DH and right-handed numpad. |
| \'\' | T, N, 4 | LSFT | Home-row for Colemak mod-DH and right-handed numpad. |
## Layers
| Keycode | Tap | Hold | Description |
| ------- | ----- | ----- | --------------------------- |
| LOWER | -- | Lower | Temporarily activate layer. |
| RAISE | -- | Raise | Temporarily activate layer. |
| NAV | -- | Nav | Temporarily activate layer. |
| LOW_ENT | Enter | Lower | |
| LOW_SPC | Space | Lower | |
| NAV_SPC | Space | Nav | |
| RAI_ENT | Enter | Raise | |
| RAI_SPC | Space | Raise | |
| RAI_TAB | Tab | Raise | |

View file

@ -0,0 +1,153 @@
# Keymap Wrappers
> Pattern adapted from users/drashna/wrapper.h
Defines several object macros for common keycode sets. Each macro typically
covers 5 keycodes with a left- or right-hand orientation, and macros are
generally grouped into rows of three or four.
> TODO: Use keymap builder to generate images.
## Example
```
#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// clang-format off
[_MODS] = LAYOUT_wrapper(
_______, ___________________BLANK___________________, ...
...
),
//clang-format on
}
```
Substitute the appropriate `LAYOUT` function, e.g., `LAYOUT_planck_grid` for your board.
## Wrappers
> **How to Read the Tables**
>
> - Headers are numbered when wrapper is not hand-specific
> - Headers use `L` and `R` to indicate handedness
> - Headers use `P`, `R`, `M`, and `I` to indicate pinky, ring, middle, and index, respectively
> - Wrappers define a maximum of **five** keycodes -- hands are shown on the same row for readability
### Alpha: Colemak mod-DH
| # | LP | LR | LM | LI | LI+ | RI+ | RI | RM | RR | RP |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 1 | Q | W | F | P | B | J | L | U | Y | ;ˆ |
| 2 | A° | R° | S° | T° | G | M | N° | E° | I° | O° |
| 3 | Z | X | C | D | V˜ | K | H | , | . | / |
- **ˆ:** (Optional) Replace `;` with `'` (top-right)
- **°:** (Optional) Home row modifiers on tap-hold (GACS, SCAG)
- **˜:** (Optional) Tap-hold `shift` on `v`
### Alpha: QWERTY
| # | LP | LR | LM | LI | LI+ | RI+ | RI | RM | RR | RP |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 1 | Q | W | E | R | T | Y | U | I | O | P |
| 2 | A | S | D | F | G | H | J | K | L | ; |
| 3 | Z | X | C | V | B | N | M | , | . | / |
### Blank(-ish)
Defines macros for common filler.
| 1 | 2 | 3 | 4 | 5 |
| ---- | ---- | ---- | ---- | ---- |
| TRNS | TRNS | TRNS | TRNS | TRNS |
| xxxx | xxxx | xxxx | xxxx | xxxx |
| LP | LR | LM | LI | LI+ | RI+ | RI | RM | RR | RP |
| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- |
| LGUI | LALT | LCTL | LSFT | TRNS | TRNS | RSFT | RCTL | LALT | RGUI |
### Adjust
| # | LP | LR | LM | LI | LI+ | RI+ | RI | RM | RR | RP |
| --- | ------ | ----- | ---- | ----- | ------ | ---- | ------ | ------ | ---- | ---- |
| 1 | Reset | Debug | xxxx | Term+ | Term- | xxxx | AGNORM | AGSWAP | xxxx | xxxx |
| 2 | RgbTog | Hue+ | Sat+ | Val+ | RgbMod | xxxx | CLMKDH | QWERTY | xxxx | xxxx |
| 3 | xxxx | Hue- | Sat- | Val- | xxxx | xxxx | xxxx | xxxx | xxxx | xxxx |
> Recommend: Define Right side per-board
### Function
| # | 1 | 2 | 3 | 4 |
| --- | --- | --- | --- | --- |
| 1 | F1 | F2 | F3 | F4 |
| 2 | F5 | F6 | F7 | F8 |
| 3 | F9 | F10 | F11 | F12 |
### Media
| # | 1 | 2 | 3 | 4 | 5 |
| --- | ----- | ----- | ----- | ---- | ---- |
| 1 | AuOn | MiOn | MuOn | Brm+ | Vol+ |
| 2 | AuOff | MiOff | MuOff | Brm- | Vol- |
| 3 | Play | Stop | Next | Prev | Mute |
### Nav
| # | RI+ | RI | RM | RR | RP |
| --- | ----- | ---- | ----- | ----- | ----- |
| 1 | Pg Up | Home | Wh Dn | Wh Up | End |
| 2 | Pg Dn | Left | Down | Up | Right |
| 3 | xxxx | xxxx | xxxx | xxxx | xxxx |
### Numpad
- `X Y` indicates the character `X` on keypress and character `Y` on `shift` keypress
- Second table shows characters with `alt` keypress
| # | RI+ | RI | RM | RR | RP |
| --- | ----- | ----- | ----- | ----- | ----- |
| 1 | Del | `7 &` | `8 _` | `9 (` | |
| 2 | `- _` | `4 $` | `5 %` | `6 ^` | `*` |
| 3 | `= +` | `1 !` | `2 @` | `3 #` | `, <` |
| 4 | | `0 )` | `. >` | | |
| # | RI+ | RI | RM | RR | RP |
| --- | ----- | ----- | ----- | ----- | ----- |
| 1 | | `¶ ‡` | `• °` | `ª ·` | `« »` |
| 2 | ` —` | ` | `∞ fi` | `§ fl` | `° °` |
| 3 | `≠ ±` | ` | `™ €` | ` | `≤ ¯` |
| 4 | | | ` | | |
### Symbols
| # | LP | LR | LM | LI | LI+ |
| --- | ---- | ---- | ---- | ---- | ---- |
| 1 | ~ | \` | ( | ) | |
| 2 | LGUI | LALT | \[ ° | \] ° | \_ - |
| 3 | xxxx | xxxx | { | } | LSFT |
- **°:** Home row modifiers on tap-hold (GACS, SCAG)
### VIM
| # | LP | LR | LM | LI | LI+ |
| --- | --- | --- | --- | --- | --- |
| 1 | Q° | W° | : | | |
- **°:** Via transparency
## Typical Layers
My keymaps typically use the following layers.
| # | Name | Via | Left | Right |
| --- | ---------- | ------------- | --------- | ------ |
| 0 | Colemak DH | Adjust | | |
| 1 | QWERTY | Adjust | | |
| 2 | Mouse | tap-dance | n/a | n/a |
| 3 | Lower | L home thumb | symbols | numpad |
| 4 | Raise | L outer thumb | | |
| 5 | Nav | R home thumb | home mods | nav |
| 6 | Adjust | tap-dance | RGB | MEDIA |