Keyscan (call target)

From Final Fantasy XII Wiki
Revision as of 13:29, 23 July 2019 by Admin (talk | contribs) (Created page with "{{Call|id=0x0015|return=bool|name=keyscan|args=u_short buttons|act=}}Polls a gamepad and returns true if <code>buttons</code> are pressed. All controls are converted to Duals...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Signature:

bool keyscan(u_short buttons); // id: 0x0015

Polls a gamepad and returns true if buttons are pressed.

All controls are converted to Dualshock 2 equivalents. VM doesn't see buttons not assigned to DS2 counterparts. The values are as follows:

#define PAD_LEFT      0x0080
#define PAD_DOWN      0x0040
#define PAD_RIGHT     0x0020
#define PAD_UP        0x0010
#define PAD_START     0x0008
#define PAD_R3        0x0004
#define PAD_L3        0x0002
#define PAD_SELECT    0x0001
#define PAD_SQUARE    0x8000
#define PAD_CROSS     0x4000
#define PAD_CIRCLE    0x2000
#define PAD_TRIANGLE  0x1000
#define PAD_R1        0x0800
#define PAD_L1        0x0400
#define PAD_R2        0x0200
#define PAD_L2        0x0100