This commit is contained in:
Dante
2026-05-21 23:40:20 -07:00
parent 3e2915dff7
commit 877a69d844
5737 changed files with 29796 additions and 1589684 deletions

View File

@ -12,6 +12,12 @@ enum TouchDownEventBlockBehavior {
class Surface {
static var touchDownEventBlockBehavior = TouchDownEventBlockBehavior.Full;
/**
Sets to `true` after first `surface.notify` call,
so touch events will not be duplicated as `Mouse` events.
**/
static var listenedEventsBefore = false;
/**
* Get current Surface.
* @param num (optional) surface id (0 by default).
@ -41,6 +47,7 @@ class Surface {
*/
public function notify(?touchStartListener: (id: Int, x: Int, y: Int) -> Void, ?touchEndListener: (id: Int, x: Int, y: Int) -> Void,
?moveListener: (id: Int, x: Int, y: Int) -> Void): Void {
listenedEventsBefore = true;
if (touchStartListener != null)
touchStartListeners.push(touchStartListener);
if (touchEndListener != null)