Aptivi - Deprecated Manuals
ProjectsWebsiteBlog
Terminaux 3.x - Manual
Terminaux 3.x - Manual
  • 👋Welcome!
  • 🥛Breaking changes
    • ⬆️API v1.0
    • ⬆️API v2.0
    • ⬆️API v3.0
  • Usage
    • 💡Preface
    • 🖥️Console Tools
      • ✅Console Checker
        • ☑️Console Size Requirements
      • 🔌Console Wrapper
      • 🖊️Console Writers
      • 🌈Console Colors
      • 🖼️Color Templates
      • 📺Console Screen
      • ☎️Console Resize Listener
      • 📽️Presentation System
      • 🎚️VT Sequences
      • ➕Console Extensions
      • ⌨️Interactive TUI
    • 📖Input Reader
      • ⌨️Keybindings
      • 🔌Custom bindings
      • ✔️Reader State
      • ⚙️Reader Settings
      • 🔦Syntax Highlighting
      • 🖱️Pointer Events
      • ✍️Other Input
        • 🖊️Figlet Font Selector
        • 🎨Color Wheel
    • 🎨Color Sequences
      • ⛱️Color Model Conversions
      • 🧭Color Model Parsing
      • 🖌️Interop with System.Drawing.Color
  • Report an issue
  • Source code
  • Our projects
  • API Reference
Powered by GitBook
On this page
  • History tools
  • State tools
Edit on GitHub
  1. Usage

Input Reader

May I read what you've written, please?

Last updated 1 year ago

This functionality is an important part of any interactive console application, because it gives users a chance to input what they want to write to the console.

In case you want to listen to mouse events, you can consult the below page:

In case you want to use something other than the reader, you can consult the other input tools defined in the below page:

You can easily use this feature in any interactive console application that uses Terminaux. Just use the Terminaux.Reader class that contains the Read() functions and their overloaded versions.

Please note that they are interruptible by default. If you want the input to be non-interruptible, you can set the interruptible argument to false.

Each one of these functions creates a reader state, TermReaderState, that contains essential information about the current reader state, including, but not limited to:

  • Current text

  • Input prompt text

  • Current text position

  • Kill buffer

  • Reader settings

If you're making your own mod in Nitrocid KS, it's best to use its own Input class instead of Terminaux's TermReader, as the class there actually deals with the screensaver in most circumstances.

Any key will append the selected characters to the current text input, and RETURN will accept the input. For more information about key bindings, go to the below page.

You can access the global reader settings by referencing the GlobalReaderSettings found in the TermReader class.

History tools

You can now set the history entry list with your array of history entries or clear the history list using the following functions:

  • SetHistory(List<string> History)

    • Sets the history to the chosen history list

  • ClearHistory()

    • Clears all history entries

State tools

You can also check to see if the console reader facility is busy getting input or not. The property, Busy, indicates this by returning true if there is input to be entered by the user.

If you want to wait for user input to finish, you can call the WaitForInput() function in the TermReaderTools class.

📖
🖱️Pointer Events
✍️Other Input
⌨️Keybindings