Mouse plugin

Questions and comments specific to a particular plugin should go here.
Post Reply
User avatar
Fiasco
Plugin Developer
Posts: 222
Joined: Fri Jul 24, 2009 5:32 am
Location: St. Louis MO
Contact:

Mouse plugin

Post by Fiasco » Mon Aug 05, 2019 5:41 pm

I am sending my iphones pitch and yaw to eventghost to attempt to use it as a mouse control on my HTPC.

UDP broadcasts come as "yaw", "value" and "pitch", "value"

Is it possible to set the mouse position on screen with variable data coming from events with the mouse plugin?

It's been a loooong time since I have done anything new with eventghost. I was actually stunned to see the Onkyo serial plugin as part of the distribution that I wrote so many years ago.

User avatar
Fiasco
Plugin Developer
Posts: 222
Joined: Fri Jul 24, 2009 5:32 am
Location: St. Louis MO
Contact:

Re: Mouse plugin

Post by Fiasco » Mon Aug 05, 2019 6:43 pm

I'm trying to do a python command with the payload
eg.plugins.Mouse.MoveAbsolute(eg.event.payload)

How do I need to format the eg.event.payload line for the mouse plugin?

User avatar
Fiasco
Plugin Developer
Posts: 222
Joined: Fri Jul 24, 2009 5:32 am
Location: St. Louis MO
Contact:

Re: Mouse plugin

Post by Fiasco » Tue Aug 06, 2019 9:31 pm

I was able to figure it out.

eg.plugins.Mouse.MouseAbsolute(int(eg.event.payload[0]),int(eg.event.payload[1]))

I created a "magic" remote as part of my home CommandFusion remote on our iphones. It uses the gyro data from the iphone to figure out where your iphone is pointed and moves the mouse cursor around on the TV screen with mouse click as well as scroll wheel dragging on the right side of the screen.

User avatar
kgschlosser
Site Admin
Posts: 5144
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Mouse plugin

Post by kgschlosser » Tue Aug 06, 2019 9:55 pm

OK that just sounds pretty bad ass i must say..

I will guarantee there is no other HA software that would allow that to be possible.

Now here is the real cool thing about something like that..
A lot of TV's come with remote controls that either have a joy or use a gyroscope. Samsung TV's are one of them. I know how to control the mouse movements on Samsung TV's. So you can do the same thing as what you did except it would move the native mouse for the TV.
If you like the work I have been doing then feel free to Image

User avatar
Fiasco
Plugin Developer
Posts: 222
Joined: Fri Jul 24, 2009 5:32 am
Location: St. Louis MO
Contact:

Re: Mouse plugin

Post by Fiasco » Tue Aug 06, 2019 10:37 pm

Commandfusion demo allows a single page without paying. If there’s interest I’ll break the mouse control out of my full remote and make a demo zip file available

User avatar
kgschlosser
Site Admin
Posts: 5144
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Mouse plugin

Post by kgschlosser » Wed Oct 23, 2019 7:00 pm

I messed about with this some. There are some simple apps available that will transmit the accelerometer and the gyroscope data from an android device to a PC. The interpretation of the data is the complex part and putting in place smoothing routines to get rid of "float". The really hard part is calibration.. There needs to be some kind of a calibration routine in order to set the angle of travel. If you take a TV and it is a 60" that is 5 feet away. the angle of travel for your arm is going to be much greater then the same TV at 15 feet. so in order to keep the mouse pointer in line with where you are pointing the "remote" this needs to be accounted for. Toss in there the resolution of the screen and now it gets to be some pretty complex math. Mouse movements are comprised of acceleration factor, max speed and angle of travel so those numbers would need to be calculated correctly. I have looked and there is not a single "air mouse" app for an android device that takes these factors into consideration. it assumes you are using it on a PC monitor.. I have a 3 monitor setup on my PC so the angle of travel is about 90 degrees where as if I had a single monitor it would be about 25 degrees. because the apps available use a pre defined set of metrics for say a 1920 x 1080 screen at some unknown screen size the apps do not properly handle the cursor to device locations. They also do not take into account multiple monitors. so from 0, 0 for a location with is the upper left hand corner of my primary monitor i have one to the left and one to the right so the actual screen area is -1920, 0 to 3840, 1080 this shifts the cursor movement from the device movement.

You also have the biggest issue is that not a single one of these applications is designed for single hand use. they have the left and right buttons out of reach of a thumb and it could cause you to drop the device if you are trying to use it single handed which is how you would use the thing.

I am not an android developer I would not know how to go about making a proper GUI for the device.. If someone has that knowledge then we can work together and hammer this out no problem. I love the idea of being able to do this But I do not have the time to learn development for android.
If you like the work I have been doing then feel free to Image

Post Reply