
Hi all! I'm playing with a little accelerometer and I want to see how well I can get it to work in Inkscape so that it would replace the mouse. I was wondering if anyone could tell me where exactly the mouse location is read? I am literally going to plug code to read this accelerometer there instead. Clearly, this is not work that will be usable in Inkscape! Just for fun :)
Thanks, Gail

On Nov 15, 2007 12:11 PM, Gail Carmichael <gbanaszk@...1686...> wrote:
Hi all! I'm playing with a little accelerometer and I want to see how well I can get it to work in Inkscape so that it would replace the mouse. I was wondering if anyone could tell me where exactly the mouse location is read? I am literally going to plug code to read this accelerometer there instead. Clearly, this is not work that will be usable in Inkscape! Just for fun :)
We get all mouse position information from the events sent by GTK. The code to parse these events is actually all over the place - in tool contexts etc.

bulia byak wrote:
We get all mouse position information from the events sent by GTK. The code to parse these events is actually all over the place - in tool contexts etc.
Oh, boo! That might make it a bit more difficult. Thanks for the info (any anything else anyone can add).
Gail

What about using the snooper function I added to main.cpp to intercept the ALT key? The "event" parameter in that function should have mouse info in it which can be fiddled with before being handed on to the rest of the application. One of the reasons I went for the snooper method is that it is very often useful to have a central point where events can be manipulated and I thought it might come in handy for things other than the ALT key one day. Is this that day?
Thomas
On Thu, 15 Nov 2007 17:42:00 -0000, Gail Carmichael <gbanaszk@...1686...> wrote:
bulia byak wrote:
We get all mouse position information from the events sent by GTK. The code to parse these events is actually all over the place - in tool contexts etc.
Oh, boo! That might make it a bit more difficult. Thanks for the info (any anything else anyone can add).
Gail
This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel

Last year I had to interface some code with a magnetic board which sends stylus position on the serial port. My code needed to be used with the mouse too so I had a lot of code duplication to handle both event stream. I wandered at that moment how hard it would be to develop an actual X input driver for the device (that could then replace the mouse in virtually any application).
just a thought.
regards, Christophe.
On Nov 15, 2007 6:42 PM, Gail Carmichael <gbanaszk@...1686...> wrote:
bulia byak wrote:
We get all mouse position information from the events sent by GTK. The code to parse these events is actually all over the place - in tool contexts etc.
Oh, boo! That might make it a bit more difficult. Thanks for the info (any anything else anyone can add).
Gail
This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel

On Nov 15, 2007 6:56 PM, Christophe Dehais <christophe.dehais@...400...> wrote:
I wandered at that moment how hard it would be to develop an actual X input driver for the device (that could then replace the mouse in virtually any application).
On the same line, you could design an external program that modifies the mouse position. greasymouse [1] show how to modify the mouse position. The program here [2] is a bot that plays the flash game zookeeper automatically and may also have interesting code regarding the generation of X events.
[1] http://www.ibiblio.org/pub/X11/contrib/amusements/ [2] http://cima.ng-london.org.uk/~john/zoobot.c
Christophe

On Thu, 15 Nov 2007 12:42:00 -0500, Gail Carmichael <gbanaszk@...1686...> wrote:
bulia byak wrote:
We get all mouse position information from the events sent by GTK. The code to parse these events is actually all over the place - in tool contexts etc.
Oh, boo! That might make it a bit more difficult. Thanks for the info (any anything else anyone can add).
Have you considered injecting synthetic mouse events into the GDK event queue using gdk_event_put?
-mental

The code used for getting the wii controllers to work as mice might be worth a look too, not sure how they're doing it but the first mode they had was pure accels I believe. Try having a dig at: http://www.wiili.org/Main_Page
On 11/15/07, MenTaLguY <mental@...3...> wrote:
On Thu, 15 Nov 2007 12:42:00 -0500, Gail Carmichael < gbanaszk@...1686...> wrote:
bulia byak wrote:
We get all mouse position information from the events sent by GTK. The code to parse these events is actually all over the place - in tool contexts etc.
Oh, boo! That might make it a bit more difficult. Thanks for the info (any anything else anyone can add).
Have you considered injecting synthetic mouse events into the GDK event queue using gdk_event_put?
-mental
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel

MenTaLguY wrote:
Have you considered injecting synthetic mouse events into the GDK event queue using gdk_event_put?
I hadn't... Thanks for the ideas mental and everyone else! I will let you know what I end up doing and, more importantly, how easy it is to use. It will probably be based on orientation rather than movement, because it is really hard to get position from a single accelerometer (though if anyone can prove me wrong, please do!). So I don't expect it to be all that great ;)
Gail
participants (6)
-
bulia byak
-
Christophe Dehais
-
Gail Carmichael
-
john cliff
-
MenTaLguY
-
Thomas Worthington