tm-dashboard
tm-dashboard copied to clipboard
Keyboard - Not switching from pad to kb when using WASD (ZQSD)
When using array keys, the overlay switch well from pad to keyboard, but when using WASD (or ZQSD in french keyboards), it won't switch
This is a little complicated, because the input events are not directly accessible to us. I see script input events in CInputScriptManager
which could be helpful here, as this is how Maniascript detects the active pad:
// Detect active pad
foreach (Event in PendingEvents) {
if (Event.Type == CMlScriptEvent::Type::KeyPress) {
foreach (Pad in Input.Pads) {
if (Pad.Type == CInputPad::EPadType::Keyboard) {
if (ActivePadId != Pad.Id) {
ActivePadId = Pad.Id;
if (Frame_Helper.Visible) {
UpdateLabels(Label_Respawn, Label_Restart, ActivePadId);
}
}
break;
}
}
}
}
foreach (Event in Input.PendingEvents) {
if (Event.Type == CInputEvent::EType::PadButtonPress) {
if (Event.Pad != Null && ActivePadId != Event.Pad.Id) {
ActivePadId = Event.Pad.Id;
if (Frame_Helper.Visible) {
UpdateLabels(Label_Respawn, Label_Restart, ActivePadId);
}
}
}
}