Multitouch Strange Behaviour
Monkey Targets Forums/Android/Multitouch Strange Behaviour| 
 | ||
| Update: It seems it's the Nexus One. http://androidandme.com/2010/03/news/is-multitouch-broken-on-the-nexus-one/ Having said that, there appears to be a bug in the native mojo code anyway. In mojo.androidgl.java lines 71-72 (in the onTouchEvent method), you should be reading X and Y from the pointer ID, like this: input.touchX[pid2]=event.getX(pid2); input.touchY[pid2]=event.getY(pid2); I guess I'm buying a new phone... :( ------------------------------------------------------ Try out this code and move your fingers around. See the problem? TouchX and TouchY seem to get confused about which event to take the value from as the X and Y values cross over. I'm trying to use two virtual sticks (see my code in the Monkey Code forum) but they're messing each other up. Testing on a Nexus One running Gingerbread (2.3.3). It appears my phone and/or OS version only supports two touches. 
strict
import mojo
function Main:int()
	new MyApp
	return 0
end
class MyApp extends App
	method OnCreate:int()
		SetUpdateRate(120)
		return 0
	end
	
	method OnUpdate:int()
		return 0
	end
	
	method OnRender:int()
		Cls(0,0,0)
		local dy:int = 30
		for local i:int = 0 to 31
			if TouchDown(i) then
				if i mod 2 = 0 then
					SetColor(255,0,0)
				else
					SetColor(0,0,255)
				end
				DrawCircle(TouchX(i),TouchY(i),50)
				SetColor(255,255,255)
				DrawText(""+i, 10, dy)
				DrawText(""+int(TouchX(i)), 40, dy)
				DrawText(""+int(TouchY(i)), 80, dy)
				dy+=20
			end
		end
		DrawText("idx",10,10)
		DrawText("x",40,10)
		DrawText("y",80,10)
		return 0
	end
end
 | 
| 
 | ||
| my samsung galaxy is working same so only two first fingers / touches are working | 
| 
 | ||
| I have more than 10 fingers on Galaxy S2, but I used also firepaint to test, and ran out of fingers. | 
| 
 | ||
| . | 
| 
 | ||
| @Bladum I forget how many fingers I could use in the Firepaint demo, but it was definitely more than two (at least five... ahgrhh just can't remember). I too have a Galaxy S. Try *that* demo and see what you get. | 
| 
 | ||
| This thread is months old. :)  The forum software doesn't seem to understand the first day of every month and screws up all the post times. Anyway, it's a hardware limitation of the screen used on the Nexus One. The "multitouch" on it is a dirty hack that only supports two fingers and plays up in certain situations. Google added the hack in an OTA update long after the N1 was released. | 
| 
 | ||
| my samsung galaxy ace works exacly same, 2 fingers are working fine, when 3rd is touched then two first seems to be frozen, according to phone specs this has 16 Multi touch screen | 
| 
 | ||
| @Bladum: With the Firepaint demo, Seriously? That stinks. @Samah: The forums are not screwed up... It's a *feature* !! Old post are made new again by recycling. Very green of them. This also has the upshot of giving the appearance the we are more active. Seriously, I was wondering why post and responses were showing 13 minutes ago but were actually old responses. Now I know. |