jahnf / Projecteur

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

Feature: Configurable Button/Key Mapping and Action #69

Closed jahnf closed 4 years ago

jahnf commented 4 years ago

It must be possible to map input events (and some combinations like double tap) from the device to either

This should be configurable by the user (via config file and/or UI).

maehne commented 4 years ago

In issue #76, I posted about the following idea, which is related to this feature request:

If you want to use the spotlight for explanations over a longer time, it can be tiresome to have to leave the thumb on the button. How about an option where with one click on the device button the spotlight is turned on and with another click the spotlight is turned off? A kind of spotlight locking function might be even more intuitive: I the spotlight button got pressed for a configurable amount of time (e.g. 3 or 5 sec), it remains on -- even if the button is released. Only a second press on the button will turn it off again.

@jahnf replied:

Things like that will be possible with the button mapping functionality I am working on for the next release - maybe not all kind of combinations right from the start but Projecteur will get there - at least that is my plan. So if the user wants to, all buttons (or button sequences) they can be mapped to either a defined key-press or some action (e.g. toggle the spot??) Can't promise a date on this yet though.

jahnf commented 4 years ago

Button mapping is here! :tada: So for everybody that is interested in it, please give it a try :wrench: :hammer: and test it. Feedback and bug reports are welcome as always. Suggestions for generic actions (still to be implemented) for mapping are also highly appreciated.

A lot of custom widgets were implemented for this and there is still work to do but:

The following is already implemented

The following is still to be implemented

mayanksuman commented 4 years ago

The key combination like Alt+Tab can not be added to mapper currently.

jahnf commented 4 years ago

The key combination like Alt+Tab can not be added to mapper currently.

True, shortcuts like that are caught by GNOME or KDE (or any other Desktop environment)- so a keypress like that will not even arrive in the application itself. I don't have any idea if it is possible (or if it is even desirable) to catch a combination like Alt+Tab.

Edit: Special shortcuts (like Alt+Tab) could be added - not by "recording" the shortcut but by selecting it via a combo box for example... I'll remember that for future versions.

mayanksuman commented 4 years ago

To capture those kind of key combinations, can we grab the keyboard input when Mapped Key(s) is under edit?

jahnf commented 4 years ago

Yes, but I would not do that (grabbing and hijacking the users keyboard). Also: first of all you would need to know which input device the user is using to input the shortcut (could be any of multiple keyboards connected). Also you would need to have read access to the keyboard input device or be running as root user.

jahnf commented 4 years ago

The implementation allows now for more generic actions mapped to button input, (this also means that if you had already button mappings set up they are lost - since the format for storing and loading internally changed)

One other action is already implemented:

jahnf commented 4 years ago

Closing this issue. Only bug fixes from here on until the 0.8 release this June.