Operator Reference

read_charT_read_charReadCharReadCharread_char (Operator)

read_charT_read_charReadCharReadCharread_char — Read a character from a window.

Signature

read_char( : : WindowHandle : Char, Code)

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

void ReadChar(const HTuple& WindowHandle, HTuple* Char, HTuple* Code)

HString HWindow::ReadChar(HString* Code) const

static void HOperatorSet.ReadChar(HTuple windowHandle, out HTuple charVal, out HTuple code)

string HWindow.ReadChar(out string code)

def read_char(window_handle: HHandle) -> Tuple[str, str]

Description

read_charread_charReadCharReadCharread_char reads a character from the keyboard in the input window (= output window). If the character is printable it is returned in CharCharCharcharValchar. If a control key has been pressed, this will be indicated by the value of CodeCodeCodecodecode. 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_charread_charReadCharReadCharread_char has been canceled (not always possible, e.g., in native X11 windows)

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

WindowHandleWindowHandleWindowHandlewindowHandlewindow_handle (input_control)  window HWindow, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Window handle.

CharCharCharcharValchar (output_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

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

CodeCodeCodecodecode (output_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Code for input character.

Result

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

Possible Predecessors

open_windowopen_windowOpenWindowOpenWindowopen_window, set_fontset_fontSetFontSetFontset_font

Alternatives

read_stringread_stringReadStringReadStringread_string, fread_charfread_charFreadCharFreadCharfread_char, fread_stringfread_stringFreadStringFreadStringfread_string

See also

write_stringwrite_stringWriteStringWriteStringwrite_string, set_fontset_fontSetFontSetFontset_font

Module

Foundation