From 1af99d92ec71d860c27b0a60681b6cf868b9f667 Mon Sep 17 00:00:00 2001 From: Brad Nelson Date: Fri, 25 Feb 2022 18:38:08 -0800 Subject: [PATCH] Clean up IDLE vs TIMEOUT vs UNKNOWN. --- ueforth/common/grf.fs | 19 +++++++++---------- ueforth/examples/heart_game.fs | 2 +- ueforth/posix/grf.fs | 4 ++-- ueforth/windows/grf.fs | 2 +- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/ueforth/common/grf.fs b/ueforth/common/grf.fs index 8ca95e0..3725699 100644 --- a/ueforth/common/grf.fs +++ b/ueforth/common/grf.fs @@ -31,7 +31,7 @@ \ pressed? ( k -- f ) \ event ( -- n ) \ Event constants: -\ UNKNOWN TIMEOUT RESIZED EXPOSED MOTION +\ IDLE RESIZED EXPOSED MOTION \ PRESSED RELEASED TYPED FINISHED \ Key/Button constants: \ LEFT-BUTTON MIDDLE-BUTTON RIGHT-BUTTON @@ -39,15 +39,14 @@ vocabulary grf grf definitions vocabulary internals -0 constant UNKNOWN -1 constant TIMEOUT -2 constant RESIZED -3 constant EXPOSED -4 constant MOTION -5 constant PRESSED -6 constant RELEASED -7 constant TYPED -8 constant FINISHED +0 constant IDLE +1 constant RESIZED +2 constant EXPOSED +3 constant MOTION +4 constant PRESSED +5 constant RELEASED +6 constant TYPED +7 constant FINISHED 255 constant LEFT-BUTTON 254 constant MIDDLE-BUTTON diff --git a/ueforth/examples/heart_game.fs b/ueforth/examples/heart_game.fs index 7aed626..ff82246 100755 --- a/ueforth/examples/heart_game.fs +++ b/ueforth/examples/heart_game.fs @@ -206,7 +206,7 @@ create arrow-table fire then then - event UNKNOWN = if + event IDLE = if begin ms-ticks to next-tm next-tm last-tm - 10 < while 1 ms repeat next-tm to last-tm 100 random 0= if volcano-spew then diff --git a/ueforth/posix/grf.fs b/ueforth/posix/grf.fs index 892c65c..68b97cf 100644 --- a/ueforth/posix/grf.fs +++ b/ueforth/posix/grf.fs @@ -79,7 +79,7 @@ StructureNotifyMask or constant EVENT-MASK ; : update-event - UNKNOWN to event + IDLE to event xevent [ xany ] ->type sl@ to xevent-type Expose xevent-type = if EXPOSED to event @@ -160,7 +160,7 @@ also grf definitions : poll pending-key? if exit then display event-mask xevent XCheckMaskEvent - if update-event else TIMEOUT to event then + if update-event else IDLE to event then ; forth definitions diff --git a/ueforth/windows/grf.fs b/ueforth/windows/grf.fs index d1897bb..c74d3c5 100644 --- a/ueforth/windows/grf.fs +++ b/ueforth/windows/grf.fs @@ -163,7 +163,7 @@ also windows : poll event FINISHED = if exit then - UNKNOWN to event + IDLE to event msgbuf NULL 0 0 PM_REMOVE PeekMessageA if msgbuf TranslateMessage drop msgbuf DispatchMessageA drop