TypingGate
La référence est en anglais : elle est générée à partir des commentaires du code, écrits en anglais.
public static class TypingGateNamespace NodeWorld.SDK.Client.XR.
The one gate of the physical keyboard (client and Play mode). While a text field has the keyboard (a TextMeshPro or uGUI input field, in the menu or in a world), the keys type in it and nothing else hears them: not the desktop controls (move, run, jump, crouch, prone, turn, mic, pointer, held pickup), not the menu key, not the worlds (FL# input). Only the menu key gets through a field of a world, which a script may keep focused: it leaves the field and toggles the menu (the client's menu spawner, plan Flux B3). Whatever reads the keyboard for the game asks here, never Keyboard.current itself: - a key pressed while typing stays swallowed until it is released (the Enter or Escape that ends the typing, W still held after the click that left the field); - a mouse button pressed while typing only clicks the UI (outside the field, that click ends the typing): the game sees the button again once it has been released; - the frame the typing ends still counts as typing (the field reads Enter and Escape halfway through the frame); - a field that stops being typed in while it stays selected (Enter, Escape, a script) is deselected, so its caret and highlight go and the keys come back to the game; a click outside the field deselects it through the UI input module. TypingGateFrame samples the gate at the start of every frame, before anything reads the keyboard.
Properties
Typing
public static bool Typing { get; }A text field takes the keys: one has the keyboard now, or had it when this frame began.
Methods
FieldFocused
public static bool FieldFocused()A text field has the keyboard now.
FocusedField
public static Selectable FocusedField()The text field the event system has selected, when the player is typing in it now; null otherwise.
SelectedField
public static Selectable SelectedField()The text field (TextMeshPro or uGUI) the event system has selected, when it can be typed in, focused or not.
TextField
public static Selectable TextField(GameObject go)The input field of go (TextMeshPro or uGUI) when it can be typed in: active, interactable, not read-only.
Editable
public static bool Editable(Selectable field)The field is an input field (TextMeshPro or uGUI) the player can type in now: active, interactable, not read-only.
IsFocused
public static bool IsFocused(Selectable field)The input field (TextMeshPro or uGUI) has the keyboard: its caret shows and it takes the keys.
IsPressed
public static bool IsPressed(Key key)The key is held for the game (false while typing, and until a key pressed while typing is released).
public static bool IsPressed(ButtonControl button)The key or mouse button is held for the game.
WasPressedThisFrame
public static bool WasPressedThisFrame(Key key)The key went down this frame, for the game.
public static bool WasPressedThisFrame(ButtonControl button)The key or mouse button went down this frame, for the game.
WasReleasedThisFrame
public static bool WasReleasedThisFrame(Key key)The key went up this frame, for the game (never the release of a key pressed while typing).
public static bool WasReleasedThisFrame(ButtonControl button)The key or mouse button went up this frame, for the game.
Blocks
public static bool Blocks(InputAction.CallbackContext context)An input action fired by a key while typing (or by a key pressed while typing): its handler ignores it. Controller buttons and the mouse are never blocked here.
