mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-24 14:28:06 +11:00
ps2: add shift support
This commit is contained in:
parent
b874a1c175
commit
7d28637740
7
blk/412
7
blk/412
@ -8,4 +8,9 @@
|
||||
( 68 ) 0 C, '1' C, 0 C, '4' C, '7' C, 0 C, 0 C, 0 C,
|
||||
( 70 ) '0' C, '.' C, '2' C, '5' C, '6' C, '8' C, 27 C, 0 C,
|
||||
( 78 ) 0 C, 0 C, '3' C, 0 C, 0 C, '9' C, 0 C, 0 C,
|
||||
: _shift? ( kc -- f ) DUP 0x12 = SWAP 0x59 = OR ;
|
||||
( Same values, but shifted )
|
||||
( 00 ) 0 C, 0 C, 0 C, 0 C, 0 C, 0 C, 0 C, 0 C,
|
||||
( 08 ) 0 C, 0 C, 0 C, 0 C, 0 C, 9 C, '~' C, 0 C,
|
||||
( 10 ) 0 C, 0 C, 0 C, 0 C, 0 C, 'Q' C, '!' C, 0 C,
|
||||
( 18 ) 0 C, 0 C, 'Z' C, 'S' C, 'A' C, 'W' C, '@' C, 0 C,
|
||||
( 20 ) 0 C, 'C' C, 'X' C, 'D' C, 'E' C, '$' C, '#' C, 0 C,
|
||||
|
22
blk/413
22
blk/413
@ -1,12 +1,12 @@
|
||||
: (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 ;
|
||||
( 28 ) 0 C, 32 C, 'V' C, 'F' C, 'T' C, 'R' C, '%' C, 0 C,
|
||||
( 30 ) 0 C, 'N' C, 'B' C, 'H' C, 'G' C, 'Y' C, '^' C, 0 C,
|
||||
( 38 ) 0 C, 0 C, 'M' C, 'J' C, 'U' C, '&' C, '*' C, 0 C,
|
||||
( 40 ) 0 C, '<' C, 'K' C, 'I' C, 'O' C, ')' C, '(' C, 0 C,
|
||||
( 48 ) 0 C, '>' C, '?' C, 'L' C, ':' C, 'P' C, '_' C, 0 C,
|
||||
( 50 ) 0 C, 0 C, '"' C, 0 C, '{' C, '+' C, 0 C, 0 C,
|
||||
( 58 ) 0 C, 0 C, 13 C, '}' C, 0 C, '|' C, 0 C, 0 C,
|
||||
( 60 ) 0 C, 0 C, 0 C, 0 C, 0 C, 0 C, 8 C, 0 C,
|
||||
( 68 ) 0 C, 0 C, 0 C, 0 C, 0 C, 0 C, 0 C, 0 C,
|
||||
( 70 ) 0 C, 0 C, 0 C, 0 C, 0 C, 0 C, 27 C, 0 C,
|
||||
( 78 ) 0 C, 0 C, 0 C, 0 C, 0 C, 0 C, 0 C, 0 C,
|
||||
|
||||
|
15
blk/414
Normal file
15
blk/414
Normal file
@ -0,0 +1,15 @@
|
||||
: _shift? ( kc -- f ) DUP 0x12 = SWAP 0x59 = OR ;
|
||||
: _get ( -- kc ) 0 ( dummy ) BEGIN DROP (ps2kc) DUP UNTIL ;
|
||||
: (key) _get
|
||||
DUP 0xe0 ( extended ) = IF ( ignore ) DROP (key) EXIT THEN
|
||||
DUP 0xf0 ( break ) = IF DROP ( )
|
||||
( get next kc and see if it's a shift )
|
||||
_get _shift? IF ( drop shift ) 0 PS2_SHIFT C! 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 C! (key) EXIT THEN
|
||||
( ah, finally, we have a gentle run-of-the-mill KC )
|
||||
PS2_CODES PS2_SHIFT @ IF 0x80 + THEN + C@
|
||||
DUP NOT IF DROP (key) THEN ;
|
||||
|
Loading…
Reference in New Issue
Block a user