MOUSESTATE is always zero in iPhone

Previous topic - Next topic

msx

I have a problem with the command MOUSESTATE in my iPhone. The return value is always zero for the top of the screen, where the coverage and the battery are shown. Could this be a bug?.

MrTAToad

I dont think that area is part of the screen, so no, it isn't a bug.

msx

Do you mean that the digitizer does not cover that area?

matchy

If you mean the iOS status bar, you'd mean the opengles area about 0,0 to 320,20 which should be fine.

msx

I refer specifically to the status bar. The digitizer doesn't work.

MrTAToad

#5
What is a digitizer ? 

Actually it is a full screen, so should cover everything as matchy said.  So it could be a bug...

msx

The digitizer is the touch-screen area.

matchy

"Digitizer" is a generic term that could be used to describe the keyboard or microphone also.

Please post sample code to describe your problem!

quangdx

By digitizer he's referring to the touch layer of the screen that converts your touches to co-ordinates.

Everything I've coded for the iPhone detects the whole screen from 0,0 to 320,480.
Sounds like there must be a bug somewhere in the code.
Or possibly a faulty device. The iPhone screen sometimes will lose sensitivity on certain horizontal bands of the touchscreen,.
Easiest thing would be to write some code to test the state of your touches,

Code (glbasic) Select

GLOBAL TouchX[], TouchY[], TouchB1[]
DIM TouchX[5]; DIM TouchY[5]; DIM TouchB1[5]

GLOBAL i, dummy

SETSCREEN 320,480,TRUE
SYSTEMPOINTER TRUE
LIMITFPS 30

WHILE TRUE
FOR i=0 TO 4
SETACTIVEMOUSE i
MOUSESTATE TouchX[i],TouchY[i],TouchB1[i],dummy
PRINT "x:"+TouchX[i]+" y:"+TouchY[i]+" b:"+TouchB1[i],16,i*32
NEXT
SHOWSCREEN
WEND
Asobi tech - the science of play.
Spare time indiegame developer.

erico

iphones has no such thing as calibrations right?...just a shot.

msx

#10
Let's do a test. Download the application "Snowland Free" of our friend ampos. The operation is very simple, you place in your finger on the screen and start falling snow. If you put your finger on the status bar you will see that the snow does not fall exactly at the point where you place your finger, but the snow is offset from it.


Could anyone test it with a Touchpad Stylus Pen in order to be more precise?

mentalthink

Msx, I think this is something about the iPhone, or how Ampos made the code.
In example is you touch the screen on some position, and leave the touch, the Glbasic, "memorize" this position, but if you touch, in your case the icon where is the batery and another icons, Glbasic I suppose, understand the touch, but the value turn to 0,0. Perhaps is something of you device, I don´t very sure about this. If I have time, I make youer test, and comment here.

Kinds Regards,
Iván J.

PS: Make a simple test, put the coordinates on the Screen, and you will be seure, where runs wells or where have the fail, if in the icon, you have coorcinates and make something extrage is glbasic, if not, I think is something about device or another thing.

quangdx

Here's some code to visually test the touch screen
Code (glbasic) Select

SETSCREEN 320,480,TRUE
SYSTEMPOINTER TRUE
LIMITFPS 30

GLOBAL TouchX[],TouchY[],TouchZ[],TouchB1[]
DIM TouchX[5]
DIM TouchY[5]
DIM TouchZ[5]
DIM TouchB1[5]

GLOBAL i,dummy

WHILE TRUE
FOR i=0 TO 4
SETACTIVEMOUSE i
MOUSESTATE TouchX[i],TouchY[i],TouchB1[i],dummy
IF TouchB1[i]=1
DRAWRECT TouchX[i]-32,TouchY[i]-32,64,64,RGB(255,255,255)
ENDIF
NEXT
SHOWSCREEN
WEND
Asobi tech - the science of play.
Spare time indiegame developer.

msx

I do not think that example is useful because the problem is that the zero of the digitizer screen does not match the zero of the graphical display . Your example will draw the square where it thinks you has touched but this is not meant to work properly.

quangdx

Quote from: msx on 2011-May-25
I do not think that example is useful because the problem is that the zero of the digitizer screen does not match the zero of the graphical display . Your example will draw the square where it thinks you has touched but this is not meant to work properly.

Then check my previous post where I wrote code to print up the x,y co-ordinates of each touch and the button/touch status.
http://www.glbasic.com/forum/index.php?topic=6326.msg50522#msg50522
Asobi tech - the science of play.
Spare time indiegame developer.