1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-23 23:28:05 +11:00
collapseos/blk/413

13 lines
554 B
Plaintext
Raw Normal View History

2020-05-21 08:56:18 +10:00
: (key) 0 ( dummy ) BEGIN DROP (ps2kc) DUP UNTIL ( kc )
DUP 0xe0 ( extended ) = IF ( ignore ) DROP (key) EXIT THEN
DUP 0xf0 ( break ) = IF DROP ( )
( get next key and see if it's a shift )
(key) _shift? IF ( drop shift ) 0 PS2_SHIFT ! THEN
( whether we had a shift or not, we return the next )
(key) EXIT THEN
DUP 0x7f > IF DROP (key) EXIT THEN
DUP _shift? IF DROP 1 PS2_SHIFT ! (key) EXIT THEN
( ah, finally, we have a gentle run-of-the-mill KC )
PS2_CODES + C@ DUP NOT IF DROP (key) EXIT THEN ;