Skip to content

read_charReadCharReadCharread_charT_read_char๐Ÿ”—

Short description๐Ÿ”—

read_charReadCharReadCharread_charT_read_char โ€” Read a character from a window.

Signature๐Ÿ”—

read_char( window WindowHandle, out string Char, out string Code )void ReadChar( const HTuple& WindowHandle, HTuple* Char, HTuple* Code )static void HOperatorSet.ReadChar( HTuple windowHandle, out HTuple charVal, out HTuple code )def read_char( window_handle: HHandle ) -> Tuple[str, str]

Herror T_read_char( const Htuple WindowHandle, Htuple* Char, Htuple* Code )

HString HWindow::ReadChar( HString* Code ) const

string HWindow.ReadChar( out string code )

Description๐Ÿ”—

read_charReadChar reads a character from the keyboard in the input window (= output window). If the character is printable it is returned in CharcharValchar. If a control key has been pressed, this will be indicated by the value of Codecodecode. Some important keys are recognizable by this value. Possible values are:

  • โ€˜characterโ€™: printable character

  • โ€˜leftโ€™: cursor left

  • โ€˜rightโ€™: cursor right

  • โ€˜upโ€™: cursor up

  • โ€˜downโ€™: cursor down

  • โ€˜insertโ€™: insert

  • โ€˜noneโ€™: none of these keys

  • โ€˜canceledโ€™: read_charReadChar has been canceled (not always possible, e.g., in native X11 windows)

Execution information๐Ÿ”—

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters๐Ÿ”—

WindowHandlewindowHandlewindow_handle (input_control) window โ†’ (handle)HTuple (HHandle)HWindow, HTuple (IntPtr)HHandleHtuple (handle)

Window handle.

CharcharValchar (output_control) string โ†’ (string)HTuple (HString)HTuple (string)strHtuple (char*)

Input character (if it is not a control character).

Codecodecode (output_control) string โ†’ (string)HTuple (HString)HTuple (string)strHtuple (char*)

Code for input character.

Result๐Ÿ”—

read_charReadChar returns 2 (H_MSG_TRUE) if the window is valid. Otherwise an exception is raised.

Combinations with other operators๐Ÿ”—

Combinations

Possible predecessors

open_windowOpenWindow, set_fontSetFont

Alternatives

read_stringReadString, fread_charFreadChar, fread_stringFreadString

See also

write_stringWriteString, set_fontSetFont

Module๐Ÿ”—

Foundation