-
Notifications
You must be signed in to change notification settings - Fork 261
Conversation
8f0c101
to
64b564d
Compare
Notice if someone wants to test Gamepad functionality, at least the demo UE app sent an invalid Might be just an issue in my test application though, which is just something grabbed from UE samples. Maybe some newer test programs send a proper value and don't need the hack. |
@Belchy06 To review this one. Also Will can you look into the gamepad issue reported here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also do the same for XR inputs?
I did look at this yesterday, but the XR input seems to work in a slightly different way compared to the rest of the input methods. The code doesn't register any event listeners. It's instead requesting a XR session, and when the session is active, the code has access to XR controller state. So I'm not 100% sure it fits into this same pattern. Maybe we could add the XR flag in Config, and if that's disabled, block sending the controller update messages to UE. Wouldn't work the same way under the hood, but looking from the dev point of view could be nice to have that flag available. |
…ontroller messages
XR flag implemented in commit 71daadf |
Looks good. I just made one change to simplifying the flag names from EnableDeviceInput to DeviceInput as user's should be able to get the idea of enabling/disabling from the toggle itself. I was unable to repro the issue you brought up with the analogue gamepad input, with mine 'just working'. Which samples were you using and I'll look to seeing if it need to be fixed? |
re: gamepad issue - @Belchy06 I'll leave it up to you to open a ticket UE side if needed. |
Summary
Added configuration for enabling & disabling the following user input devices:
The config can be given either as initial configuration when creating the
Config
object, or can be changed on the fly. The changed config is applied immediately by removing/reapplying the event handlers related to user input.Added the new configuration items also to the sample UI so that they can be toggled on demand.
The event unregistering is done via a new utility class
EventListenerTracker
that keeps track of the registered event handlers and can execute unregister commands for them when needed. This same mechanism can be used later if implementing teardown functionality that unregisters everything.Test plan
Configuration via API
player.ts
to disable all user input on initDynamic run-time config change
Screen.Recording.2023-03-02.at.16.32.32.mp4