You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's mostly working except a big problem I've found (that happens at least in my setup)...while I'm getting perfectly valid float coordinates in x,y and pressure from Java (up until Android_OnTouch is called), calls from there on get their float parameters completely corrupted, like there's a different calling convention at work, or different float precision, something that I can't put my finger on...
I've left some debug printfs in the files so it's easier to look at this for anyone wanting to.
The printf inside Android_OnTouch prints valid, logic (as in they make sense) coordinates. But the printfs in SDL_SendFingerDown and SDL_SendTouchMotion print gibberish.
A sample:
Android_OnTouch: touch_device_id_in: 3, pointer_finger_id_in 0, action 2, x 937.267761, y 238.000000, p 1.600000
SDL_SendTouchMotion: id: 3, fingerid 0d, relative 0, xin 4.415300, yin 36893488147419103232.000000, pressurein 4.415300
Android_OnTouch: touch_device_id_in: 3, pointer_finger_id_in 0, action 2, x 979.234985, y 239.000000, p 1.200000
SDL_SendTouchMotion: id: 3, fingerid 0d, relative 0, xin 4.456284, yin 2.000000, pressurein 4.456284
On 2011-08-29 18:32:45 +0000, Gabriel Jacobo wrote:
Created attachment 692
Multitouch for Android
That wasn't so hard (I was missing a header) but it took me hours to figure out where the problem was! Multitouch should work with this patch.
On 2011-08-30 11:40:57 +0000, Gabriel Jacobo wrote:
Created attachment 694
Multitouch for Android
Adding a new version that accounts for two action types that are deprecated but are still being emitted by Android.
On 2011-08-31 05:21:09 +0000, Tim Angus wrote:
Looks pretty good, though the values of touch.native_xres and yres are wrong. The correct settings are actually commented out. It seems the original author has missed the point that the values that come out of the touch events are normalised to 0<=x<=32768. This is explained, though not very prominently, in README.touch. The code should look like this:
This brings it inline with how the iOS and X11 touch versions do things. We don't really want to deviate from what other platforms do as that defeats the point of SDL. It's probably also worth removing the commented code in the same function that was responsible for emulating mouse clicks.
To be fair the SDL touch API is quite confusing and perhaps deserves a little bit of a review before it gets deployed/used too much.
On 2011-08-31 05:59:21 +0000, Gabriel Jacobo wrote:
I understand, though I'd like to ask (out of curiosity) why was this decision made to normalize the coordinates to 0->32768 instead of a more natural 0->screen resolution or 0->window size, for example, which makes the coordinates in line with the values you get out of mouse events.
On 2011-08-31 06:16:19 +0000, Tim Angus wrote:
I don't know. My guess is the original author of the touch API (it was a GsoC project right?) was initially developing for pen based graphics tablets which don't have a screen resolution per se. That's just conjecture though.
On 2011-08-31 07:07:14 +0000, Gabriel Jacobo wrote:
Created attachment 695
Multitouch for Android
New patch following Tim's advice.
On 2011-10-12 22:28:20 +0000, Ryan C. Gordon wrote:
This patch is now hg changeset f324bd81b52c, thanks!
--ryan.
The text was updated successfully, but these errors were encountered:
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
Multitouch for Android, includes debug stuff, dont use in production (multitouch.diff, text/plain, 2011-08-29 16:52:52 +0000, 7819 bytes)Multitouch for Android (multitouch.diff, text/plain, 2011-08-29 18:32:45 +0000, 6573 bytes)Multitouch for Android (multitouch.diff, text/plain, 2011-08-30 11:40:57 +0000, 6866 bytes)Reported in version: HG 2.0
Reported for operating system, platform: Android (All), ARM
Comments on the original bug report:
On 2011-08-29 16:52:52 +0000, Gabriel Jacobo wrote:
On 2011-08-29 18:32:45 +0000, Gabriel Jacobo wrote:
On 2011-08-30 11:40:57 +0000, Gabriel Jacobo wrote:
On 2011-08-31 05:21:09 +0000, Tim Angus wrote:
On 2011-08-31 05:59:21 +0000, Gabriel Jacobo wrote:
On 2011-08-31 06:16:19 +0000, Tim Angus wrote:
On 2011-08-31 07:07:14 +0000, Gabriel Jacobo wrote:
On 2011-10-12 22:28:20 +0000, Ryan C. Gordon wrote:
The text was updated successfully, but these errors were encountered: