Toggle button on press

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

View File

@ -49,9 +49,15 @@
BRK
@on-control ( -> )
( | release )
.Controller/button DEI2 ORA ?{
#00 .layer STZ
<draw-keyboard>
[ LIT2 00 -lock ] STZ
BRK }
( | toggle layer )
.Controller/button DEI DUP ?&on-button
POP <draw-keyboard>
.Controller/key DEI tolowercase
POP .Controller/key DEI tolowercase
( | top row )
DUP [ LIT "q ] NEQ ?{ #0000 <set-press> }
DUP [ LIT "w ] NEQ ?{ #0001 <set-press> }
@ -82,6 +88,7 @@
POP BRK
&on-button ( button -> )
#02 SFT #01 AND .layer STZ
<draw-keyboard>
BRK
(
@ -98,6 +105,7 @@
DUP #1b NEQ ?{ POP2 !<toggle-layer> }
.hover LDZ2 ;btn-chr <draw-key-id>
DUP2 ;btn-press-chr <draw-key-id>
DUP2 .hover STZ2
( | event )
( key ) #0006 MUL2 ;layout ADD2
( layer ) get-layer #10 SFT2 ADD2 LDA2