Clean up IDLE vs TIMEOUT vs UNKNOWN.

This commit is contained in:
Brad Nelson
2022-02-25 18:38:08 -08:00
parent b5f427683b
commit 1af99d92ec
4 changed files with 13 additions and 14 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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