-
Notifications
You must be signed in to change notification settings - Fork 494
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
HITL - Remote keyboard input redirection. #1853
Conversation
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.
Notes for reviewers.
|
||
# Stub version of Application.MouseEvent.Button | ||
class StubMouseNS(metaclass=StubNSMeta): | ||
pass |
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.
These class will go away in a later pass.
KeyNS = Application.KeyEvent.Key | ||
MouseNS = Application.MouseEvent.Button | ||
KeyNS = KeyCode | ||
MouseNS = StubMouseNS |
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.
These won't be needed anymore. They will be removed in a later pass.
assert isinstance(mouse_button, Application.MouseEvent.Button) | ||
# if not do_agnostic_gui_input: | ||
# assert isinstance(mouse_button, Application.MouseEvent.Button) | ||
pass |
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.
Mouse tracking will be added in a following PR.
interprocess_record: InterprocessRecord, | ||
debug_line_render, | ||
gui_input: GuiInput, | ||
): |
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.
This is where the redirection happens. RemoteGuiInput
used to create its own internal GuiInput
- now it's passed as a dependency.
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.
LGTM
* Move key mapping to its own file. Simplify key handling. * Pass GuiInput to RemoteGuiInput to enable remote control. * Activate keyboard redirection. Add 'in' override to KeyCode. * Add missing typing annotation.
* Move key mapping to its own file. Simplify key handling. * Pass GuiInput to RemoteGuiInput to enable remote control. * Activate keyboard redirection. Add 'in' override to KeyCode. * Add missing typing annotation.
Motivation and Context
This changeset enables remote keyboard input redirection.
It works by assigning
RemoteGuiInput
's internalGuiInput
to the applicationGuiInput
. Therefore, any key received from a client will update the state as if they were local.Beware that
RemoteGuiInput
will be renamed toRemoteClientState
: #1852The following changes are applied:
AbstractKeyNS
- only maintain a single keymap for local or remote (KeyCode
enum).KeyCode
.How Has This Been Tested
Tested locally with a Unity client.
Types of changes
Checklist