Repeating events
gliviu opened this issue · 1 comments
gliviu commented
Usecase: map mouse side buttons to scrolling wheel
Some background: map mouse button to scrolling behaviour, moses-palmer/pynput#68
This feature would require
- Support event type remapping. In our scenario we receive code
ecodes.BTN_EXTRA
, typeecodes.EV_KEY
and need to send codeecodes.REL_WHEEL
with typeecodes.EV_REL
- Be able remap the event value. For scrolling down we need
event.value=-1
. - Implement some repeating mechanism between press/release of a button. This would be necessary only for mouse buttons as regular kb keys already have it.
Config file could look like
- input_name: '...'
remappings:
BTN_EXTRA:
- code: REL_WHEEL
type: EV_REL
value: 1
repeat: .1
BTN_SIDE:
- code: REL_WHEEL
type: EV_REL
value: -1
repeat: .1
BTN_MIDDLE:
- KEY_A # Shortcut configuration for regular usecases (only maps code)
I have a working implementation that is still to be refined.
If you think this falls within the scope of this project let me know and I'll create some PRs
philipl commented
I think it's a reasonable feature to have, so please go ahead and I'll look at the PRs.
Thanks!