From c13389a1e1f6deb71dfa4f175f5a8ac493669316 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sun, 11 Feb 2024 12:04:45 -0800 Subject: [PATCH] Toggle button on press --- gui/shaviankb/shaviankb.tal | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/gui/shaviankb/shaviankb.tal b/gui/shaviankb/shaviankb.tal index b1d62ec..83c5662 100644 --- a/gui/shaviankb/shaviankb.tal +++ b/gui/shaviankb/shaviankb.tal @@ -49,9 +49,15 @@ BRK @on-control ( -> ) + ( | release ) + .Controller/button DEI2 ORA ?{ + #00 .layer STZ + + [ LIT2 00 -lock ] STZ + BRK } + ( | toggle layer ) .Controller/button DEI DUP ?&on-button - POP - .Controller/key DEI tolowercase + POP .Controller/key DEI tolowercase ( | top row ) DUP [ LIT "q ] NEQ ?{ #0000 } DUP [ LIT "w ] NEQ ?{ #0001 } @@ -82,8 +88,9 @@ POP BRK &on-button ( button -> ) #02 SFT #01 AND .layer STZ + BRK - + ( @|core ) @@ -98,6 +105,7 @@ DUP #1b NEQ ?{ POP2 ! } .hover LDZ2 ;btn-chr DUP2 ;btn-press-chr + DUP2 .hover STZ2 ( | event ) ( key ) #0006 MUL2 ;layout ADD2 ( layer ) get-layer #10 SFT2 ADD2 LDA2 @@ -271,6 +279,6 @@ &c ( -- ) #0f AND DUP #09 GTH #27 MUL ADD [ LIT "0 ] ADD #18 DEO JMP2r - + ~assets.tal