Hotkey handler structure
typedef struct Pt_hotkey_callback {
unsigned short key_sym_cap;
short flags;
unsigned long key_mods;
PtWidget_t *widget;
void *data;
int (*event_f)(
PtWidget_t *, void *,
PtCallbackInfo_t * );
} PtHotkeyCallback_t;
The PtHotkeyCallback_t structure lets you
specify hotkeys or hotkey handlers, or both, for various
widgets. It contains at least the following members:
- key_sym_cap
- Depending on the specified flags, this
member contains either the symbol or cap
of the key to be interpreted as a hotkey.
For valid key_sym_cap values,
see <photon/PkKeyDef.h>.
- flags
- Determines how key_sym_cap is interpreted
and whether or not key_mods is used.
Valid bits include:
- Pt_HOTKEY_SYM
- Interpret key_sym_cap as a key symbol; the default
is to interpret it as a key cap.
- Pt_HOTKEY_IGNORE_MODS
- Ignore the key_mods argument. This flag
is typically used in menus, where you want both upper- and
lowercase letters to be accepted as hotkeys.
- key_mods
- Key modifiers that must be active
for the key to be considered a hotkey. If the
Pt_HOTKEY_IGNORE_MODS flag is set,
this member is ignored.
For valid key modifiers, see
<photon/PkKeyDef.h>. All key-modifier
manifests begin with Pk_KM_.
- widget
- If event_f is NULL, the
widget member's activate
callback is invoked with a reason_subtype of
Pt_CB_HOTKEY.
If the widget member is
NULL when the hotkey is attached, it's set
to the widget that the hotkey is attached to.
- data
- A pointer to any data that you want to pass as the second argument to the
callback function.
- event_f
- A pointer to the hotkey function.
If event_f is
NULL when the hotkey is activated, the widget
that the hotkey is attached to has its
Pt_CB_ACTIVATE
callback (see PtBasic) invoked with a
reason_subtype of Pt_CB_HOTKEY.
Photon
PtBalloonCallback_t,
PtCallback_t,
PtCallbackInfo_t,
Pt_CB_ACTIVATE (PtBasic),
Pt_CB_HOTKEY (PtWidget),
PtRawCallback_t