Windows WinMM declarations for joystick state queries through caller-owned JOYINFOEX records.


Schemas

JOYINFOEX

(-- JOYINFOEX) Defines extended joystick information returned by joyGetPosEx.

Dict schema

FieldSchemaRole
dwSizeNat32size of this structure in bytes
dwFlagsNat32data-selection flags
dwXposNat32X-axis position
dwYposNat32Y-axis position
dwZposNat32Z-axis position
dwRposNat32R-axis position
dwUposNat32U-axis position
dwVposNat32V-axis position
dwButtonsNat32button-state bitfield
dwButtonNumberNat32currently pressed button number
dwPOVNat32point-of-view hat angle in hundredths of a degree, or 0xFFFFn32 when centered
dwReserved1Nat32reserved value
dwReserved2Nat32reserved value

Imported functions

Stack effects list a C function's parameters with the first parameter on top; see importFunction.

joyGetPosEx

(pji uJoyID -- result) Retrieves extended information for a joystick.

Inputs

  • pji: JOYINFOEX Ref caller-owned writable joystick-information storage with dwSize set to its size and dwFlags selecting the requested data; the call fills it.
  • uJoyID: Nat32 joystick identifier from 0 to 15.

Outputs

  • result: Nat32 joystick status, 0n32 on success or an error code on failure.

Signature example

Printing @joyGetPosEx during compilation shows its imported Code signature.

"control"       use
"windows/winmm" use

{} Int32 {} [
  @joyGetPosEx printStack _:;
  0
] "main" exportFunction

Expected Output During Compilation

{uJoyID: Nat32; pji: {dwSize: Nat32; dwFlags: Nat32; dwXpos: Nat32; dwYpos: Nat32; dwZpos: Nat32; dwRpos: Nat32; dwUpos: Nat32; dwVpos: Nat32; dwButtons: Nat32; dwButtonNumber: Nat32; dwPOV: Nat32; dwReserved1: Nat32; dwReserved2: Nat32;} Ref;} Nat32 {convention: "";} codeRef

See also