InputBindingActionContext
Namespace: Hex1b.Input
Assembly: Hex1b.dll
Context passed to input binding action handlers and widget event handlers. Provides app-level services for focus navigation, cancellation, and other common operations.
public sealed class InputBindingActionContextInheritance
Object → InputBindingActionContext
Properties
CancellationToken
Cancellation token from the application run loop. Use this for async operations that should be cancelled when the app stops.
Returns: CancellationToken
public CancellationToken CancellationToken { get; }Focusables
Gets all focusable nodes in render order.
Returns: IReadOnlyList<Hex1bNode>
public IReadOnlyList<Hex1bNode> Focusables { get; }FocusedNode
Gets the currently focused node, or null if none.
Returns: Hex1bNode
public Hex1bNode? FocusedNode { get; }MouseX
The absolute X coordinate of the mouse event, if this context was created for a mouse binding. -1 if not applicable (e.g., for keyboard bindings).
Returns: Int32
public int MouseX { get; }MouseY
The absolute Y coordinate of the mouse event, if this context was created for a mouse binding. -1 if not applicable (e.g., for keyboard bindings).
Returns: Int32
public int MouseY { get; }Notifications
Gets the notification stack for the nearest notification host (typically a NotificationPanel) in the focused node's ancestry. Use this to post notifications from event handlers.
Returns: NotificationStack
public NotificationStack Notifications { get; }Popups
Gets the popup stack for the nearest popup host (typically a ZStack) in the focused node's ancestry. Use this to push popups, menus, and dialogs from event handlers. The root ZStack automatically provides a PopupStack, so this is never null within a Hex1bApp.
Returns: PopupStack
public PopupStack Popups { get; }this[string]
Gets the window manager for a named WindowPanel.
Parameters:
name(String): The name of the WindowPanel.
Returns: WindowManager
public WindowManager this[string name] { get; }Windows
Gets the window manager for managing floating windows.
Returns: WindowManager
public WindowManager Windows { get; }Methods
CopyToClipboard(string)
Copies the specified text to the system clipboard using the OSC 52 escape sequence. This works on terminals that support the OSC 52 clipboard protocol (most modern terminals).
Parameters:
text(String): The text to copy to the clipboard.
public void CopyToClipboard(string text)Focus(Hex1bNode)
Focuses a specific node if it's in the ring.
Parameters:
node(Hex1bNode):
Returns: Boolean
True if the node was found and focused.
public bool Focus(Hex1bNode node)FocusNext()
Moves focus to the next focusable widget in the ring. This is the standard way to implement Tab navigation.
Returns: Boolean
True if focus was moved, false if there are no focusables.
public bool FocusNext()FocusPrevious()
Moves focus to the previous focusable widget in the ring. This is the standard way to implement Shift+Tab navigation.
Returns: Boolean
True if focus was moved, false if there are no focusables.
public bool FocusPrevious()FocusWhere(Func<Hex1bNode, bool>)
Focuses the first node in the ring that matches the predicate.
Parameters:
predicate(Func<Hex1bNode, Boolean>): A function that returns true for the node to focus.
Returns: Boolean
True if a matching node was found and focused, false otherwise.
public bool FocusWhere(Func<Hex1bNode, bool> predicate)Invalidate()
Signals that the UI needs to be re-rendered.
public void Invalidate()RequestStop()
Requests the application to stop. The RunAsync call will exit gracefully after the current frame completes.
public void RequestStop()TryGetNotifications()
Tries to get the notification stack, returning null if no notification host is found. Use this when notifications are optional and you don't want an exception.
Returns: NotificationStack
public NotificationStack? TryGetNotifications()TryGetWindows()
Tries to get the default window manager, returning null if not available.
Returns: WindowManager
public WindowManager? TryGetWindows()TryGetWindows(string)
Tries to get a named window manager, returning null if not found.
Parameters:
name(String):
Returns: WindowManager
public WindowManager? TryGetWindows(string name)