MiniM Overview |
MiniM
Knowledge Base | Oct 2, 2010 How to get code of key pressed in CHUI CHUI programs are the alpha-numeric oriented applications with character input-output, and CHUI is abbreviation of CHaracter-User Interface. This programs are built as console- or telnet- oriented programs and are traditional for most use MUMPS programs. To get code of key pressed CHUI program in MiniM Database Server must call read command to read code of key: read *codeHere, if user press key which have correspondent printable character, variable code gets decimal code of key pressed. For example, if user press key "5": USER>r *code 5 USER>w code 53 If user press key which have not correspondent printable character, for example keys F5, Escape or Ins, the MiniM process return as code of key pressed value 27, which is code of the Escape key. In this case program must read value of the $key system variable before nect read character or read string command executes. MiniM Database Server use conventions to store read escape sequence corresponded to key pressed in the $key system variable. MiniM Database Server while wotk as telnet server return in the $key system variable escape sequence have been sent by telnet client and contents of this escape sequence is fully dependent of used telnet client. MiniM Database Server while work in console mode emulates escape sequences as most widely used telnet clients. For example, while key F5 have been pressed: USER>r *code s key=$key zzdump key w $zquote(key),! 0000: 1B 4F 54 $C(27)_"OT" Here are dumped hexadecimal and string values of escape sequence have been read in MiniM console. One of the most important thing of escape sequences is handling of alternate Shift, Ctrl, Alt keys pressing. Some telnet clients can lose this information, can transfer predefined escape sequences or telnet client can be configured what sequences must be sent. To properly handle telnet escape sequences it is required to read keys definition of used telnet client. In the MiniM console information about pressed of alternate Shift, Ctrl, Alt keys is present in escape sequence as an additional characters "a", "c" and "s" in lower case and in this order. For example, MiniM process return this escape sequence while pressed Ctrl+Alt+F5 key combination: USER>r *code s key=$key zzdump key w $zquote(key),! 0000: 1B 4F 54 61 63 $C(27)_"OTac"Eugene Karataev support@minimdb.com
|
|
Info Support |