MOUSEAXIS(0) [X] return 319 more than it should in Landscape? GETMOUSECOUNT 16?

Previous topic - Next topic

Moebius

It seems that on the iPhone MOUSEAXIS(0), the X speed, is always 319 above what it should be!  I also note that when the program first starts up, MOUSESTATE reports that the Y position is at 319, which isn't really a problem - however, one would expect the 'mouse' position to be initialised at (0,0) not (0,319), and it seems very coincindental that the X speed would match this...
I haven't been able to test this at any higher res. than 320x480 (Portrait & Landscape) because of my older device, but it's very strange that the X speed in landscape is 1 less than the width in portrait (rotation issues?)

Also, it seems that GETMOUSECOUNT consistently returns 16.  Isn't it meant to return the current number of fingers?


Anway, just run the following to see what I mean, and try portrait and landscape:
Code (glbasic) Select
LOCAL mx%, my%, b1%, b2%

WHILE TRUE

PRINT "MOUSEAXIS:", 0, 0
FOR i = 0 TO 5
PRINT i + ":" + MOUSEAXIS(i), 10 + i * 52, 20
NEXT
PRINT "MOUSESTATE:", 0, 50
MOUSESTATE mx%, my%, b1%, b2%
PRINT "mx:" +mx, 10, 70
PRINT "my:" +my, 80, 70
PRINT "b1:" +b1, 150, 70
PRINT "b2:" +b2, 220, 70
PRINT "GETMOUSECOUNT: " + GETMOUSECOUNT(), 0, 100
SHOWSCREEN

WEND


It seems to me that something is going wrong in rotation of points or something because the problem only occurs in landscape 480x320, and suspiciously the X speed is as great as it can be for the width in portrait mode (0 - 319).  I don't understand much about what GLBasic does on the iPhone anyway, but hopefully (for me at least) this is reproduceable.
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary

matchy

I suggest compiling in default settings portrait then using opengl rotation for orientation and code for mouse rotation. Add each mouse button for the finger count.

Moebius

Thanks for the ideas matchy - hopefully I won't have to resort to my own rotation.
Ideally the app should work fine regardless of the resolution settings anway though.  Also it would be nice to have an inbuilt function check the number of pointers as well rather than coding it yourself, although a simple loop isn't that hard at all.
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary

Kitty Hello

no - each mouse is a POSSIBLE finger! You can iterate through the list of possible touches with FOR i=0 TO GETMOUSECOUNT()-1
and see if a touch is on with MOUSEAXIS x,y,a,b; IF a...
That way you can keep track of touches for fingers 2,3, even if fingers 0 and 1 are released.

Moebius

Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary