I have a GTK window containing a WebKitWebView that shows a user interface. I receive touch information over USB from a touch panel.
How do I inject mouse down, dragged and up events into the web kit view, without having to move the actual mouse pointer (as there may be multiple touch screens connected to one machine that all need to function independently)?
You have to create an appropriate GDK Event (GdkEventButton for mouse button events) and put it in the event queue using
void gdk_event_put(const GdkEvent *event)
See the GDK documentation for details.
Related
It specifically says in the Wayland TODO text file that Wayland doesn't have active grabs for the pointer yet. But if I run Gnome on Wayland, try clicking a menu open and then clicking outside it, the outside click is swallowed as if the pointer was grabbed by the menu window. How does Gnome manage that?
What you are talking about can be done very easily by creating a transparent overlay over the entire screen. In that case, the click events on the transparent region will not propagate to the underlying elements. You can see this in Telegram's image viewer, where it creates a full-screen gray overlay under the image.
But on the compositor side this effect can be achieved in a different way-- by disabling all input events outside the popup rectangle.
I have a Qt OpenGL (with qt 5.5) Application in which you can click to drag objects in a 3D scene.
This is implemented by having a subclass of QOpenGLWidget which overrides mousePressEvent, mouseReleaseEvent and mouseMoveEvent.
However, when I drag an object, I can move it for one frame before the window starts activating the window move mode, and my mouse movements actually start moving the whole window, as if I was dragging the title bar.
I suspect there is a conflict between the application and my window manager (kwin 5.4.3), but I don't know where to look at to debug this issue and whether it's my application's fault or if I have to fix my window manager.
You may need to call the accept() method of the event you are handling.
I want to know as to how do you detect if a key press event or a mouse pointer event has been generated by an (automation like) application like xdotool. Basically, I am writing an application to check if there is no real mouse or keyboard activity. In my application I want to flag idle activity only if we don't have real mouse movement or real key press/release on the keyboard. Any reference regarding this would be great. I want to do this using pure xlib API. Don't want to use XCB. Any extensions such XRecord(which I am currently using to capture events) are fine.
Thanks in advance.
Yes there is a possibility.
All X11-events which are relevant for mouse movements and clicks have a member called "send_event".
It is set to "True" if the event was sent by an application. It is "False" if it was generated by the X-Server, i.e. by a user action.
If xdotool uses SendEvent for mousclick simulation than you'll be able to detect that using the "send_event" member.
I want to finish such a demand, in the interface embedded UIWebView control, when the user clicks on a blank area and the area that link, jump to different new interface, but I can't distinguish between the two. Could someone help me?
I try put an transparent NSView over an UIWebView, and overide the touchesDidBegin etc, then send them to your webview. Ex: But the UIWebView can't accept touch events。
I am creating application for touch devices for nokia.
J2ME provides methods pointerPressed, released and dragged on canvas.
I have generated a canvas in full screen mode having commands.
On click of "option" command, another command menu opens, which is having commands like Ok, Back, Next.
Now to get the event of sub command menu I have to get that which command is clicked.
My question is how can I get that particular command has been clicked?
Application is for N97/Music express (no keyboard support). I just want the way out using touch functionality.
keyPressed event is not at all useful for me.
If you have pointer events, then look at the co-ordinates of the event, and check to see whether it lies within where you're drawing your menu option on the canvas.