MOUSESTATE is always zero in iPhone

Previous topic - Next topic

msx

The problem is that when touching with your finger covering large areas can not assure that this bug exists.

quangdx

Okay, one more attempt
You say the iPhone is not picking up any detection in the top part of the screen,
where the status bar for signal coverage and battery are shown.
This code example splits the screen into 30 strips of 16 pixels and detects when you are touching inside one of the strips.
If there is a problem with your touch screen then you will not be able touch the first strip.
Let us know how it responds.
Code (glbasic) Select

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

GLOBAL Zone[]
DIM Zone[30]
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
IF TouchB1[i]
Zone[ASR(TouchY[i],4)]=1
ENDIF
NEXT
FOR i=0 TO 29
DRAWLINE 0,i*16,320,i*16,RGB(255,255,255)
IF Zone[i]=1
DRAWRECT 0,i*16,320,16,RGB(255,255,255)
ENDIF
Zone[i]=0
NEXT
SHOWSCREEN
WEND

Asobi tech - the science of play.
Spare time indiegame developer.

msx

Here you have a little test I did, you will observe that the touch screen behaves differently according to the area.


ampos

My app on TV!

The code I use is

Code (glbasic) Select
IF mouse.x=0 THEN mouse.x=1
IF mouse.x>479 THEN mouse.x=479
x=mouse.x+RND(6)-3;y=mouse.y+RND(3)-1
IF x<1 THEN x=1
IF x>478 THEN x=478
IF y<1 THEN y=1
IF y>318 THEN y=318


perhaps my program is not the best for testing, but it is a thing I noted yesterday:

The X (perhaps the Y too) coordinate only start showing values when X>20 (or a number similar, not tested really) but if you move the mouse/finger to the left it can answer values <20.

You have to start not-near the left border, but then you can move to the left with no problem.

erico

Quote from: ampos on 2011-May-26

The X (perhaps the Y too) coordinate only start showing values when X>20 (or a number similar, not tested really) but if you move the mouse/finger to the left it can answer values <20.

You have to start not-near the left border, but then you can move to the left with no problem.

something more or less similar to wacom tablets behavior. After tracking the pen, they can even track it a little outside the tablet/screen area.

quangdx

It's kind of how a capacitive digitiser works,
as it's reading fingers, which aren't as precise as a resistive touch stylus,
it works out from what information it gets of the blob that is a finger to chose a point.
And according to ampos' code, it's acting as it should.

As far as I can tell there is no problem with your device or GLBasic,
it's just how it is with a capacitive touch screen.
Asobi tech - the science of play.
Spare time indiegame developer.