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

Accept commands in remote input handler #77

Open
mickvangelderen opened this issue Nov 7, 2024 · 2 comments
Open

Accept commands in remote input handler #77

mickvangelderen opened this issue Nov 7, 2024 · 2 comments

Comments

@mickvangelderen
Copy link
Contributor

To enable environments that use commands, like https://github.com/Astera-org/dreamerv3/issues/7.

@mickvangelderen
Copy link
Contributor Author

mickvangelderen commented Nov 8, 2024

Solution direction:

Add some data to the Action struct in the capnp protocol:

struct Action {
  keyEvents @0 :List(KeyPressType.Key);
  mouseDx @1 :Int32;
  mouseDy @2 :Int32;
  inputString @3 : String; <-- something like this?
}

Then, at the right time (after the cmd keypress takes effect), send an SEvent or two to the right EventHandlers.

if (m_key_was_pressed[keycache.key[KeyType::CMD]]) {
  SEvent event;
  event.EventType = irr::EET_STRING_INPUT_EVENT;
  event.StringInput.Str = new core::stringw("max");
  m_rendering_engine->get_gui_env()->postEventFromUser(event);
  delete event.StringInput.Str;
}

@mickvangelderen
Copy link
Contributor Author

Not needed for now because we implemented globo interactions through items instead: https://github.com/Astera-org/globo/pull/30

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

No branches or pull requests

1 participant