: KBD_test until kbd@ dup 1 = if done then dup if . tab. update else drop then loop ; create KBD_downbuf 80 alloc : KBD_@ until kbd@ dup if dup 80 >= if [ KBD_downbuf 80 - ] + 0 swap c! else dup KBD_downbuf + 1 swap c! done then else done then loop ; : KBD_down? ( KeyScanCode -- result ) KBD_downbuf + c@ ; rh KBD_downbuf str \listF\listLIB\5TH_KBD_USDVORAK" tmp1 str \listF\listLIB\5TH_KBD_US" tmp2 .( Select keyboard layout, by pressing appropriate number. ) .( 1 - US dvorak ) .( 2 - US ) : tmpselect until KBD_@ dup 2 = if tmp1 swap done then dup 3 = if tmp2 swap done then drop loop ; update tmpselect .( selected ) update defDstr str2Dstr forget tmp1 defDstr include : KBD_test2 until KBD_@ dup 1 = if done then dup if . tab. update else drop then loop ; : KBD_SC2FSCII ( ScanCode -- FSCII ) KBD_table swap until \ addr code over @ dup if over = if drop 4 + @ done else swap 8 + swap then else 2drop drop -1 done then loop ; : KBD_F@ KBD_@ 2A KBD_down? if 100 + then 38 KBD_down? if 200 + then KBD_SC2FSCII ; : KBD_FW@ update until KBD_F@ dup -1 = if drop else done then loop ;