<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>PiCassoTizer - Absolute Mouse Position - HID Simulation - Blog 4</title><link>/challenges-projects/design-challenges/picasso/b/blog/posts/picassotizer---absolute-mouse-position---hid-simulation---blog-4</link><description>The last PiCassoTizer blog showed how the touch screen was going to work using image processing on Raspberry Pi&amp;#39;s to monitor finger position.This blog shows the other end, where a Raspberry Pi is used to edit screen graphics using external position i</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: PiCassoTizer - Absolute Mouse Position - HID Simulation - Blog 4</title><link>https://community.element14.com/challenges-projects/design-challenges/picasso/b/blog/posts/picassotizer---absolute-mouse-position---hid-simulation---blog-4</link><pubDate>Mon, 29 Apr 2019 18:59:18 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:44ea441c-f3b4-4ef8-a279-8b6eff1286b7</guid><dc:creator>DAB</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Good update Douglas.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;DAB&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=6953&amp;AppID=224&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: PiCassoTizer - Absolute Mouse Position - HID Simulation - Blog 4</title><link>https://community.element14.com/challenges-projects/design-challenges/picasso/b/blog/posts/picassotizer---absolute-mouse-position---hid-simulation---blog-4</link><pubDate>Mon, 29 Apr 2019 18:06:32 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:44ea441c-f3b4-4ef8-a279-8b6eff1286b7</guid><dc:creator>shabaz</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Hi Doug,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Great work on the very novel mouse! The graphics drawing reminds me a little of etch-a-sketch : )&lt;/p&gt;&lt;p&gt;Also, if the two linear pots were connected to perpendicular rails with slots, you could insert an pen in the intersection of the slots, and have a digitizer : )&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=6953&amp;AppID=224&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: PiCassoTizer - Absolute Mouse Position - HID Simulation - Blog 4</title><link>https://community.element14.com/challenges-projects/design-challenges/picasso/b/blog/posts/picassotizer---absolute-mouse-position---hid-simulation---blog-4</link><pubDate>Mon, 29 Apr 2019 17:15:20 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:44ea441c-f3b4-4ef8-a279-8b6eff1286b7</guid><dc:creator>balearicdynamics</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Gene is trough! While trying to suggest you the better and the best I forgot to say that the approach is really nice &lt;span&gt;[View:/resized-image/__size/16x16/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-44ea441c-f3b4-4ef8-a279-8b6eff1286b7/contentimage_5F00_2516.png:16:16]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Enrico&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=6953&amp;AppID=224&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: PiCassoTizer - Absolute Mouse Position - HID Simulation - Blog 4</title><link>https://community.element14.com/challenges-projects/design-challenges/picasso/b/blog/posts/picassotizer---absolute-mouse-position---hid-simulation---blog-4</link><pubDate>Mon, 29 Apr 2019 16:28:53 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:44ea441c-f3b4-4ef8-a279-8b6eff1286b7</guid><dc:creator>genebren</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Doug,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Nicely done.&amp;nbsp; Great demonstration of your HID mouse half of your camera driven mouse.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Great work!&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Gene&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=6953&amp;AppID=224&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: PiCassoTizer - Absolute Mouse Position - HID Simulation - Blog 4</title><link>https://community.element14.com/challenges-projects/design-challenges/picasso/b/blog/posts/picassotizer---absolute-mouse-position---hid-simulation---blog-4</link><pubDate>Mon, 29 Apr 2019 11:01:27 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:44ea441c-f3b4-4ef8-a279-8b6eff1286b7</guid><dc:creator>dubbie</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Doug,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I like the simulated mouse made from two sliders. It looks like it could have value just by itself.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Dubbie&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=6953&amp;AppID=224&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: PiCassoTizer - Absolute Mouse Position - HID Simulation - Blog 4</title><link>https://community.element14.com/challenges-projects/design-challenges/picasso/b/blog/posts/picassotizer---absolute-mouse-position---hid-simulation---blog-4</link><pubDate>Mon, 29 Apr 2019 06:34:35 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:44ea441c-f3b4-4ef8-a279-8b6eff1286b7</guid><dc:creator>balearicdynamics</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Hello Doug, &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I think that there is an easier way to manage absolute mouse positions on the screen, without adding the weight of a microcontroller (Arduino, as you mention) and pass from digital to analog then to digital, etc. If I have understood correctly. Let me suggest a possible alternative.&lt;/p&gt;&lt;div class="jive_macro_alert jive_text_macro"&gt;&lt;p&gt;The issue you mention about the relative mouse position is not only Linux-related, but it is a hardware feature, specific of this kind of HID devices. If the hardware tracked position was not relative, it will be impossible to take a mouse in your hands, put it everywhere on the surface and move the cursor from there. The absolute mouse pointing mechanism was with the first optical mouse using a base tablet.&lt;/p&gt;&lt;/div&gt;&lt;p&gt;As you know, there is plenty of applications showing the absolute X, Y coordinates associated with the mouse movement, so IMHO you are seeing the question from the wrong point.&amp;nbsp; Trying to imagine what should happen accordingly with your explanation in the first paragraph of this post, there are a couple of software methods that probably can solve or be helpfully applied to your case.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;When the mechanism starts we should be able to move coherently the cursor on the screen, so probably it is needed a self-calibration. I suppose you will start some sort of graphics application and for example, having the cursor centered on the screen. As the display is based on the X11 server, a few lines of code (C, but not difficult to convert to Python or something else) just position the cursor where you decide.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=csharp&amp;amp;text=++++Display*+dpy+%3D+XOpenDisplay%280%29%3B%0A++++int+scr+%3D+XDefaultScreen%28dpy%29%3B%0A++++Window+root_window+%3D+XRootWindow%28dpy%2C+scr%29%3B%0A%0A++++%2F%2F+Calculate+the+current+screen+size+%28the+absolute+coordinate+system+of+the+cursor+working+area%0A++++int+height+%3D+DisplayHeight%28dpy%2C+scr%29%3B%0A++++int+width++%3D+DisplayWidth%28dpy%2C+scr%29%3B%0A++++std%3A%3Acout+%3C%3C+%22Screen+size+%3A+%22+%3C%3C+width+%3C%3C+%22x%22+%3C%3C+height+%3C%3C+std%3A%3Aendl%3B%0A%0A++++float+m+%3D+%28float%29height%2F%28float%29width%3B%0A%0A++++int+j%3B%0A++++for%28int+i%3D0%3B+i%3Cwidth%3B+i%2B%2B%29%7B%0A++++++++j+%3D+m*i%3B%0A++++++++XWarpPointer%28dpy%2C+None%2C+root_window%2C+0%2C+0%2C+0%2C+0%2C+i%2C+j%29%3B%0A++++++++XFlush%28dpy%29%3B%0A++++++++usleep%2850%29%3B%0A++++%7D]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Maybe that digging on google there is more elegant methods than this.&lt;/p&gt;&lt;p&gt;At this point, as we know where the cursor is and what is the pixel size of our motion area, these values can be considered the offset for every further mouse relative move.&lt;/p&gt;&lt;p&gt;If for some reason you should check instead what is the current mouse position and get the offset as well, the display class of the Xlib Python library does the job.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=python&amp;amp;text=fromXlibimport+display%0A%0Adef+mousepos%28%29%3A%0A++data+%3D+display.Display%28%29.screen%28%29.root.query_pointer%28%29._data%0A++return+data%5B%22root_x%22%5D%2C+data%5B%22root_y%22%5D%0A%0Aif+__name__+%3D%3D%22__main__%22%3A%0Aprint%28%22screen+position+%3A+%7B0%7D%22.format%28mousepos%28%29%29%29]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Btw, I use this method, available from the Python package python-xlib&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Hope this can be useful. Enrico&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=6953&amp;AppID=224&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>