philipl/evdevremapkeys

Repeating events

gliviu opened this issue · 1 comments

Usecase: map mouse side buttons to scrolling wheel
Some background: map mouse button to scrolling behaviour, moses-palmer/pynput#68

This feature would require

  1. Support event type remapping. In our scenario we receive code ecodes.BTN_EXTRA, type ecodes.EV_KEY and need to send code ecodes.REL_WHEEL with type ecodes.EV_REL
  2. Be able remap the event value. For scrolling down we need event.value=-1.
  3. 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

I think it's a reasonable feature to have, so please go ahead and I'll look at the PRs.

Thanks!