Aptivi - Manual
ProjectsWebsiteBlog
Terminaux - Manual
Terminaux - Manual
  • Welcome!
  • Breaking changes
    • API v1.0
    • API v2.0
    • API v3.0
    • API v4.0
    • API v5.0
    • API v6.0
    • API v7.0
  • Usage
    • Preface
    • Console Tools
      • Console Checker
        • Console Size Requirements
      • Image Rendering
        • Icons
      • Console Writers
        • Individual Writers
        • Cyclic Writers
          • Geometric Shapes
          • Charts
          • Text
          • Artistic
          • Progress Bars
          • Lists and Calendars
          • Miscellaneous
        • Informational Boxes
      • Textual UI
        • Interactive TUI
        • Console Screen
        • Console Resize Listener
        • VT Sequences
      • Console Wrapper
      • Console Colors
      • Color Templates
      • Presentation System
      • Console Extensions
      • Nerd Fonts
      • Terminal Info
      • Test Fixtures
      • Terminal Structures
      • Console Logging
    • Input Reader
      • Shells
        • Shell Structure
          • Help System
          • Command Parsing
          • Command Information
          • Command Switches
          • Shell Presets
          • Command Aliasing
      • Other Input
        • Keybindings
        • Choice-based inputs
        • Editors and Viewers
        • Figlet Font Selector
        • Color Wheel
        • Spinner Selector
      • Reader State
      • Reader Settings
      • Syntax Highlighting
      • Pointer Events
    • Color Sequences
      • Color Model Conversions
      • Color Model Parsing
      • Interop with System.Drawing.Color
  • Report an issue
  • Source code
  • API Reference
Powered by GitBook
On this page
Edit on GitHub
  1. Usage
  2. Input Reader
  3. Other Input

Keybindings

Press any key!

Individual keybindings are defined using the Keybinding class found in the Terminaux.Writers.MiscWriters.Tools namespace. They define what key or key combination, whether it's a mouse or a keyboard event, corresponds to what action that is described using text. You can define them using one of the following constructors:

  • Console key without any modifiers

    • string bindingName, ConsoleKey bindingKeyName

  • Console key with modifiers

    • string bindingName, ConsoleKey bindingKeyName, ConsoleModifiers bindingKeyModifiers

  • Mouse pointer button without button press state and modifier

    • string bindingName, PointerButton bindingPointerButton

  • Mouse pointer button with button press state, but without modifier

    • string bindingName, PointerButton bindingPointerButton, PointerButtonPress bindingPointerButtonPress

  • Mouse pointer button with button press state and modifier

    • string bindingName, PointerButton bindingPointerButton, PointerButtonPress bindingPointerButtonPress, PointerModifiers bindingButtonModifiers

These keybindings have no action, as it's mostly for informational purposes, but you can also use it to define keybindings with the appropriate actions. However, a user might want to know what are the available keybindings in your interactive applications. We've implemented the KeybindingsWriter that contains the following functions:

  • One-line keybindings list

    • WriteKeybindings()

    • RenderKeybindings()

  • Keybindings list in an infobox

    • ShowKeybindingInfoboxPlain()

    • ShowKeybindingInfobox()

    • ShowKeybindingInfoboxColor()

    • ShowKeybindingInfoboxColorBack()

    • RenderKeybindingHelpText()

The Render function variant returns a string that you can either write to the terminal or add as part of the screen buffer if you're planning to write a complex application.

Last updated 7 months ago