Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add methods to simulate input events. #92198

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented May 21, 2024

Add input event simulation support (on OS level), to allow automated UI (native windows interaction) testing (can be useful for other tasks as well).

Adds the following methods:

  • simulate_keypress, sends key code with modifiers (macOS, X11 and, Windows).
  • simulate_unicode_input, sends Unicode string (macOS, and Windows, not sure if it's possible on X11, seems like only characters from current keyboard layout can be sent).
  • simulate_mouse_click, sends mouse click with modifiers (macOS, X11 and, Windows).
  • mouse movement is already possible with warp_mouse.
  • on Wayland it seems to be only possible to do on low level (using uinput kernel interface, not implemented in this PR, since no native window support is currently implemented for Wayland).

Related godotengine/godot-proposals#1760

@bruvzg bruvzg marked this pull request as ready for review May 28, 2024 05:33
@bruvzg bruvzg requested review from a team as code owners May 28, 2024 05:33
Copy link
Contributor

@Mickeon Mickeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs are completely fine if I may add.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants