hashlink icon indicating copy to clipboard operation
hashlink copied to clipboard

[SDL] Precision of mouseX/mouseY in Touch events

Open deepnight opened this issue 4 years ago • 3 comments

https://github.com/HaxeFoundation/hashlink/blob/3767c47e42fd1f6b990b8c4e87e1c23ae825314b/libs/sdl/sdl.c#L187-L188

For some reason, the X/Y coords of Touch related events (down/up/move) are 0-100 based. This is incredibly low for any modern screen.

Is it possible to use actual screen coords or at least a much higher precision range here?

deepnight avatar Jan 03 '20 14:01 deepnight

Is the input range 0-1 ? If yes then yes it should scaled by something like 65536 Maybe requires some changes on Heaps side as well.

ncannasse avatar Jan 06 '20 19:01 ncannasse

Yes base value is 0-1 according to SDL api. Isn't it possible to match the actual context size, as expected for a mouseX/Y value?

deepnight avatar Jan 06 '20 20:01 deepnight

I have no idea, it was originally contributed as part of native mobile support in #101 (ping @rtissera)

ncannasse avatar Jan 06 '20 20:01 ncannasse

It's been increased to 10000 since then.

ncannasse avatar Feb 06 '23 10:02 ncannasse