Re: Using XGrabPointer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 28 Jun 2000, Dallas Glidewell wrote:


You can use polling to detect whether the mouse has moved.
To do that, call XQueryPointer() every 1 second or so
and save the mouse coordinates. Then you compare values
and see whether the mouse has moved. As for the keyboard,
I cant think of anything efficient right now.

--
Alfredo

> Alfred Wrote:
> > I believe that if you use XGrabPointer all other
> > windows
> > will stop receiving mouse events. I think thats not
> > what
> > you want.. Why do you need to check for mouse events
> > in other
> > windows? 
> 
> I am building an application running on Linux
> consisting of a desktop that has two windows (J
> windows) written in Java and one window that is
> written in C++.  All windows are always viewable
> (meaning that no window can float over/under other
> windows).  This piece of the application will function
> in a manner that while the user continues to move the
> mouse or press keys, the system remains in an active
> state (the user is logged on).  If the user has a
> specified period of inactivity (no mouse movement and
> key presses) the system will detect the this and send
> a message to a Java class telling the system to logout
> (it will first give a warning message then after about
> 30 seconds if no activity still exists the Java class
> will log the user out - if however the user moves the
> mouse or presses a key, the Java class is told that
> the system is now active and the pending logout is
> cancelled).
> 
> To my understanding, Java can only detect mouse moves
> and key presses in a Java window and KDE, which is our
> desktop, can only detect mouse/keyboard in the active
> window so I was looking into XGrabPointer (and the
> compariable keyboard function) to detect this mouse
> movement and key presses.
> 
> > I believe that if you use XGrabPointer all other
> > windows
> > will stop receiving mouse events.
> I am starting to agree with Alfred that XGrabPointer
> cannot do it because it grabs the pointer and does not
> give it up.
> 
> Does anybody know of a good way to handle what I need
> to do.
> 
> Thanks for the help,
> Dallas
> --- Alfredo Kengi Kojima <kojima@xxxxxxxxxxxx> wrote:
> > On Tue, 27 Jun 2000, Dallas Glidewell wrote:
> > 
> > I believe that if you use XGrabPointer all other
> > windows
> > will stop receiving mouse events. I think thats not
> > what
> > you want.. Why do you need to check for mouse events
> > in other
> > windows? 
> > 
> > --
> > Alfredo
> > 
> > > Correct me if I am wrong but to my understanding,
> > > Java.awt or javax.swing can only listen to mouse
> > > events for a particular window, when I actaully
> > need
> > > to listen to mouse events which could be for all
> > > windows or no windows on the screen at all.
> > > 
> > > Dallas
> > > --- Dave Mielke <dave@xxxxxxxxx> wrote:
> > > > [quoted lines by Dallas Glidewell on June 26,
> > 2000,
> > > > at 12:30]
> > > > 
> > > > >I have a need to determine when the mouse is
> > moved
> > > > on
> > > > >a Linux system.  Ultimately, my Java program
> > will
> > > > call
> > > > >a C program that can determine and notify Java
> > when
> > > > >the mouse pointer has been moved.  
> > > > 
> > > > Then why don't you use the Java.awt or
> > javax.swing
> > > > classes and listen for mouse
> > > > motion events?
> > > > 
> > > > -- 
> > > > Dave Mielke           | 856 Grenon Avenue | I
> > > > believe that the Bible is the
> > > > Phone: 1-613-726-0014 | Ottawa, Ontario   | Word
> > of
> > > > God. Please contact me
> > > > EMail: dave@xxxxxxxxx | Canada  K2B 6G3   | if
> > > > you're concerned about Hell.
> > > > 
> > > > 
> > > > -- 
> > > >          To unsubscribe: mail
> > > > blinux-develop-request@xxxxxxxxxx with 
> > > >                        "unsubscribe" as the
> > Subject.
> > > > 
> > > > 
> > > 
> > > 
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Get Yahoo! Mail - Free email you can access from
> > anywhere!
> > > http://mail.yahoo.com/
> > > 
> > > 
> > > -- 
> > >          To unsubscribe: mail
> > blinux-develop-request@xxxxxxxxxx with 
> > >                        "unsubscribe" as the
> > Subject.
> > > 
> > > 
> > 
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Get Yahoo! Mail - Free email you can access from anywhere!
> http://mail.yahoo.com/
> 




[Index of Archives]     [Linux for the Blind]     [Fedora]     [Kernel List]     [Red Hat Install]     [Red Hat Watch List]     [Red Hat Development]     [Gimp]     [Yosemite News]     [Big List of Linux Books]