Re: Gtk over DirectFB - Moving mouse pointer through API
- From: nikhil1986 <nikhil live ca>
- To: gtk-list gnome org
- Subject: Re: Gtk over DirectFB - Moving mouse pointer through API
- Date: Thu, 15 Oct 2009 14:07:56 -0700 (PDT)
Hi lkcl,
I am trying to use uinput to make my mouse pointer move and register
keystrokes. However, when I compile the program you have linked to (this
seems to be the most popular program example on the web), everytime I run
it, when it asks me for an input, I enter 'A' for example and my system
crashes and restarts.
I also tried using another example which moved the mouse pointer every
couple of seconds. Now I found it strange that the mouse pointer doesn't
physically move, but there is some virtual unseen pointer which keeps moving
(I know this because I get mouse rollover effects every couple of seconds).
The 2nd question isn't as important as the first, as I cannot figure out why
the program is crashing. Why did the author use a getchar() to ask for
input? I am very confused as to how this program works. Any help would be
appreciated. Thanks a lot.
lkcl wrote:
>
>
>
> Harinandan S wrote:
>>
>> Hi All,
>>
>> I am using Gtk 2.12.2 over DirectFB 1.1.1. I get prints
>> saying gdk_display_warp_pointer is not implemented. Is there any other
>> way
>> to move mouse pointer?
>>
>> Regards,
>> Harinandan S
>>
>
> harinandan, hi,
>
> you can always use the linux userspace uinput kernel module to simulate
> key and mouse events, programmatically. see the following:
> http://lkcl.net/software/uinput/
>
> this is a working example - you _will_ need to initialise both keyboard
> _and_ mouse ioctls otherwise uinput refuses to work, inexplicably. the
> example shows moving the mouse cursor to the right by a small margin;
> pressing the "a" key; releasing the "a" key and then reading the program's
> stdin using getchar() to receive the "a" key.
>
> l.
>
> p.s. if you don't do the "release" then you get a stream of "a"s because,
> well, duh, the key is being held down.
>
>
--
View this message in context: http://www.nabble.com/Gtk-over-DirectFB---Moving-mouse-pointer-through-API-tp22635749p25916050.html
Sent from the Gtk+ - General mailing list archive at Nabble.com.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]