keyboard input

This commit is contained in:
Devine Lu Linvega 2024-02-11 11:59:12 -08:00
parent b2cfc76267
commit a82d393406
1 changed files with 38 additions and 4 deletions

View File

@ -49,10 +49,41 @@
BRK
@on-control ( -> )
.Controller/button DEI #02 SFT #01 AND .layer STZ
<draw-keyboard>
BRK
.Controller/button DEI DUP ?&on-button
POP <draw-keyboard>
.Controller/key DEI tolowercase
( | top row )
DUP [ LIT "q ] NEQ ?{ #0000 <set-press> }
DUP [ LIT "w ] NEQ ?{ #0001 <set-press> }
DUP [ LIT "e ] NEQ ?{ #0002 <set-press> }
DUP [ LIT "r ] NEQ ?{ #0003 <set-press> }
DUP [ LIT "t ] NEQ ?{ #0004 <set-press> }
DUP [ LIT "y ] NEQ ?{ #0005 <set-press> }
DUP [ LIT "u ] NEQ ?{ #0006 <set-press> }
DUP [ LIT "i ] NEQ ?{ #0007 <set-press> }
DUP [ LIT "o ] NEQ ?{ #0008 <set-press> }
( | middle row )
DUP [ LIT "a ] NEQ ?{ #0009 <set-press> }
DUP [ LIT "s ] NEQ ?{ #000a <set-press> }
DUP [ LIT "d ] NEQ ?{ #000b <set-press> }
DUP [ LIT "f ] NEQ ?{ #000c <set-press> }
DUP [ LIT "g ] NEQ ?{ #000d <set-press> }
DUP [ LIT "h ] NEQ ?{ #000e <set-press> }
DUP [ LIT "j ] NEQ ?{ #000f <set-press> }
DUP [ LIT "k ] NEQ ?{ #0010 <set-press> }
DUP [ LIT "l ] NEQ ?{ #0011 <set-press> }
( | bottom row )
DUP [ LIT "z ] NEQ ?{ #0012 <set-press> }
DUP [ LIT "x ] NEQ ?{ #0013 <set-press> }
DUP [ LIT "c ] NEQ ?{ #0014 <set-press> }
DUP [ LIT "v ] NEQ ?{ #0015 <set-press> }
DUP [ LIT "b ] NEQ ?{ #0016 <set-press> }
DUP [ LIT "n ] NEQ ?{ #0017 <set-press> }
POP BRK
&on-button ( button -> )
#02 SFT #01 AND .layer STZ
BRK
(
@|core )
@ -230,6 +261,9 @@
(
@|stdlib )
@tolowercase ( char -- )
JMP2r
@<phex> ( short* -- )
SWP <phex>/b
&b ( -- )