VgaGames 3 - Miscellaneous man-pages

[.. upper level ..]

VG3_keys_key_ispressed()

[added in version 1.2]

Return whether a specific key from the system-menu is pressed,
and for a specific client if using network.
SYNTAX
int VG3_keys_key_ispressed(struct vg3_keys *skeys, struct vg3_nwclient *nwclnt, int clnr, int jid, int keyref, int flag)

FUNCTION PARAMETERS
skeys Keys-struct
nwclnt Network-struct
clnr Client-number, or 0 if no networking
jid If multiplayer without networking: joystick-ID or 0 = keyboard
else -1
keyref Reference number of the key-entry
flag Kind of key-pressing: one of the values of VGAG3_PRESSED

RETURN VALUE
Returns integer: - 0: Key is not (new) pressed - 1: Key is (new) pressed

DESCRIPTION
Return whether a specific key from the system-menu is pressed, and for a specific client if using network. Mandatory are the parameters keyref, containing the abstract key reference number, which will be resolved by the real value defined in the system-menu, and flag. The parameter jid is only needed if there are more than one player on the same computer (multiplayer without network), to distinguish the players from each other. The parameters nwclnt and clnr are needed for networking, where clnr specifies the client-player. If flag is VGAG3_IS_PRESSED, the return value will be 1, if the key is being pressed. If flag is VGAG3_IS_NEW_PRESSED, the return value will be 1, if the key is new pressed and has not been asked before with this function. Keys not defined in the system-menu may be furthermore checked with VG3_key_ispressed() and VG3_gamecontroller_ispressed().

SEE ALSO
VG3_keys_new() VG3_keys_free() VG3_keys_menu_insert() VG3_keys_nw_addkeys()