Repository navigation
Modern Tui TuiWin32InputMode
Home › Terminal TUI Library › Terminal › TuiWin32InputMode
Returns the Windows console input mode that Enter would set for given options.
TuiWin32InputMode( byval current as DWORD, byval opts as TuiTermOptions ) as DWORDWindows only. The console input mode Enter will install, as a pure function of the mode it found and the options asked for -- so it can be asserted without a console. It exists because of a defect: QuickEdit is on by default in most Windows consoles and CONSUMES EVERY MOUSE EVENT for text selection, and clearing ENABLE_QUICK_EDIT_MODE is silently ignored unless ENABLE_EXTENDED_FLAGS is set in the same call. The mouse never worked at all until this was found.
#import "std/tui"
using tui
#ifdef __FB_WIN32__
dim as DWORD found = ENABLE_LINE_INPUT or ENABLE_ECHO_INPUT or _
ENABLE_PROCESSED_INPUT or ENABLE_QUICK_EDIT_MODE
dim as TuiTermOptions o = TuiTermOptionsDefault( )
o.mouse = TRUE
dim as DWORD m = TuiWin32InputMode( found, o )
print ( m and ENABLE_MOUSE_INPUT ) <> 0 '' -1 (true)
print ( m and ENABLE_EXTENDED_FLAGS ) <> 0 '' -1 (true) -- or the next line
print ( m and ENABLE_QUICK_EDIT_MODE ) = 0 '' -1 (true) -- is ignored
print ( m and ENABLE_LINE_INPUT ) = 0 '' -1 (true) -- raw
'' QuickEdit is the USER'S setting: without mouse it is left alone
o.mouse = FALSE
print ( TuiWin32InputMode( found, o ) and ENABLE_QUICK_EDIT_MODE ) <> 0
#endifLibrary: Terminal TUI Library
Category: Terminal TUI Library
Documented under: Terminal
Working examples: hello.tiko · form.tiko · dashboard.tiko
tiko-lang · Home · Feature Index · Keyword Index · License
FreeBASIC manual pages reproduced under the GNU FDL 1.3.
- Generics
- Interfaces
- For Each
- Iterators
- Tuples
- Array Results
- Defer
- Lambdas
- Block Strings
- Partial Types
- String Slices
- Embed
- Typed Variadics
- C Header Import
- Foreign Library Linking
- UString
- Fixed-Width Types
- Nullptr
- String Library
- Format
- Array
- Map
- Set
- LinkedList
- OrderedMap
- OrderedSet
- Sorting
- Optional
- Result
- Smart Pointers
- Date and Time (Chrono)
- Filesystem
- File Streams
- Config (INI and TOML)
- Codec
- Hash
- UUID
- OS
- Process
- Net
- HTTP and TLS
- Math Library
- Finance
- Logging
- Terminal TUI Library
- PsControls
- tkControls
- sys/win
- Goroutines and Channels
- LLVM Backend
- tiko build
- TIKO_COMPILER
- Variable Declarations
- Standard Data Types
- User Defined Types
- Procedures
- Operators
- Control Flow Statements
- Converting Data Types
- Array Functions
- String Functions
- Mathematical Functions
- Bit Manipulation
- Date and Time Functions
- File I/O Functions
- Console Functions
- User Input (Runtime Library)
- User Input Functions (Graphics Library)
- Screen Functions
- 2D Drawing Functions
- Graphics Library Reference
- Graphics Keyword List
- Memory Functions
- Threading Support Functions
- Error Handling Functions
- Operating System Functions
- Preprocessor
- Intrinsic Defines
- Miscellaneous Keywords
- Modularizing