DSprtn / GTFO_VR_Plugin

A plugin to add full roomscale Virtual Reality support to your favorite game!
MIT License
143 stars 13 forks source link

Fix selecting commands with [brackets], ctrl-c to cancel -T ping #41

Closed Nordskog closed 1 year ago

Nordskog commented 1 year ago

What

This PR

[ Brackets ]

We only delimit on [ ] because they sometimes surround words of interest with them. Fix is to not delimit on them initially, and then trim them if both the first and last characters of the selection is a [ bracket ]

CTRL

When pressed, PhysicalButtons with a Modifier KeyType set an internal IsToggled state that is represented in their color state. When pressedTerminalKeyboardInterface adds or removes the modifier to a HashSet<KeyCode, which is queried and cleared in TerminalKeyboardInterface.LateUpdate() if and only if a string or keycode input was presented that frame. These modifiers are presented alongside other KeyCode input in TerminalKeyboardInterface.GetKeycodeDown(). Modifier keys such as ctrl and shift are queried by UnityEngine.Input.GetKey instead of the existing UnityEngine.Input.GetKeyDown patch, so an additional patch was added for this.

If an input is received that corresponds to neither a KeyCode nor a String input (e.g. arrow keys, backspace, exit etc), we just clear the modifier HashSet immediately. Likewise, the button will clear its own IsToggled state if any other button is pressed.