Open XertroV opened 3 weeks ago
Without reproduction code, there's very little I can reproduce here. This plugin shows nothing out of the ordinary for me.
void RenderInterface()
{
if (UI::Begin("Key test")) {
UI::Text("Keys:");
if (UI::IsKeyDown(UI::Key::LeftShift)) {
UI::Text("- Left shift");
}
}
UI::End();
}
Right you need to press another key.
Oh and block the key using OnKeyPress
.
Ahh okay, the title was wrong. It's that new keys aren't registered, rather than IsKeyDown returning false.
void RenderInterface()
{
if (UI::Begin("Key test")) {
UI::Text("Press a number key while holding shift to repro");
UI::Text("lastKey: " + tostring(lastKey));
UI::Text("Keys:");
if (UI::IsKeyDown(UI::Key::LeftShift)) {
UI::Text("- Left shift");
}
}
UI::End();
}
VirtualKey lastKey = VirtualKey::N;
UI::InputBlocking OnKeyPress(bool down, VirtualKey key) {
if (down) {
if (int(key) >= int(VirtualKey::N0) && int(key) <= int(VirtualKey::N9)) {
lastKey = key;
return UI::InputBlocking::Block;
}
}
return UI::InputBlocking::DoNothing;
}
Hmm okay, this is just the existing OnKeyPress bug by the looks.
Replication process with spectator hotkeys:
can write a little replication plugin if needed