Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc-dev/reference-manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ COMMAND = set mouseKeys.{move|scroll}.initialAcceleration <px/s, ~1700/20 (INT)>
COMMAND = set mouseKeys.{move|scroll}.deceleratedSpeed <px/s, ~200/10 (INT)>
COMMAND = set mouseKeys.{move|scroll}.acceleratedSpeed <px/s, ~1600/50 (INT)>
COMMAND = set mouseKeys.{move|scroll}.axisSkew <multiplier, 0.5-2.0 (FLOAT)>
COMMAND = set mouseKeys.scroll.forceFullFirstTick BOOL
COMMAND = set i2cBaudRate <baud rate, default 100000(INT)>
COMMAND = set diagonalSpeedCompensation BOOL
COMMAND = set chordingDelay <time in ms (INT)>
Expand Down Expand Up @@ -578,6 +579,7 @@ Internally, values are saved in one of the following types, and types are automa
- `deceleratedSpeed` - speed as affected by deceleration modifier.
- `acceleratedSpeed` - speed as affected by acceleration modifier.
- `axisSkew` - axis skew multiplies the horizontal axis and divides the vertical axis. The default value is 1.0, a reasonable value is between 0.5-2.0 Useful for very niche use cases.
- `forceFullFirstTick` - when enabled, mousekey scroll press will aways begin by a full scroll unit push. Disable this when using high-resolution scrolling. Enable this if your environment does not support high-resolution scrolling.
- `set module.MODULEID.{baseSpeed|speed|xceleration}` modifies speed characteristics of right side modules.

Simply speaking, `xceleration` increases sensitivity at high speeds, while decreasing sensitivity at low speeds. Furthermore, `speed` controls contribution of the acceleration formula. The `baseSpeed` can be used to offset the low-speed-sensitivity-decrease effect by making some raw input be applied directlo to the output.
Expand Down
1 change: 1 addition & 0 deletions right/src/config_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ const config_t DefaultCfg = (config_t){
},
},
.DiagonalSpeedCompensation = false,
.MouseKeysForceFullFirstTick = true,
.TouchpadPinchZoomMode = NavigationMode_Zoom,
.HoldContinuationTimeout = 0,
.SecondaryRoles_AdvancedStrategyDoubletapTimeout = 200,
Expand Down
1 change: 1 addition & 0 deletions right/src/config_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
mouse_kinetic_state_t MouseMoveState;
mouse_kinetic_state_t MouseScrollState;
bool DiagonalSpeedCompensation;
bool MouseKeysForceFullFirstTick;

// key behavior
uint16_t KeystrokeDelay;
Expand Down
3 changes: 3 additions & 0 deletions right/src/macros/set_command.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,9 @@ static macro_variable_t mouseKeys(parser_context_t* ctx, set_command_action_t ac
DEFINE_FLOAT_LIMITS(0.001f, 1000.0f);
ASSIGN_FLOAT(state->axisSkew);
}
else if (ConsumeToken(ctx, "forceFullFirstTick")) {
ASSIGN_BOOL(Cfg.MouseKeysForceFullFirstTick);
}
else {
Macros_ReportError("Parameter not recognized:", ctx->at, ctx->end);
}
Expand Down
8 changes: 4 additions & 4 deletions right/src/mouse_keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ static void processMouseKineticState(mouse_kinetic_state_t *kineticState)
kineticState->xOut = xSumInt;

// Handle the first scroll tick.
if (kineticState->isScroll && !kineticState->wasMoveAction && kineticState->xOut == 0 && horizontalMovement) {
kineticState->xOut = ActiveMouseStates[kineticState->leftState] ? -1 : 1;
if (kineticState->isScroll && !kineticState->wasMoveAction && kineticState->xOut == 0 && horizontalMovement && Cfg.MouseKeysForceFullFirstTick) {
kineticState->xOut = ActiveMouseStates[kineticState->leftState] ? -scrollMultiplier : scrollMultiplier;
kineticState->xSum = 0;
}

Expand All @@ -164,8 +164,8 @@ static void processMouseKineticState(mouse_kinetic_state_t *kineticState)
kineticState->yOut = ySumInt;

// Handle the first scroll tick.
if (kineticState->isScroll && !kineticState->wasMoveAction && kineticState->yOut == 0 && verticalMovement) {
kineticState->yOut = ActiveMouseStates[kineticState->upState] ? -1 : 1;
if (kineticState->isScroll && !kineticState->wasMoveAction && kineticState->yOut == 0 && verticalMovement && Cfg.MouseKeysForceFullFirstTick) {
kineticState->yOut = ActiveMouseStates[kineticState->upState] ? -scrollMultiplier : scrollMultiplier;
kineticState->ySum = 0;
}
} else {
Expand Down
1 change: 1 addition & 0 deletions right/src/mouse_keys.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
typedef struct {
bool isScroll;
bool wasMoveAction;
bool forceFullFirstTick;
serialized_mouse_action_t upState;
serialized_mouse_action_t downState;
serialized_mouse_action_t leftState;
Expand Down