More problems and Questions

General discussions about Automagic and automation in general

Moderator: Martin

Post Reply
StillLearning
Posts: 7
Joined: 11 Jan 2016 04:13

More problems and Questions

Post by StillLearning » 17 Mar 2016 18:05

Well, more questions.

1) How do I get the proper X,Y screen touch when getevent returns the devices normal orientation dimensions

By this I mean a phone is a normal portrait orientation device. So even though the device is in landscape mode
getevent returns X,Y based on the portrait orientation. Which of course is completely wrong for using in the Input tap x y command.

Port = 1080 x 1920
Land = 1920 x 1080

yes, X and Y are switched but

Tapping X,Y should be different depending on orientation, but getevent always returns the X,Y as portrait orientation.

So Execute root command: Input tap x y is "always" wrong when device is in landscape mode. (aside from the x,y being switched)

pointer location is always correct and this is the x,y that I thought I would get from the call...WRONG

So how do I get the same X,Y as pointer location returns? This is critical.

*****************

2). How do I get the proper X,Y from a left mouse click? Most of the devices I am coding for are non-touch devices.

Android TV boxes attached to a TV.

To me the getevent for a mouse is reporting mouse movement x,y which seems to be useless junk. No Absolute X Y.

I need the proper X,Y returned on a mouse click.

****************

3). How do I create a directory?

4). Where is the hex to decimal conversion function? getevent returns hex coordinates?

5). Is there a way to switch between apps by using the recent display?

Using Start Activity ended trigger always starts the app at the beginning. I expected a return type of action.

It also destroys all the the calling apps variables.

Thank you for your time in providing answers. #1 & #2 are critical.

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: More problems and Questions

Post by MURTUMA » 17 Mar 2016 18:36

It should be easy to calculate the position in a script action. First check device orientation and then do calculations as necessary.

x0,y0 is upper right corner at least in my device.
so if getevent returns 0,100 first change the x's and y's places
100,0
the landscape x value is 1:1 to portrait y value
landscape y is calculated by substracting portrait x value from max landscape y value
x,y -> y,1080-x
youll get 100,1080-0 = 100,1080

After a few erroneous thoughts and edits, this should finally be right. That is if I understood you correctly to begin with.

The rest is something, I can't help you with due to my ancient device.

StillLearning
Posts: 7
Joined: 11 Jan 2016 04:13

Re: More problems and Questions

Post by StillLearning » 17 Mar 2016 23:15

Wow, Thanks for the speedy reply on critical #1. Your math solution does provide a valid X,Y.

I find it strange that the Android OS doesn't return the correct X,Y as per orientation.

Now if I can get a working resolution for critical #2 then I can plow forward.

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: More problems and Questions

Post by MURTUMA » 18 Mar 2016 19:34

Are you sure the logs doesn't show any relevant data on position when you click with mouse? Maybe you have missed something?

Maybe you can paste the logs here?

StillLearning
Posts: 7
Joined: 11 Jan 2016 04:13

Re: More problems and Questions

Post by StillLearning » 29 Mar 2016 18:02

I have a device that is is version 4.2.2. It is a Asus Nexus 7 (2012). There is no update to a greater version so this is what I have to work with it seems.

My questions relates to the previous #1 that was answered by Murtuma as far as landscape and portrait orientation adjustment.

BUT.. this device has 0,0 in the lower left and I don't know the math to get the correct rotate values.

#1a. What is the correct math to calculate the proper rotation of x:y to the upper left to match the pointer bar??

#1b. How can the getevent (for touch) return screen X:Y greater then the screen size?

I am coding another device a Google Nexus 7 (2012) Version 4.4.4 ... Both this unit and the Asus unit return greater numbers?

#2. Does anyone else have either of these units (rooted) with this problem?

I know this is off topic and app.

#3. Does anyone have or know of an OS image greater the 4.2.2 for the Asus?

I still really need to understand the getevent X:Y for the mouse as it always returns mouse movement and the X:Y cord are rel-X fffffe and rel-Y fffff3.

If this is relative to my last move that is worthless. What is my current X:Y?

#4. How do I get the current X:Y on left mouse click??

I have 6 non-touch devices that I need this X:Y information from as duh no touch.

I understand that Android was built for a touch unit but the TV's that the android boxes plug into are not touch and it would be impractical if they did.

Sorry for the rambling. I'm in my 60's with failing sight so any problems are getting harder to overcome.

Thank you for your time and help.

Post Reply