Skip to content

Commit 53ff9d7

Browse files
committed
Fix: Better scrollwheel on Windows
1 parent 892ded0 commit 53ff9d7

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

share/default_profiles/Desktop.sccprofile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"gyro": {},
2020

2121
"pad_left": {
22-
"action": "feedback(LEFT, 4096, 16, XY(mouse(Rels.REL_HWHEEL, 1.0), mouse(Rels.REL_WHEEL, 1.0)))"
22+
"action": "feedback(LEFT, 4096, 16, ball(XY(mouse(REL_HWHEEL), mouse(REL_WHEEL))))"
2323
},
2424

2525
"pad_right": {

src/actions/ball.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,10 @@ static void whole(Action* a, Mapper* m, AxisValue x, AxisValue y, PadStickTrigge
197197
double t = mono_time_d();
198198
if (b->old_pos_set && m->was_touched(m, what)) {
199199
double dt = t - b->last_time;
200+
if (dt < 0.0075) return;
200201
double dx = (double)(x - b->old_pos.x);
201202
double dy = (double)(y - b->old_pos.y);
203+
LOG("Added movement over %g", dt);
202204
add(b, dx / dt, dy / dt);
203205
if (b->child->extended.change != NULL) {
204206
wholehaptic_change(&b->whdata, m, dx, dy);
@@ -272,7 +274,7 @@ static ActionOE ball_constructor(const char* keyword, ParameterList params) {
272274
b->child = scc_parameter_as_action(params->items[6]);
273275

274276
size_t mean_len = scc_parameter_as_int(params->items[2]);
275-
float fampli = scc_parameter_as_float(params->items[4]);
277+
double fampli = scc_parameter_as_float(params->items[4]);
276278
b->radscale = (b->degree * M_PI / 180.0) / fampli;
277279
b->i = (2.0 * b->mass * (b->r * b->r)) / 5.0;
278280
b->a = b->r * b->friction / b->i;
@@ -305,3 +307,4 @@ void scc_actions_init_ball() {
305307
0.02, 65536, 40.0);
306308
scc_action_register(KW_BALL, &ball_constructor);
307309
}
310+

src/virtual-device/uinput-win32/winapi_device.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
#define XSCALE 0.006
1313
#define YSCALE 0.006
14-
#define SCR_XSCALE 0.0005
15-
#define SCR_YSCALE 0.0005
14+
#define SCR_XSCALE 0.01
15+
#define SCR_YSCALE 0.01
1616

1717

1818
VirtualDevice* setup_winapi_device(VirtualDeviceType type, const VirtualDeviceSettings* settings) {

0 commit comments

Comments
 (0)