Accepting Hyperlink Events

Accepting Hyperlink Events — Generating and catching hyperlink navigation events

Functions

Includes

#include <libchimara/glk.h>

Description

When you request a hyperlink event in a window, you will receive a hyperlink event when the player clicks on a hyperlink.

Functions

glk_request_hyperlink_event ()

void
glk_request_hyperlink_event (winid_t win);

This call works like glk_request_char_event(), glk_request_line_event() and glk_request_mouse_event(). A pending request on a window remains pending until the player selects a link, or the request is cancelled.

A window can have hyperlink input and mouse, character, or line input pending at the same time. However, if hyperlink and mouse input are requested at the same time, the library may not provide an intuitive way for the player to distinguish which a mouse click represents. Therefore, this combination should be avoided.

When a link is selected in a window with a pending request, glk_select() will return an event of type evtype_Hyperlink. In the event structure, win tells what window the event came from, and val1 gives the (non-zero) link value.

If no hyperlink request is pending in a window, the library will ignore attempts to select a link. No evtype_Hyperlink event will be generated unless it has been requested.

Parameters

win

The window to request a hyperlink event on.

 

glk_cancel_hyperlink_event ()

void
glk_cancel_hyperlink_event (winid_t win);

This call works like glk_cancel_char_event(), glk_cancel_line_event(), and glk_cancel_mouse_event(). See glk_request_hyperlink_event().

Parameters

win

The window in which to cancel the hyperlink event request.