VgaGames 3 - Network man-pages

[.. upper level ..]

VG3_nw_key_ispressed()

Return whether a specific key of a specific client is pressed.
SYNTAX
int VG3_nw_key_ispressed(struct vg3_nwclient *nwclnt, int clnr, int jid, int keyidx, int flag)

FUNCTION PARAMETERS
nwclnt Network-struct
clnr Client-number
jid Joystick-ID or 0 = keyboard
keyidx Key, button or axis:
- for keyboard: one of the values of VGAG3_KEYS
- for gamecontroller: one of the values of VGAG3_GCS
- for joystick: joystick-input-keynumber (starting from 1)
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 of a specific client is pressed. The key had to be added with VG3_nw_addkey(). The jid must be the same as used by adding the key with VG3_nw_addkey(), independent of which client is being queried. 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. This function replaces for network-keys, and only for them, the functions VG3_key_ispressed() and VG3_gamecontroller_ispressed().

SEE ALSO
VG3_nw_update()