-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow mode-specific key and mouse bindings #426
Comments
This is just the first thought, but I am not sure that enabling binding to on/off button events is the right thing. What your presenter does is essentially (in the standard GUI terms) sending the mouse drag events, right? So probably a way to specify what to do on mouse drag would be the way to go.
That would be a dirty hack and rather a resource-hungry one at that... |
hmm, I did some more testing and it seems that the device is a bit more complicated than I thought. The button to enable the mouse has two modes: one is the click, which gives a ButtonPress/ButtonRelease with button 3. The other is press+hold at which point there is no Button-event, only the MotionNotify start to appear when moving the presenter and stop when releasing the button again.
This means that easiest way to get it basically working is a |
Well, isn't it exactly the same what normal mouse does? |
Yes and no: on a mouse you have a ButtonDown event first, then the Motion events, then the ButtonRelease event, which gives you the drag action, right? Here it's just that while holding the button it acts as a normal mouse but you don't get the ButtonDown/Release events. |
I'm confused. When you press the button, how does the device know - will you just release it (i.e., intending to make a click and then it needs to send ButtonDown) or continue keeping it pressed (no ButtonDown now and no ButtonRelease later on)? Does it come with a crystal ball attached? :) PS. It's so inconsiderate of Logitech not sending their new devices to pdfpc developers for testing :) |
When I press+hold the button there is a small delay until the cursor starts moving. So my guess is that they have a built-in delay to either generate a ButtonDown+ButtonRelease event or start sending the movement events.
Given that Logitech does not care for Linux and that on Windows and macOS they have their own software taking care of it (and allowing for additional effects), I doubt they would :( Anyway, my first attempt is something like:
... only problem being that my |
Yes, the configurable mouse bindings actually operate only in the "normal" mode, in others everything is hardcoded (including some keystrokes). To some extent it's reasonable, since e.g., the (standard) binding of mouse1 to I'm not sure what to do. One option is to introduce configurable context-sensitive (that's, mode-sensitive) bindings (either only mouse or mouse and keys alike). This is probably the most general approach, but would mean a rather substantial coding. Another option is to hardcode mouse3 to switch to the normal mode (when in any other mode). Which might come handy also with a normal mouse. |
👍 🤣 thanks for the hint!
|
Small update: on a newer kernel (4.20.12 than 4.12.14), the button to enable the mouse shows up as button 1 instead of button 3. Everything else remains the same. |
Hmm, then you cannot use it for forward movement (when in the normal mode)?? |
OK, I see. The next/prev buttons send the keyboard events; the device is recognized as a keyboard/mouse combo. |
Maybe instead of catering for this rather specific device, an external application should translate/map its events reasonably? Have you seen this project, BTW? |
Yes, I've seen that and almost tried it. But then I discovered that pdfpc has a pointer mode already built-in and decided it would be much easier to use, especially when it comes to mapping from a presenter console to the presentation screen. In fact, the only thing missing to make it work is a (limited, but separate) action-support in pointer mode. The alternative would be to setup some mapping as described in one of the following: |
@dev-zero BTW, do you know how to send commands back to the presenter device (make it vibrate)? It would be possible to couple it with some timer events (which is what the vendor software does under Win/Mac, if I understand correctly). |
@fnevgeny Check this comment. It is possible to make the presenter vibrate by sending a special package on usb. |
Thanks. It doesn't work for me, though, for a reason. Also, not applicable when connecting through BT directly... |
It is not clear to me. Does it work on usb? The problem only remain if the device is used with BT. The code is not supposed to work with BT as it uses |
No. Don't have it now with me, the error was something like command sequence not recognized. |
Does your original problem boil down to switching off the cursor (after some period of inactivity)? That would make sense in general, irrespective of a specific input device used. |
I'm trying to setup the Logitech Spotlight presenter with pdfpc. The presenter itself is properly recognized by Linux as a mouse device which generates a
LEFT
andRIGHT
key events with the control buttons.The button to turn on the gyroscope-based mouse generates a mouse button 3 event as per
xev
:Using the binding
mouse 3 switchMode pointer
I can switch the mode to pointer while at the same time enabling the mouse. The problem is that it doesn't switch back tonormal
mode (and hide the pointer) when releasing the button again.What I would need is something like:
Plus maybe an option to
not
hide the mouse pointer on the presenter console when innormal
mode to remember where I left the pointer.An alternative to always switching modes could be to add a new command to change the opacity of the pointer.
Following the code I guess I would have to add a new attribute to the
KeyDef
type (and theBindTouple
before including the respective config parsing) and then remove&& button.type == Gdk.EventType.BUTTON_PRESS
in thebutton_press
implementation insrc/classes/presentation_controller.vala
?The text was updated successfully, but these errors were encountered: