jahnf / Projecteur

Linux Desktop Application for the Logitech Spotlight device (and similar devices) - Digital Laser Pointer
MIT License
379 stars 33 forks source link

Fix InputMapper issue with same sized Input Sequences #145

Closed mayanksuman closed 3 years ago

mayanksuman commented 3 years ago

In case, when two different input sequence of same length and same end KeyEvent are defined then InputMapper fails to map to correct action (Please see #144 ).

This PR consisting of two commit fixes the issue with InputMapper. First commit fixes the issue by deciding the correct action on the basis of all keys pressed (instead of last key pressed in earlier version of code). Second commit refactors deviceinput.cc as struct Next and SynKeyEventMap do not need to save action inside them.

Fixes #144

jahnf commented 3 years ago

Hi Mayank, I fixed it differently. Your fix works, but the way it was implemented before by me had the wrong behavior as you mentioned in #144 - so this would be a patch on a faulty implementation - so I decided to reimplement that part (see #146) - that also allowed me to keep the interface unchanged.

mayanksuman commented 3 years ago

Yes, this PR changes the existing interface.

In the PR #146, I have left a comment empty action. Can you check that one.