LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 01-12-2010, 01:54 PM   #16
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723

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?
 
Old 01-12-2010, 02:08 PM   #17
bobshaffer2
LQ Newbie
 
Registered: Mar 2005
Location: Ohio
Distribution: Several (Gentoo, Red Hat/Fedora, HP-UX, Helix)
Posts: 26

Rep: Reputation: 17
Quote:
Originally Posted by MTK358 View Post
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.
 
Old 01-12-2010, 03:26 PM   #18
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
How do I create a "Time"?

And what's "owner_events"?
 
Old 01-12-2010, 03:55 PM   #19
bobshaffer2
LQ Newbie
 
Registered: Mar 2005
Location: Ohio
Distribution: Several (Gentoo, Red Hat/Fedora, HP-UX, Helix)
Posts: 26

Rep: Reputation: 17
Quote:
Originally Posted by MTK358 View Post
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.
 
Old 01-12-2010, 05:03 PM   #20
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

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


Reply

Tags
keyboard, xbindkeys, xmodmap



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux Training Tips - Boot Linux from a Linux Installation CD or a Linux Live CD to L beibei Linux - General 1 10-29-2009 04:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 08:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration