summaryrefslogtreecommitdiffstats
path: root/users/muppetjones/readme/etchamouse.md
diff options
context:
space:
mode:
authorStephen J Bush <2041619+muppetjones@users.noreply.github.com>2022-08-03 12:23:17 -0500
committerGitHub <noreply@github.com>2022-08-03 18:23:17 +0100
commitdf8a538489414b1f0c0cdcb786a76cca763ae37a (patch)
treebbe7658a309bb07267b77461f45d6d0fa8ba17c7 /users/muppetjones/readme/etchamouse.md
parent5f6cf24294c789963415f615db2fa24e46f89fa6 (diff)
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>
Diffstat (limited to 'users/muppetjones/readme/etchamouse.md')
-rw-r--r--users/muppetjones/readme/etchamouse.md69
1 files changed, 69 insertions, 0 deletions
diff --git a/users/muppetjones/readme/etchamouse.md b/users/muppetjones/readme/etchamouse.md
new file mode 100644
index 0000000000..efcf718b22
--- /dev/null
+++ b/users/muppetjones/readme/etchamouse.md
@@ -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.