Programmatically move the mouse?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Programmatically move the mouse?




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Programmatically move the mouse?  
J. Patrick Brandt


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:33 PM

Does anyone even know if it is possible programmatically to reposition the
mouse cursor [using Qt under Linux]?

Any hints appreciated. I am trying to "trap" the mouse cursor to the visible
area of a framebuffer (e.g. TV out - the visible part of the screen is less
than the full x-y resolution, depending on the monitor...)

I can catch mouseMoveEvents and send my own (which I receive) but the cursor
doesn't move, so all I am doing is sending "extra" events, not affecting the
mouse.

What I would like to do is something like "if x<100 then move mouse to
(100,y)", etc.

Sorry - I can't seem to find a "Qt" related group.
Thanks!







[ Post a follow-up to this message ]



    Re: Programmatically move the mouse?  
Michael B Allen


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:33 PM

On Wed, 24 Dec 2003 00:00:24 -0500, J. Patrick Brandt wrote:
quote:
> Does anyone even know if it is possible programmatically to reposition > the mouse cursor [using Qt under Linux]? > > Any hints appreciated. I am trying to "trap" the mouse cursor to the > visible area of a framebuffer (e.g. TV out - the visible part of the > screen is less than the full x-y resolution, depending on the > monitor...) > > I can catch mouseMoveEvents and send my own (which I receive) but the > cursor doesn't move, so all I am doing is sending "extra" events, not > affecting the mouse. > > What I would like to do is something like "if x<100 then move mouse to > (100,y)", etc. > > Sorry - I can't seem to find a "Qt" related group. Thanks!
This doesn't have anything to do with Qt really. You want to look at the X windows documentation. I don't know if there is a standard way to do this sort of thing but it's very likely possible to do such a thing. You might need to inject some custom mouse events or other trickery. Mike




[ Post a follow-up to this message ]



    Re: Programmatically move the mouse?  
Torgny Lyon


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:33 PM

J. Patrick Brandt wrote:
quote:
> Does anyone even know if it is possible programmatically to reposition the > mouse cursor [using Qt under Linux]? > > Any hints appreciated. I am trying to "trap" the mouse cursor to the visib le > area of a framebuffer (e.g. TV out - the visible part of the screen is les s > than the full x-y resolution, depending on the monitor...) > > I can catch mouseMoveEvents and send my own (which I receive) but the curs or > doesn't move, so all I am doing is sending "extra" events, not affecting t he > mouse. > > What I would like to do is something like "if x<100 then move mouse to > (100,y)", etc. > > Sorry - I can't seem to find a "Qt" related group. > Thanks! > >
Perhaps XWarpPointer() is what you are looking for. -- Torgny Lyon <torgny@enterprise.hb.se> PGP Public Key: http://enterprise.hb.se/~torgny/pgpkey.asc




[ Post a follow-up to this message ]



    Re: Programmatically move the mouse?  
Jerry Feldman


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:33 PM

On Tue, 23 Dec 2003 21:00:24 -0800
"J. Patrick Brandt" <spambait@null.com> wrote:
quote:
> Does anyone even know if it is possible programmatically to reposition > the mouse cursor [using Qt under Linux]? > > Any hints appreciated. I am trying to "trap" the mouse cursor to the > visible area of a framebuffer (e.g. TV out - the visible part of the > screen is less than the full x-y resolution, depending on the > monitor...) > > I can catch mouseMoveEvents and send my own (which I receive) but the > cursor doesn't move, so all I am doing is sending "extra" events, not > affecting the mouse. > > What I would like to do is something like "if x<100 then move mouse to > (100,y)", etc. > > Sorry - I can't seem to find a "Qt" related group. > Thanks!
There are several listservs dedicated to QT. http://lists.trolltech.com/ I suggest you visit the trolltech website for tutorials and documentation. I think that you might want to look at QMouseEvent and related properties. -- Jerry Feldman <gaf-nospam-at-blu.org> Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9




[ Post a follow-up to this message ]



    Re: Programmatically move the mouse?  
J. Patrick Brandt


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:33 PM

Follow-up:

I am actually using Qt/embedded, so I am able to use
QWSServer::sendMouseEvent(qpoint, buttonstate)...

I trap the MouseMove events in an eventFilter and (as needed) do a
sendMouseEvent of my own.

This makes the mouse cursor *look* ok on the screen (e.g. it moves where I
want) but the "real" position seems to be remembered by something deeper.

I haven't tried it on the target system so I have hope it will work [and
that the position is confused in my emulation by the underlying X11 system].

I think I am getting close.

Thanks for the replies.

"J. Patrick Brandt" <spambait@null.com> wrote in message
news:939Gb.55987$pY.34251@fed1read04...
quote:
> Does anyone even know if it is possible programmatically to reposition the > mouse cursor [using Qt under Linux]? > > Any hints appreciated. I am trying to "trap" the mouse cursor to the
visible
quote:
> area of a framebuffer (e.g. TV out - the visible part of the screen is
less
quote:
> than the full x-y resolution, depending on the monitor...) > > I can catch mouseMoveEvents and send my own (which I receive) but the
cursor
quote:
> doesn't move, so all I am doing is sending "extra" events, not affecting
the
quote:
> mouse. > > What I would like to do is something like "if x<100 then move mouse to > (100,y)", etc. > > Sorry - I can't seem to find a "Qt" related group. > Thanks! > >




[ Post a follow-up to this message ]



    Re: Programmatically move the mouse?  
Bak


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:33 PM

"J. Patrick Brandt" <spambait@null.com> wrote in message news:<tJoGb.61932$pY.34942@fed1read04>...
[QUOTE]
> Follow-up:
>
> I am actually using Qt/embedded, so I am able to use
> QWSServer::sendMouseEvent(qpoint, buttonstate)...
>
> I trap the MouseMove events in an eventFilter and (as needed) do a
> sendMouseEvent of my own.
>
> This makes the mouse cursor *look* ok on the screen (e.g. it moves where I
> want) but the "real" position seems to be remembered by something deeper.
>
> I haven't tried it on the target system so I have hope it will work [and
> that the position is confused in my emulation by the underlying X11 system
].
>
> I think I am getting close.
>
> Thanks for the replies.
>
> "J. Patrick Brandt" <spambait@null.com> wrote in message
> news:939Gb.55987$pY.34251@fed1read04... 
>  visible 
>  less 
>  cursor 
>  the 

Hello
Your counsel is helpful.
but i don't work.

I'd like to generate mouse event(mouse left button down, up, move).
I am using Qt 3.2.3.
I don't find QWSServer class.
"qwindowsystem_qws.h"
this file do not exist in my linux system.

Why?
How do i use QWSServer?.
thanks!!.





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:27 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register