AreYouSure Funct Print "Are you sure" and waits for Y or N. CKbdStateGlbls Class class CKbdStateGlbls DisableMouse Funct { EnableMouse Funct { GetChar Funct Waits for non-zero ASCII key. GetDate Funct Prompt user for date expression. (Use Now() if you want current time.) GetF64 Funct Prompt user for F64 expression. GetI64 Funct Prompt user for I64 expression. GetKey Funct Waits for MSG_KEY_DOWN message and returns ASCII. GetS Funct Prompt into fixed length string. Size must include terminator. GetScanCodeEntry Funct { GetStr Funct Returns a MAlloc()ed prompted string. See Flags. KbdCmdFlush Funct { KbdCmdRead Funct { KbdCmdSend Funct { KbdModLEDs Funct Modifies upper 5 keyboard LED bits KbdMsCmdAck Funct { KbdMsEvtTime Funct Timestamp of last key or mouse event. KbdPktInject Funct Inject a 1 or 2 byte keyboard packet from an external non-PS/2 source KbdTypeMatic Funct Set speed of repeated keys. KeyStateRst Funct Clears state of all keys in key_state and sc_state MsHardGetType Funct { MsHardHndlr Funct { MsHardRst Funct { MsPktInject Funct Inject a mouse packet from an external non-PS/2 source MsRaw Funct Places mouse in "raw" mode, button presses will not go to windows manager when true MsRawRst Funct { PressAKey Funct Print "Press a key" and wait for non-zero ASCII key. ScanChar Funct Checks for MSG_KEY_DOWN and returns 0 immediately if no key. ScanKey Funct Checks for MSG_KEY_DOWN and returns FALSE immediately if no key. SetScanCodeEntry Funct { YorN Funct Wait for user to answer Y or N. kbd GlbVar CKbdStateGlbls kbd; key_state GlbVar U8 *key_state, *sc_state; sc_flags_state GlbVar I64 sc_flags_state; sc_state GlbVar U8 *key_state, *sc_state;
Keyboard Devices The editor mostly stays in a GetKey()/PutKey() loop. The putkey portion is where keys are acted-upon. TempleOS has a chain of putkey hndlrs in a Circular Queue with priorities. The highest priority hndlrs can choose to terminate handling, otherwise, the keys get sent on down the chain. KeyDevAdd() defines a putkey device with a priority. "Device" might be a misnomer. Currently, the following are defined: Priority Hndlr ---------- --------- 0x20000000 MyPutKey() user hndlr 0x40000000 KDInputFilterPutKey() for In(), InStr(), and InFile() handling. 0x60000000 KDRawPutKey() nonwindowed direct to video mem debug output. 0x80000000 KDDocPutKey() standard document cmds Since handling individual keys is slow, TempleOS supports PutS() as well. If no puts hndlr is defined, individual keys are sent. CDoc.user_put_key and CDoc.user_put_s are call back routines which offer some neat tricks. See ::/Apps/Psalmody/JukeBox.HC. There is a var CDoc.user_put_dat a which gets passed to them. CtrlAltCBSet Funct Set callback for <CTRL-ALT-letter>. KeyDescSet Funct Call this from key hndlr to report desc in KeyMap(). KeyDevAdd Funct Places hook in StdOut chain. See Keyboard Devices. KeyDevRem Funct Remove StdOut hook and free.
Keyboard Devices/System