Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -500,20 +500,20 @@ the event struct.
event_struct-->3 = ev-->GLK_EVENT_VALUE2_SF;
];

@ |GLK_EVENT_TY_Handle_Instead| applies a glk event onto the current glk event, and
@ |GLK_EVENT_TY_Replace_Current| applies a glk event onto the current glk event, and
tells glk_select to re-run the glk event handling rules. It also ensures that
if there are any pending keyboard input requests they will be cancelled if the
new event is a keyboard event.

=
Array current_glk_event --> [ BLK_BVBITMAP_SBONLY; GLK_EVENT_TY; 0; 0; 0; 0; 0; 0; 0; ];

Constant GLK_EVENT_HANDLING_INACTIVE 0;
Constant GLK_EVENT_HANDLING_ACTIVE 1;
Constant GLK_EVENT_HANDLING_REHANDLING 2;
Constant GLK_EVENT_HANDLING_INACTIVE 0;
Constant GLK_EVENT_HANDLING_ACTIVE 1;
Constant GLK_EVENT_HANDLING_REPLACED 2;
Global glk_event_handling_status = GLK_EVENT_HANDLING_INACTIVE;

[ GLK_EVENT_TY_Handle_Instead ev evtype win_obj;
[ GLK_EVENT_TY_Replace_Current ev evtype win_obj;
if (glk_event_handling_status == GLK_EVENT_HANDLING_INACTIVE) {
IssueRTP("EventHandledWhileInactive", "Cannot handle new event while not handling events.", Architecture32KitRTPs);
RulebookSucceeds();
Expand Down Expand Up @@ -550,7 +550,7 @@ Global glk_event_handling_status = GLK_EVENT_HANDLING_INACTIVE;
current_glk_event-->GLK_EVENT_VALUE2_SF = ev-->GLK_EVENT_VALUE2_SF;

RulebookSucceeds();
glk_event_handling_status = GLK_EVENT_HANDLING_REHANDLING;
glk_event_handling_status = GLK_EVENT_HANDLING_REPLACED;
];

@ To handle events we intercept the |glk_select| function. This allows us to handle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ Very first glk event handling rule for a glk event type
(this is the set glk event processing variables rule):
now the event is the current glk event initialiser.

To handle (ev - glk event):
(- GLK_EVENT_TY_Handle_Instead({ev}); rtrue; -).
To replace current event with (ev - glk event):
(- GLK_EVENT_TY_Replace_Current({ev}); rtrue; -).

Glk event handling rule for a screen resize event (this is the redraw the status line rule):
redraw the status window;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1845,6 +1845,9 @@ To say (C - RGB colour) letters:
To set the background colour/color/-- to (C - RGB colour):
(- VM_SetWindowColours(BASIC_COLOUR_CURRENT, {C}); -).

To decide what RGB colour is (C - basic colour) as a RGB colour:
(- {C} -).

@ Some basic window phrases, which are supported by both the Z-Machine and Glulx.
(See the Glk Foundations for Glk-specific phrases.)

Expand Down