Skip to content

Add Mobile-specific events #3508

@Lorenzooone

Description

@Lorenzooone

Prerequisite Checklist

Describe your feature request here

Currently, Mobile events are weird. Especially for Android.

  • onPause triggers a MouseLeft.
  • onResume triggers a MouseEntered.
  • Rotating the screen (an event different from handleResized, which is triggered when you pop up the Android UI) triggers a Resized.
  • FocusGained triggers the creation of the surface.
  • FocusLost triggers the destruction of the surface.

I think these events should be separated, or at least aliased in some way (and better documented, not just present in an example for the user to find).
The risk I see with recycling events like this (aside from the opacity of it all) is that it makes the code really not portable, in some ways.

Use Cases

Better handling of events to write portable code, which doesn't require ifdefs.

API Example

Proposals:
onPause -> AppBackground
onResume -> AppForeground
screen Rotation -> ScreenRotated
FocusGained -> CreateSurface (internal, no need to propagate it)
FocusLost -> DestroySurface (internal, no need to propagate it)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions