LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   TouchCursor under Linux ; I can't believe there is no way to do that (https://www.linuxquestions.org/questions/linux-desktop-74/touchcursor-under-linux-%3B-i-cant-believe-there-is-no-way-to-do-that-771470/)

MTK358 01-12-2010 01:54 PM

From the XGrabKeyboard man page:

Code:

display
    Specifies the connection to the X server.
grab_window
    Specifies the grab window.
keyboard_mode
    Specifies further processing of keyboard events. You can pass GrabModeSync or GrabModeAsync.
owner_events
    Specifies a Boolean value that indicates whether the keyboard events are to be reported as usual.
pointer_mode
    Specifies further processing of pointer events. You can pass GrabModeSync or GrabModeAsync.
time
    Specifies the time. You can pass either a timestamp or CurrentTime.

What is the "grab window" and owner_events, and why does it need to know the time?

bobshaffer2 01-12-2010 02:08 PM

Quote:

Originally Posted by MTK358 (Post 3824101)
From the XGrabKeyboard man page:

Code:

display
    Specifies the connection to the X server.
grab_window
    Specifies the grab window.
keyboard_mode
    Specifies further processing of keyboard events. You can pass GrabModeSync or GrabModeAsync.
owner_events
    Specifies a Boolean value that indicates whether the keyboard events are to be reported as usual.
pointer_mode
    Specifies further processing of pointer events. You can pass GrabModeSync or GrabModeAsync.
time
    Specifies the time. You can pass either a timestamp or CurrentTime.

What is the "grab window" and owner_events, and why does it need to know the time?

all XEvents are supposed to have a timestamp. It's so that events can be handled asynchronously and there is some indication as to the sequence of events. The grabbing window would most likely be *your* window. I'm not sure if your window can both grab the keyboard and remain hidden, but it's worth a try. I don't think it's possible to do anything without at least creating a widget. You may have to map it as well, and then hide it after grabbing the keyboard. You'll just have to try some things and see what happens.

MTK358 01-12-2010 03:26 PM

How do I create a "Time"?

And what's "owner_events"?

bobshaffer2 01-12-2010 03:55 PM

Quote:

Originally Posted by MTK358 (Post 3824243)
How do I create a "Time"?

And what's "owner_events"?

I think a "Time" is just a time_t, so maybe:

Time t = time();

I don't remember for sure.
And owner_events looks like it should be True for what you want. It looks like it's asking whether you want the events to be sent or not. Perhaps it's possible to use some method other than event processing to get the status of the keyboard. I don't know for sure, I tend to test things when I'm not sure, as sometimes the Xlib documentation is somewhat cryptic.
Hope that helps some.

MTK358 01-12-2010 05:03 PM

No, it says that time is of type "Time" (with a capital T), not "time_t".


All times are GMT -5. The time now is 02:07 PM.