grogs+ package (WIP)
This commit is contained in:
36
packages/grogs+/grogs+.grnd
Normal file
36
packages/grogs+/grogs+.grnd
Normal file
@@ -0,0 +1,36 @@
|
||||
extern "grogs"
|
||||
|
||||
fun -list !init
|
||||
setlist &keyChecks 32 97
|
||||
setlist &keyDown false false
|
||||
setlist &keyTracker $keyChecks $keyDown
|
||||
return $keyTracker
|
||||
endfun
|
||||
|
||||
fun -int !keyPressed -list &keyTracker
|
||||
getlistat &keyTracker 0 &keyChecks
|
||||
getlistat &keyTracker 1 &keyDown
|
||||
|
||||
!grogs:getLastKey &key
|
||||
set &idx 0
|
||||
getlistsize &keyChecks &len
|
||||
@loop
|
||||
equal $idx $len &cond
|
||||
if $cond %false
|
||||
|
||||
getlistat &keyChecks $idx &store
|
||||
equal $store $key &cond
|
||||
getlistat &keyDown $idx &store
|
||||
inequal $cond $store &cond
|
||||
if $cond %true
|
||||
|
||||
add $idx 1 &idx
|
||||
jump %loop
|
||||
|
||||
@true
|
||||
getlistat &keyChecks $idx &store
|
||||
return $store
|
||||
|
||||
@false
|
||||
return -1
|
||||
endfun
|
||||
Reference in New Issue
Block a user