input-remapper icon indicating copy to clipboard operation
input-remapper copied to clipboard

how to bind keyboard and mouse together?

Open chopin1998 opened this issue 1 year ago • 2 comments

input-remapper-control --version input-remapper 2.0.1 568f56cdb438f4ad6db9e96b2900d1228ea736ee https://github.com/sezanzeb/input-remapper python-evdev 1.6.1

image

i wanna add a input: mouse WHEEL while keyboard SHIFT holding, to speedup scroll, how can i do this?

thank you !

chopin1998 avatar Sep 03 '24 06:09 chopin1998

On the right hand side, under output. Click the 'Target' drop down and change it from 'mouse' to 'keyboard + mouse'. Then assign the key and mouse button combination you're chasing.

ocouch avatar Sep 04 '24 09:09 ocouch

You can't record the needed Shift+WheelUp input event since they are coming from separate devices.

Will likely also want to retain the normal shift to function but you want the mouse wheel to be modified.

A macro on the keyboard...

set(shifted,1).
hold_keys(Shift_L).
set(shifted,0)

...will do normal shift stuff but will also set a background variable to 1 when shift is held.

Then on the mouse, wheels would be set to...

if_eq(
	$shifted,
	1,
	then=
		wheel(up,100),
	else=
		wheel(up,1)
)

...and...

if_eq(
	$shifted,
	1,
	then=
		wheel(down,100),
	else=
		wheel(down,1)
)

...respectively.

However not all applications seem to like scrolling with shift held, so preventing the shift from working normally WHILE scrolling is another issue.

Not even something like...

if_eq(
	$shifted,
	1,
	then=
		key_up(Shift_L).
		wheel(up,100).
		key_down(Shift_L),
	else=
		wheel(down,1)
)

...and...

if_eq(
	$shifted,
	1,
	then=
		key_up(Shift_L).
		wheel(down,100).
		key_down(Shift_L),
	else=
		wheel(down,1)
)

...seems to work for me in firefox. Either works fine in konsole though so your milage may vary.

shawarden avatar Oct 15 '24 22:10 shawarden