(m291) Lock mouse

This commit is contained in:
Devine Lu Linvega 2024-08-26 12:41:53 -07:00
parent 7917698871
commit 9f48e67209
1 changed files with 47 additions and 3 deletions

View File

@ -66,21 +66,52 @@
POP2 message/<parse> POP2 message/<parse>
BRK BRK
@on-mouse-locked ( -> )
#c1 ;touch-chr/down ;touch-chr .Mouse/state DEI
( unlock ) DUP ?{ ;on-mouse .Mouse/vector DEO2 }
( assets ) ?{ SWP2 }
POP2 <update-cursor>
BRK
@on-mouse ( -> ) @on-mouse ( -> )
( | cursor )
#c1 ;touch-chr/down ;touch-chr .Mouse/state DEI ?{ SWP2 } #c1 ;touch-chr/down ;touch-chr .Mouse/state DEI ?{ SWP2 }
POP2 <update-cursor> POP2 <update-cursor>
.Mouse/y DEI2 DUP2 #0014 LTH2 ?&status-bar ( | route events )
.Mouse/y DEI2
( > ) DUP2 #0014 LTH2 ?&status-bar
( > ) [ LIT2 00 -playing ] LDZ EQU ?{ DUP2 #0098 LTH2 ?&player }
( | on list )
<y-id> <y-id>
.Mouse/state DEI DUP ?{ POP <select> .Mouse/state DEI DUP ?{ POP <select>
BRK } BRK }
#01 GTH .selection/mod STZ #01 GTH .selection/mod STZ
<pick> <pick>
[ LIT2 00 -Mouse/state ] DEO <lock-mouse>
BRK BRK
&status-bar ( y* -> ) &status-bar ( y* -> )
POP2 BRK POP2 BRK
&player ( y* -> )
.Mouse/state DEI ?{ POP2 BRK }
#0050 SUB2 DUP2 #0020 LTH2 ?&controls
#0030 SUB2 #0010 LTH2 ?&seeker
BRK
&controls ( y* -> )
POP2 .Mouse/x DEI2 #0010 SUB2 #05 SFT2 NIP
( > ) DUP #02 NEQ ?{ <skip-prev>
<lock-mouse> }
( > ) DUP #03 NEQ ?{ <send-pause>
<lock-mouse> }
( > ) #04 NEQ ?{ <skip-next>
<lock-mouse> }
BRK
&seeker ( -> )
BRK
@on-control ( -> ) @on-control ( -> )
( | mod ) ( | mod )
[ LIT2 04 -Controller/button ] DEI AND #00 NEQ .selection/mod STZ [ LIT2 04 -Controller/button ] DEI AND #00 NEQ .selection/mod STZ
@ -98,6 +129,10 @@
( A ) DUP #01 NEQ ?{ .selection LDZ <pick> } ( A ) DUP #01 NEQ ?{ .selection LDZ <pick> }
POP BRK POP BRK
@<lock-mouse> ( -- )
;on-mouse-locked .Mouse/vector DEO2
JMP2r
( (
@|message ) @|message )
@ -127,7 +162,7 @@
JMP2r JMP2r
( (
@|timestamp ) ( returns value between 0000 and 00d0 ) @|timestamp )
@calc-width ( total* curr* -- width* ) @calc-width ( total* curr* -- width* )
STH2 STH2
@ -138,6 +173,15 @@
INC2 #01 SFT2 INC2r LITr 01 SFT2r } INC2 #01 SFT2 INC2r LITr 01 SFT2r }
[ LIT2r 00e7 ] MUL2r STH2r SWP2 DIV2 JMP2r [ LIT2r 00e7 ] MUL2r STH2r SWP2 DIV2 JMP2r
(
@|controls )
@<skip-prev> ( -- )
JMP2r
@<skip-next> ( -- )
JMP2r
( (
@|events ) @|events )