Focus OOC hotkey (#1272)

This commit is contained in:
ike709
2020-07-06 08:45:58 -05:00
committed by GitHub
parent 7e4b506aaf
commit 3bab2fd803
5 changed files with 22 additions and 1 deletions

View File

@@ -41,6 +41,9 @@ namespace Content.Client.State
_inputManager.SetInputCommand(ContentKeyFunctions.FocusChat,
InputCmdHandler.FromDelegate(s => FocusChat(_gameChat)));
_inputManager.SetInputCommand(ContentKeyFunctions.FocusOOC,
InputCmdHandler.FromDelegate(s => FocusOOC(_gameChat)));
}
public override void Shutdown()
@@ -61,5 +64,16 @@ namespace Content.Client.State
chat.Input.IgnoreNext = true;
chat.Input.GrabKeyboardFocus();
}
internal static void FocusOOC(ChatBox chat)
{
if (chat == null || chat.UserInterfaceManager.KeyboardFocused != null)
{
return;
}
chat.Input.IgnoreNext = true;
chat.Input.GrabKeyboardFocus();
chat.Input.InsertAtCursor("[");
}
}
}