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

Controller support within GUI #2601

Open
12 of 17 tasks
eruvanos opened this issue Mar 4, 2025 · 2 comments
Open
12 of 17 tasks

Controller support within GUI #2601

eruvanos opened this issue Mar 4, 2025 · 2 comments
Assignees
Labels
enhancement gui Related to arcade GUI (sub module arcade.gui)

Comments

@eruvanos
Copy link
Member

eruvanos commented Mar 4, 2025

Vision:

GUI should support controller input without or just a little effort.

Tasks:

  • General focus traversal
  • Pass controller events as UIEvents
  • provide first example
  • Make all interactable widgets usable:
    • UITexturedButton
    • UIFlatButton
    • UISlider
    • UIDropdown
  • Handle different views
  • Interoperability with ActionsInput
  • Global switch to toggle focus handling
  • UIWidgets have to show focus themselves

Task from Feedback

Discord

  • If a controller connects multiple times, it crashes because of .open, which can be simply catched with a try except ( I did it on my machine)
  • UIDropdown overlay widgets cant be focused, because they are not re-detected on show
  • can only click on UISlider, and if so, it will set it to the middle value
  • Currently i have an issue with UIGridLayout and UIScrollbar not working together. The focus is in the wrong place. Image attached.
  • UIFlatButtons and UITextureButtons dont count focus as hover, which i think would be a nice addition

PR: #2566

Details

  • An adapter handles connected controllers and passes on_ controller callbacks to the UIManager as UIEvents
  • A UIFocusMixin can be used to make Layouts handle controller input
  • to support UIScrollArea, UIFocusGroup or UIFocusMixin has to be inside of it

Further notes

It might be a good idea to provide some ControllerWindow or something which passes controller events to the window, so the UIManager enable/disable flow could just work.

@eruvanos eruvanos added enhancement gui Related to arcade GUI (sub module arcade.gui) labels Mar 4, 2025
@eruvanos eruvanos self-assigned this Mar 4, 2025
@pushfoo
Copy link
Member

pushfoo commented Mar 4, 2025

It might be a good idea to provide some ControllerWindow

We might be near the point where we should start looking into the pyglet event -> class adapter design. I have the following questions:

  1. Do you want someone with a controller to help test this on Linux?
  2. Are we assuming that each OOP event handler method takes only the following? 1. self
    2. the event object

@eruvanos
Copy link
Member Author

  1. that would be great :)
  2. at least for GUI that is how the event handler look like, they only get the event (and self)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement gui Related to arcade GUI (sub module arcade.gui)
Projects
None yet
Development

No branches or pull requests

2 participants