ホーム › UI.Input.GameInput › GameInputDeviceInfo
GameInputDeviceInfo
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| infoSize | DWORD | 4 | +0 | +0 | 本構造体のサイズをバイト単位で示す。 |
| vendorId | WORD | 2 | +4 | +4 | デバイスのベンダーIDである。 |
| productId | WORD | 2 | +6 | +6 | デバイスのプロダクトIDである。 |
| revisionNumber | WORD | 2 | +8 | +8 | デバイスのリビジョン番号である。 |
| interfaceNumber | BYTE | 1 | +10 | +10 | USBインタフェース番号である。 |
| collectionNumber | BYTE | 1 | +11 | +11 | HIDコレクション番号である。 |
| usage | GameInputUsage | 4 | +12 | +12 | デバイス最上位のHIDユーセージである。 |
| hardwareVersion | GameInputVersion | 8 | +16 | +16 | ハードウェアのバージョン情報である。 |
| firmwareVersion | GameInputVersion | 8 | +24 | +24 | ファームウェアのバージョン情報である。 |
| deviceId | APP_LOCAL_DEVICE_ID | 32 | +32 | +32 | デバイスを識別するアプリローカルIDである。 |
| deviceRootId | APP_LOCAL_DEVICE_ID | 32 | +64 | +64 | ルートデバイスを識別するアプリローカルIDである。 |
| deviceFamily | GameInputDeviceFamily | 4 | +96 | +96 | デバイスのファミリ種別を示す値である。 |
| capabilities | GameInputDeviceCapabilities | 4 | +100 | +100 | デバイスの機能を示すフラグである。 |
| supportedInput | GameInputKind | 4 | +104 | +104 | デバイスが対応する入力種別を示すフラグである。 |
| supportedRumbleMotors | GameInputRumbleMotors | 4 | +108 | +108 | 対応するランブルモーターを示すフラグである。 |
| inputReportCount | DWORD | 4 | +112 | +112 | 入力レポートの個数である。 |
| outputReportCount | DWORD | 4 | +116 | +116 | 出力レポートの個数である。 |
| featureReportCount | DWORD | 4 | +120 | +120 | 機能レポートの個数である。 |
| controllerAxisCount | DWORD | 4 | +124 | +124 | コントローラ軸の個数である。 |
| controllerButtonCount | DWORD | 4 | +128 | +128 | コントローラボタンの個数である。 |
| controllerSwitchCount | DWORD | 4 | +132 | +132 | コントローラスイッチの個数である。 |
| touchPointCount | DWORD | 4 | +136 | +136 | 対応するタッチ点の個数である。 |
| touchSensorCount | DWORD | 4 | +140 | +140 | タッチセンサーの個数である。 |
| forceFeedbackMotorCount | DWORD | 4 | +144 | +144 | フォースフィードバックモーターの個数である。 |
| hapticFeedbackMotorCount | DWORD | 4 | +148 | +148 | ハプティックモーターの個数である。 |
| deviceStringCount | DWORD | 4 | +152 | +152 | デバイス文字列の個数である。 |
| deviceDescriptorSize | DWORD | 4 | +156 | +156 | デバイスディスクリプタのサイズをバイト単位で示す。 |
| inputReportInfo | GameInputRawDeviceReportInfo* | 8/4 | +160 | +160 | 入力レポート情報配列へのポインタである。 |
| outputReportInfo | GameInputRawDeviceReportInfo* | 8/4 | +168 | +164 | 出力レポート情報配列へのポインタである。 |
| featureReportInfo | GameInputRawDeviceReportInfo* | 8/4 | +176 | +168 | 機能レポート情報配列へのポインタである。 |
| controllerAxisInfo | GameInputControllerAxisInfo* | 8/4 | +184 | +172 | コントローラ軸情報配列へのポインタである。 |
| controllerButtonInfo | GameInputControllerButtonInfo* | 8/4 | +192 | +176 | コントローラボタン情報配列へのポインタである。 |
| controllerSwitchInfo | GameInputControllerSwitchInfo* | 8/4 | +200 | +180 | コントローラスイッチ情報配列へのポインタである。 |
| keyboardInfo | GameInputKeyboardInfo* | 8/4 | +208 | +184 | キーボード情報へのポインタである。非対応時NULL。 |
| mouseInfo | GameInputMouseInfo* | 8/4 | +216 | +188 | マウス情報へのポインタである。非対応時NULL。 |
| touchSensorInfo | GameInputTouchSensorInfo* | 8/4 | +224 | +192 | タッチセンサー情報配列へのポインタである。 |
| motionInfo | GameInputMotionInfo* | 8/4 | +232 | +196 | モーションセンサー情報へのポインタである。非対応時NULL。 |
| arcadeStickInfo | GameInputArcadeStickInfo* | 8/4 | +240 | +200 | アーケードスティック情報へのポインタである。非対応時NULL。 |
| flightStickInfo | GameInputFlightStickInfo* | 8/4 | +248 | +204 | フライトスティック情報へのポインタである。非対応時NULL。 |
| gamepadInfo | GameInputGamepadInfo* | 8/4 | +256 | +208 | ゲームパッド情報へのポインタである。非対応時NULL。 |
| racingWheelInfo | GameInputRacingWheelInfo* | 8/4 | +264 | +212 | レーシングホイール情報へのポインタである。非対応時NULL。 |
| uiNavigationInfo | GameInputUiNavigationInfo* | 8/4 | +272 | +216 | UIナビゲーション情報へのポインタである。非対応時NULL。 |
| forceFeedbackMotorInfo | GameInputForceFeedbackMotorInfo* | 8/4 | +280 | +220 | フォースフィードバックモーター情報配列へのポインタである。 |
| hapticFeedbackMotorInfo | GameInputHapticFeedbackMotorInfo* | 8/4 | +288 | +224 | ハプティックモーター情報配列へのポインタである。 |
| displayName | GameInputString* | 8/4 | +296 | +228 | デバイス表示名を示す文字列情報へのポインタである。 |
| deviceStrings | GameInputString* | 8/4 | +304 | +232 | デバイス文字列配列へのポインタである。 |
| deviceDescriptorData | void* | 8/4 | +312 | +236 | デバイスディスクリプタの生データへのポインタである。 |
| supportedSystemButtons | GameInputSystemButtons | 4 | +320 | +240 | 対応するシステムボタンを示すフラグである。 |
各言語での定義
#include <windows.h>
// GameInputUsage (x64 4 / x86 4 バイト)
typedef struct GameInputUsage {
WORD page;
WORD id;
} GameInputUsage;
// GameInputVersion (x64 8 / x86 8 バイト)
typedef struct GameInputVersion {
WORD major;
WORD minor;
WORD build;
WORD revision;
} GameInputVersion;
// APP_LOCAL_DEVICE_ID (x64 32 / x86 32 バイト)
typedef struct APP_LOCAL_DEVICE_ID {
BYTE value[32];
} APP_LOCAL_DEVICE_ID;
// GameInputDeviceInfo (x64 328 / x86 244 バイト)
typedef struct GameInputDeviceInfo {
DWORD infoSize;
WORD vendorId;
WORD productId;
WORD revisionNumber;
BYTE interfaceNumber;
BYTE collectionNumber;
GameInputUsage usage;
GameInputVersion hardwareVersion;
GameInputVersion firmwareVersion;
APP_LOCAL_DEVICE_ID deviceId;
APP_LOCAL_DEVICE_ID deviceRootId;
GameInputDeviceFamily deviceFamily;
GameInputDeviceCapabilities capabilities;
GameInputKind supportedInput;
GameInputRumbleMotors supportedRumbleMotors;
DWORD inputReportCount;
DWORD outputReportCount;
DWORD featureReportCount;
DWORD controllerAxisCount;
DWORD controllerButtonCount;
DWORD controllerSwitchCount;
DWORD touchPointCount;
DWORD touchSensorCount;
DWORD forceFeedbackMotorCount;
DWORD hapticFeedbackMotorCount;
DWORD deviceStringCount;
DWORD deviceDescriptorSize;
GameInputRawDeviceReportInfo* inputReportInfo;
GameInputRawDeviceReportInfo* outputReportInfo;
GameInputRawDeviceReportInfo* featureReportInfo;
GameInputControllerAxisInfo* controllerAxisInfo;
GameInputControllerButtonInfo* controllerButtonInfo;
GameInputControllerSwitchInfo* controllerSwitchInfo;
GameInputKeyboardInfo* keyboardInfo;
GameInputMouseInfo* mouseInfo;
GameInputTouchSensorInfo* touchSensorInfo;
GameInputMotionInfo* motionInfo;
GameInputArcadeStickInfo* arcadeStickInfo;
GameInputFlightStickInfo* flightStickInfo;
GameInputGamepadInfo* gamepadInfo;
GameInputRacingWheelInfo* racingWheelInfo;
GameInputUiNavigationInfo* uiNavigationInfo;
GameInputForceFeedbackMotorInfo* forceFeedbackMotorInfo;
GameInputHapticFeedbackMotorInfo* hapticFeedbackMotorInfo;
GameInputString* displayName;
GameInputString* deviceStrings;
void* deviceDescriptorData;
GameInputSystemButtons supportedSystemButtons;
} GameInputDeviceInfo;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GameInputUsage
{
public ushort page;
public ushort id;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GameInputVersion
{
public ushort major;
public ushort minor;
public ushort build;
public ushort revision;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct APP_LOCAL_DEVICE_ID
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public byte[] value;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GameInputDeviceInfo
{
public uint infoSize;
public ushort vendorId;
public ushort productId;
public ushort revisionNumber;
public byte interfaceNumber;
public byte collectionNumber;
public GameInputUsage usage;
public GameInputVersion hardwareVersion;
public GameInputVersion firmwareVersion;
public APP_LOCAL_DEVICE_ID deviceId;
public APP_LOCAL_DEVICE_ID deviceRootId;
public int deviceFamily;
public int capabilities;
public int supportedInput;
public int supportedRumbleMotors;
public uint inputReportCount;
public uint outputReportCount;
public uint featureReportCount;
public uint controllerAxisCount;
public uint controllerButtonCount;
public uint controllerSwitchCount;
public uint touchPointCount;
public uint touchSensorCount;
public uint forceFeedbackMotorCount;
public uint hapticFeedbackMotorCount;
public uint deviceStringCount;
public uint deviceDescriptorSize;
public IntPtr inputReportInfo;
public IntPtr outputReportInfo;
public IntPtr featureReportInfo;
public IntPtr controllerAxisInfo;
public IntPtr controllerButtonInfo;
public IntPtr controllerSwitchInfo;
public IntPtr keyboardInfo;
public IntPtr mouseInfo;
public IntPtr touchSensorInfo;
public IntPtr motionInfo;
public IntPtr arcadeStickInfo;
public IntPtr flightStickInfo;
public IntPtr gamepadInfo;
public IntPtr racingWheelInfo;
public IntPtr uiNavigationInfo;
public IntPtr forceFeedbackMotorInfo;
public IntPtr hapticFeedbackMotorInfo;
public IntPtr displayName;
public IntPtr deviceStrings;
public IntPtr deviceDescriptorData;
public int supportedSystemButtons;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GameInputUsage
Public page As UShort
Public id As UShort
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GameInputVersion
Public major As UShort
Public minor As UShort
Public build As UShort
Public revision As UShort
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure APP_LOCAL_DEVICE_ID
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=32)> Public value() As Byte
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GameInputDeviceInfo
Public infoSize As UInteger
Public vendorId As UShort
Public productId As UShort
Public revisionNumber As UShort
Public interfaceNumber As Byte
Public collectionNumber As Byte
Public usage As GameInputUsage
Public hardwareVersion As GameInputVersion
Public firmwareVersion As GameInputVersion
Public deviceId As APP_LOCAL_DEVICE_ID
Public deviceRootId As APP_LOCAL_DEVICE_ID
Public deviceFamily As Integer
Public capabilities As Integer
Public supportedInput As Integer
Public supportedRumbleMotors As Integer
Public inputReportCount As UInteger
Public outputReportCount As UInteger
Public featureReportCount As UInteger
Public controllerAxisCount As UInteger
Public controllerButtonCount As UInteger
Public controllerSwitchCount As UInteger
Public touchPointCount As UInteger
Public touchSensorCount As UInteger
Public forceFeedbackMotorCount As UInteger
Public hapticFeedbackMotorCount As UInteger
Public deviceStringCount As UInteger
Public deviceDescriptorSize As UInteger
Public inputReportInfo As IntPtr
Public outputReportInfo As IntPtr
Public featureReportInfo As IntPtr
Public controllerAxisInfo As IntPtr
Public controllerButtonInfo As IntPtr
Public controllerSwitchInfo As IntPtr
Public keyboardInfo As IntPtr
Public mouseInfo As IntPtr
Public touchSensorInfo As IntPtr
Public motionInfo As IntPtr
Public arcadeStickInfo As IntPtr
Public flightStickInfo As IntPtr
Public gamepadInfo As IntPtr
Public racingWheelInfo As IntPtr
Public uiNavigationInfo As IntPtr
Public forceFeedbackMotorInfo As IntPtr
Public hapticFeedbackMotorInfo As IntPtr
Public displayName As IntPtr
Public deviceStrings As IntPtr
Public deviceDescriptorData As IntPtr
Public supportedSystemButtons As Integer
End Structureimport ctypes
from ctypes import wintypes
class GameInputUsage(ctypes.Structure):
_fields_ = [
("page", ctypes.c_ushort),
("id", ctypes.c_ushort),
]
class GameInputVersion(ctypes.Structure):
_fields_ = [
("major", ctypes.c_ushort),
("minor", ctypes.c_ushort),
("build", ctypes.c_ushort),
("revision", ctypes.c_ushort),
]
class APP_LOCAL_DEVICE_ID(ctypes.Structure):
_fields_ = [
("value", ctypes.c_ubyte * 32),
]
class GameInputDeviceInfo(ctypes.Structure):
_fields_ = [
("infoSize", wintypes.DWORD),
("vendorId", ctypes.c_ushort),
("productId", ctypes.c_ushort),
("revisionNumber", ctypes.c_ushort),
("interfaceNumber", ctypes.c_ubyte),
("collectionNumber", ctypes.c_ubyte),
("usage", GameInputUsage),
("hardwareVersion", GameInputVersion),
("firmwareVersion", GameInputVersion),
("deviceId", APP_LOCAL_DEVICE_ID),
("deviceRootId", APP_LOCAL_DEVICE_ID),
("deviceFamily", ctypes.c_int),
("capabilities", ctypes.c_int),
("supportedInput", ctypes.c_int),
("supportedRumbleMotors", ctypes.c_int),
("inputReportCount", wintypes.DWORD),
("outputReportCount", wintypes.DWORD),
("featureReportCount", wintypes.DWORD),
("controllerAxisCount", wintypes.DWORD),
("controllerButtonCount", wintypes.DWORD),
("controllerSwitchCount", wintypes.DWORD),
("touchPointCount", wintypes.DWORD),
("touchSensorCount", wintypes.DWORD),
("forceFeedbackMotorCount", wintypes.DWORD),
("hapticFeedbackMotorCount", wintypes.DWORD),
("deviceStringCount", wintypes.DWORD),
("deviceDescriptorSize", wintypes.DWORD),
("inputReportInfo", ctypes.c_void_p),
("outputReportInfo", ctypes.c_void_p),
("featureReportInfo", ctypes.c_void_p),
("controllerAxisInfo", ctypes.c_void_p),
("controllerButtonInfo", ctypes.c_void_p),
("controllerSwitchInfo", ctypes.c_void_p),
("keyboardInfo", ctypes.c_void_p),
("mouseInfo", ctypes.c_void_p),
("touchSensorInfo", ctypes.c_void_p),
("motionInfo", ctypes.c_void_p),
("arcadeStickInfo", ctypes.c_void_p),
("flightStickInfo", ctypes.c_void_p),
("gamepadInfo", ctypes.c_void_p),
("racingWheelInfo", ctypes.c_void_p),
("uiNavigationInfo", ctypes.c_void_p),
("forceFeedbackMotorInfo", ctypes.c_void_p),
("hapticFeedbackMotorInfo", ctypes.c_void_p),
("displayName", ctypes.c_void_p),
("deviceStrings", ctypes.c_void_p),
("deviceDescriptorData", ctypes.c_void_p),
("supportedSystemButtons", ctypes.c_int),
]#[repr(C)]
pub struct GameInputUsage {
pub page: u16,
pub id: u16,
}
#[repr(C)]
pub struct GameInputVersion {
pub major: u16,
pub minor: u16,
pub build: u16,
pub revision: u16,
}
#[repr(C)]
pub struct APP_LOCAL_DEVICE_ID {
pub value: [u8; 32],
}
#[repr(C)]
pub struct GameInputDeviceInfo {
pub infoSize: u32,
pub vendorId: u16,
pub productId: u16,
pub revisionNumber: u16,
pub interfaceNumber: u8,
pub collectionNumber: u8,
pub usage: GameInputUsage,
pub hardwareVersion: GameInputVersion,
pub firmwareVersion: GameInputVersion,
pub deviceId: APP_LOCAL_DEVICE_ID,
pub deviceRootId: APP_LOCAL_DEVICE_ID,
pub deviceFamily: i32,
pub capabilities: i32,
pub supportedInput: i32,
pub supportedRumbleMotors: i32,
pub inputReportCount: u32,
pub outputReportCount: u32,
pub featureReportCount: u32,
pub controllerAxisCount: u32,
pub controllerButtonCount: u32,
pub controllerSwitchCount: u32,
pub touchPointCount: u32,
pub touchSensorCount: u32,
pub forceFeedbackMotorCount: u32,
pub hapticFeedbackMotorCount: u32,
pub deviceStringCount: u32,
pub deviceDescriptorSize: u32,
pub inputReportInfo: *mut core::ffi::c_void,
pub outputReportInfo: *mut core::ffi::c_void,
pub featureReportInfo: *mut core::ffi::c_void,
pub controllerAxisInfo: *mut core::ffi::c_void,
pub controllerButtonInfo: *mut core::ffi::c_void,
pub controllerSwitchInfo: *mut core::ffi::c_void,
pub keyboardInfo: *mut core::ffi::c_void,
pub mouseInfo: *mut core::ffi::c_void,
pub touchSensorInfo: *mut core::ffi::c_void,
pub motionInfo: *mut core::ffi::c_void,
pub arcadeStickInfo: *mut core::ffi::c_void,
pub flightStickInfo: *mut core::ffi::c_void,
pub gamepadInfo: *mut core::ffi::c_void,
pub racingWheelInfo: *mut core::ffi::c_void,
pub uiNavigationInfo: *mut core::ffi::c_void,
pub forceFeedbackMotorInfo: *mut core::ffi::c_void,
pub hapticFeedbackMotorInfo: *mut core::ffi::c_void,
pub displayName: *mut core::ffi::c_void,
pub deviceStrings: *mut core::ffi::c_void,
pub deviceDescriptorData: *mut core::ffi::c_void,
pub supportedSystemButtons: i32,
}import "golang.org/x/sys/windows"
type GameInputUsage struct {
page uint16
id uint16
}
type GameInputVersion struct {
major uint16
minor uint16
build uint16
revision uint16
}
type APP_LOCAL_DEVICE_ID struct {
value [32]byte
}
type GameInputDeviceInfo struct {
infoSize uint32
vendorId uint16
productId uint16
revisionNumber uint16
interfaceNumber byte
collectionNumber byte
usage GameInputUsage
hardwareVersion GameInputVersion
firmwareVersion GameInputVersion
deviceId APP_LOCAL_DEVICE_ID
deviceRootId APP_LOCAL_DEVICE_ID
deviceFamily int32
capabilities int32
supportedInput int32
supportedRumbleMotors int32
inputReportCount uint32
outputReportCount uint32
featureReportCount uint32
controllerAxisCount uint32
controllerButtonCount uint32
controllerSwitchCount uint32
touchPointCount uint32
touchSensorCount uint32
forceFeedbackMotorCount uint32
hapticFeedbackMotorCount uint32
deviceStringCount uint32
deviceDescriptorSize uint32
inputReportInfo uintptr
outputReportInfo uintptr
featureReportInfo uintptr
controllerAxisInfo uintptr
controllerButtonInfo uintptr
controllerSwitchInfo uintptr
keyboardInfo uintptr
mouseInfo uintptr
touchSensorInfo uintptr
motionInfo uintptr
arcadeStickInfo uintptr
flightStickInfo uintptr
gamepadInfo uintptr
racingWheelInfo uintptr
uiNavigationInfo uintptr
forceFeedbackMotorInfo uintptr
hapticFeedbackMotorInfo uintptr
displayName uintptr
deviceStrings uintptr
deviceDescriptorData uintptr
supportedSystemButtons int32
}type
GameInputUsage = record
page: Word;
id: Word;
end;
GameInputVersion = record
major: Word;
minor: Word;
build: Word;
revision: Word;
end;
APP_LOCAL_DEVICE_ID = record
value: array[0..31] of Byte;
end;
GameInputDeviceInfo = record
infoSize: DWORD;
vendorId: Word;
productId: Word;
revisionNumber: Word;
interfaceNumber: Byte;
collectionNumber: Byte;
usage: GameInputUsage;
hardwareVersion: GameInputVersion;
firmwareVersion: GameInputVersion;
deviceId: APP_LOCAL_DEVICE_ID;
deviceRootId: APP_LOCAL_DEVICE_ID;
deviceFamily: Integer;
capabilities: Integer;
supportedInput: Integer;
supportedRumbleMotors: Integer;
inputReportCount: DWORD;
outputReportCount: DWORD;
featureReportCount: DWORD;
controllerAxisCount: DWORD;
controllerButtonCount: DWORD;
controllerSwitchCount: DWORD;
touchPointCount: DWORD;
touchSensorCount: DWORD;
forceFeedbackMotorCount: DWORD;
hapticFeedbackMotorCount: DWORD;
deviceStringCount: DWORD;
deviceDescriptorSize: DWORD;
inputReportInfo: Pointer;
outputReportInfo: Pointer;
featureReportInfo: Pointer;
controllerAxisInfo: Pointer;
controllerButtonInfo: Pointer;
controllerSwitchInfo: Pointer;
keyboardInfo: Pointer;
mouseInfo: Pointer;
touchSensorInfo: Pointer;
motionInfo: Pointer;
arcadeStickInfo: Pointer;
flightStickInfo: Pointer;
gamepadInfo: Pointer;
racingWheelInfo: Pointer;
uiNavigationInfo: Pointer;
forceFeedbackMotorInfo: Pointer;
hapticFeedbackMotorInfo: Pointer;
displayName: Pointer;
deviceStrings: Pointer;
deviceDescriptorData: Pointer;
supportedSystemButtons: Integer;
end;const GameInputUsage = extern struct {
page: u16,
id: u16,
};
const GameInputVersion = extern struct {
major: u16,
minor: u16,
build: u16,
revision: u16,
};
const APP_LOCAL_DEVICE_ID = extern struct {
value: [32]u8,
};
const GameInputDeviceInfo = extern struct {
infoSize: u32,
vendorId: u16,
productId: u16,
revisionNumber: u16,
interfaceNumber: u8,
collectionNumber: u8,
usage: GameInputUsage,
hardwareVersion: GameInputVersion,
firmwareVersion: GameInputVersion,
deviceId: APP_LOCAL_DEVICE_ID,
deviceRootId: APP_LOCAL_DEVICE_ID,
deviceFamily: i32,
capabilities: i32,
supportedInput: i32,
supportedRumbleMotors: i32,
inputReportCount: u32,
outputReportCount: u32,
featureReportCount: u32,
controllerAxisCount: u32,
controllerButtonCount: u32,
controllerSwitchCount: u32,
touchPointCount: u32,
touchSensorCount: u32,
forceFeedbackMotorCount: u32,
hapticFeedbackMotorCount: u32,
deviceStringCount: u32,
deviceDescriptorSize: u32,
inputReportInfo: ?*anyopaque,
outputReportInfo: ?*anyopaque,
featureReportInfo: ?*anyopaque,
controllerAxisInfo: ?*anyopaque,
controllerButtonInfo: ?*anyopaque,
controllerSwitchInfo: ?*anyopaque,
keyboardInfo: ?*anyopaque,
mouseInfo: ?*anyopaque,
touchSensorInfo: ?*anyopaque,
motionInfo: ?*anyopaque,
arcadeStickInfo: ?*anyopaque,
flightStickInfo: ?*anyopaque,
gamepadInfo: ?*anyopaque,
racingWheelInfo: ?*anyopaque,
uiNavigationInfo: ?*anyopaque,
forceFeedbackMotorInfo: ?*anyopaque,
hapticFeedbackMotorInfo: ?*anyopaque,
displayName: ?*anyopaque,
deviceStrings: ?*anyopaque,
deviceDescriptorData: ?*anyopaque,
supportedSystemButtons: i32,
};type
GameInputUsage {.bycopy.} = object
page: uint16
id: uint16
GameInputVersion {.bycopy.} = object
major: uint16
minor: uint16
build: uint16
revision: uint16
APP_LOCAL_DEVICE_ID {.bycopy.} = object
value: array[32, uint8]
GameInputDeviceInfo {.bycopy.} = object
infoSize: uint32
vendorId: uint16
productId: uint16
revisionNumber: uint16
interfaceNumber: uint8
collectionNumber: uint8
usage: GameInputUsage
hardwareVersion: GameInputVersion
firmwareVersion: GameInputVersion
deviceId: APP_LOCAL_DEVICE_ID
deviceRootId: APP_LOCAL_DEVICE_ID
deviceFamily: int32
capabilities: int32
supportedInput: int32
supportedRumbleMotors: int32
inputReportCount: uint32
outputReportCount: uint32
featureReportCount: uint32
controllerAxisCount: uint32
controllerButtonCount: uint32
controllerSwitchCount: uint32
touchPointCount: uint32
touchSensorCount: uint32
forceFeedbackMotorCount: uint32
hapticFeedbackMotorCount: uint32
deviceStringCount: uint32
deviceDescriptorSize: uint32
inputReportInfo: pointer
outputReportInfo: pointer
featureReportInfo: pointer
controllerAxisInfo: pointer
controllerButtonInfo: pointer
controllerSwitchInfo: pointer
keyboardInfo: pointer
mouseInfo: pointer
touchSensorInfo: pointer
motionInfo: pointer
arcadeStickInfo: pointer
flightStickInfo: pointer
gamepadInfo: pointer
racingWheelInfo: pointer
uiNavigationInfo: pointer
forceFeedbackMotorInfo: pointer
hapticFeedbackMotorInfo: pointer
displayName: pointer
deviceStrings: pointer
deviceDescriptorData: pointer
supportedSystemButtons: int32struct GameInputUsage
{
ushort page;
ushort id;
}
struct GameInputVersion
{
ushort major;
ushort minor;
ushort build;
ushort revision;
}
struct APP_LOCAL_DEVICE_ID
{
ubyte[32] value;
}
struct GameInputDeviceInfo
{
uint infoSize;
ushort vendorId;
ushort productId;
ushort revisionNumber;
ubyte interfaceNumber;
ubyte collectionNumber;
GameInputUsage usage;
GameInputVersion hardwareVersion;
GameInputVersion firmwareVersion;
APP_LOCAL_DEVICE_ID deviceId;
APP_LOCAL_DEVICE_ID deviceRootId;
int deviceFamily;
int capabilities;
int supportedInput;
int supportedRumbleMotors;
uint inputReportCount;
uint outputReportCount;
uint featureReportCount;
uint controllerAxisCount;
uint controllerButtonCount;
uint controllerSwitchCount;
uint touchPointCount;
uint touchSensorCount;
uint forceFeedbackMotorCount;
uint hapticFeedbackMotorCount;
uint deviceStringCount;
uint deviceDescriptorSize;
void* inputReportInfo;
void* outputReportInfo;
void* featureReportInfo;
void* controllerAxisInfo;
void* controllerButtonInfo;
void* controllerSwitchInfo;
void* keyboardInfo;
void* mouseInfo;
void* touchSensorInfo;
void* motionInfo;
void* arcadeStickInfo;
void* flightStickInfo;
void* gamepadInfo;
void* racingWheelInfo;
void* uiNavigationInfo;
void* forceFeedbackMotorInfo;
void* hapticFeedbackMotorInfo;
void* displayName;
void* deviceStrings;
void* deviceDescriptorData;
int supportedSystemButtons;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; GameInputDeviceInfo サイズ: 244 バイト(x86)
dim st, 61 ; 4byte整数×61(構造体サイズ 244 / 4 切り上げ)
; infoSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; vendorId : WORD (+4, 2byte) wpoke st,4,値 / 値 = wpeek(st,4)
; productId : WORD (+6, 2byte) wpoke st,6,値 / 値 = wpeek(st,6)
; revisionNumber : WORD (+8, 2byte) wpoke st,8,値 / 値 = wpeek(st,8)
; interfaceNumber : BYTE (+10, 1byte) poke st,10,値 / 値 = peek(st,10)
; collectionNumber : BYTE (+11, 1byte) poke st,11,値 / 値 = peek(st,11)
; usage : GameInputUsage (+12, 4byte) varptr(st)+12 を基点に操作(4byte:入れ子/配列)
; hardwareVersion : GameInputVersion (+16, 8byte) varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; firmwareVersion : GameInputVersion (+24, 8byte) varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; deviceId : APP_LOCAL_DEVICE_ID (+32, 32byte) varptr(st)+32 を基点に操作(32byte:入れ子/配列)
; deviceRootId : APP_LOCAL_DEVICE_ID (+64, 32byte) varptr(st)+64 を基点に操作(32byte:入れ子/配列)
; deviceFamily : GameInputDeviceFamily (+96, 4byte) st.24 = 値 / 値 = st.24 (lpoke/lpeek も可)
; capabilities : GameInputDeviceCapabilities (+100, 4byte) st.25 = 値 / 値 = st.25 (lpoke/lpeek も可)
; supportedInput : GameInputKind (+104, 4byte) st.26 = 値 / 値 = st.26 (lpoke/lpeek も可)
; supportedRumbleMotors : GameInputRumbleMotors (+108, 4byte) st.27 = 値 / 値 = st.27 (lpoke/lpeek も可)
; inputReportCount : DWORD (+112, 4byte) st.28 = 値 / 値 = st.28 (lpoke/lpeek も可)
; outputReportCount : DWORD (+116, 4byte) st.29 = 値 / 値 = st.29 (lpoke/lpeek も可)
; featureReportCount : DWORD (+120, 4byte) st.30 = 値 / 値 = st.30 (lpoke/lpeek も可)
; controllerAxisCount : DWORD (+124, 4byte) st.31 = 値 / 値 = st.31 (lpoke/lpeek も可)
; controllerButtonCount : DWORD (+128, 4byte) st.32 = 値 / 値 = st.32 (lpoke/lpeek も可)
; controllerSwitchCount : DWORD (+132, 4byte) st.33 = 値 / 値 = st.33 (lpoke/lpeek も可)
; touchPointCount : DWORD (+136, 4byte) st.34 = 値 / 値 = st.34 (lpoke/lpeek も可)
; touchSensorCount : DWORD (+140, 4byte) st.35 = 値 / 値 = st.35 (lpoke/lpeek も可)
; forceFeedbackMotorCount : DWORD (+144, 4byte) st.36 = 値 / 値 = st.36 (lpoke/lpeek も可)
; hapticFeedbackMotorCount : DWORD (+148, 4byte) st.37 = 値 / 値 = st.37 (lpoke/lpeek も可)
; deviceStringCount : DWORD (+152, 4byte) st.38 = 値 / 値 = st.38 (lpoke/lpeek も可)
; deviceDescriptorSize : DWORD (+156, 4byte) st.39 = 値 / 値 = st.39 (lpoke/lpeek も可)
; inputReportInfo : GameInputRawDeviceReportInfo* (+160, 4byte) varptr(st)+160 を基点に操作(4byte:入れ子/配列)
; outputReportInfo : GameInputRawDeviceReportInfo* (+164, 4byte) varptr(st)+164 を基点に操作(4byte:入れ子/配列)
; featureReportInfo : GameInputRawDeviceReportInfo* (+168, 4byte) varptr(st)+168 を基点に操作(4byte:入れ子/配列)
; controllerAxisInfo : GameInputControllerAxisInfo* (+172, 4byte) varptr(st)+172 を基点に操作(4byte:入れ子/配列)
; controllerButtonInfo : GameInputControllerButtonInfo* (+176, 4byte) varptr(st)+176 を基点に操作(4byte:入れ子/配列)
; controllerSwitchInfo : GameInputControllerSwitchInfo* (+180, 4byte) varptr(st)+180 を基点に操作(4byte:入れ子/配列)
; keyboardInfo : GameInputKeyboardInfo* (+184, 4byte) varptr(st)+184 を基点に操作(4byte:入れ子/配列)
; mouseInfo : GameInputMouseInfo* (+188, 4byte) varptr(st)+188 を基点に操作(4byte:入れ子/配列)
; touchSensorInfo : GameInputTouchSensorInfo* (+192, 4byte) varptr(st)+192 を基点に操作(4byte:入れ子/配列)
; motionInfo : GameInputMotionInfo* (+196, 4byte) varptr(st)+196 を基点に操作(4byte:入れ子/配列)
; arcadeStickInfo : GameInputArcadeStickInfo* (+200, 4byte) varptr(st)+200 を基点に操作(4byte:入れ子/配列)
; flightStickInfo : GameInputFlightStickInfo* (+204, 4byte) varptr(st)+204 を基点に操作(4byte:入れ子/配列)
; gamepadInfo : GameInputGamepadInfo* (+208, 4byte) varptr(st)+208 を基点に操作(4byte:入れ子/配列)
; racingWheelInfo : GameInputRacingWheelInfo* (+212, 4byte) varptr(st)+212 を基点に操作(4byte:入れ子/配列)
; uiNavigationInfo : GameInputUiNavigationInfo* (+216, 4byte) varptr(st)+216 を基点に操作(4byte:入れ子/配列)
; forceFeedbackMotorInfo : GameInputForceFeedbackMotorInfo* (+220, 4byte) varptr(st)+220 を基点に操作(4byte:入れ子/配列)
; hapticFeedbackMotorInfo : GameInputHapticFeedbackMotorInfo* (+224, 4byte) varptr(st)+224 を基点に操作(4byte:入れ子/配列)
; displayName : GameInputString* (+228, 4byte) varptr(st)+228 を基点に操作(4byte:入れ子/配列)
; deviceStrings : GameInputString* (+232, 4byte) varptr(st)+232 を基点に操作(4byte:入れ子/配列)
; deviceDescriptorData : void* (+236, 4byte) st.59 = 値 / 値 = st.59 (lpoke/lpeek も可)
; supportedSystemButtons : GameInputSystemButtons (+240, 4byte) st.60 = 値 / 値 = st.60 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GameInputDeviceInfo サイズ: 328 バイト(x64)
dim st, 82 ; 4byte整数×82(構造体サイズ 328 / 4 切り上げ)
; infoSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; vendorId : WORD (+4, 2byte) wpoke st,4,値 / 値 = wpeek(st,4)
; productId : WORD (+6, 2byte) wpoke st,6,値 / 値 = wpeek(st,6)
; revisionNumber : WORD (+8, 2byte) wpoke st,8,値 / 値 = wpeek(st,8)
; interfaceNumber : BYTE (+10, 1byte) poke st,10,値 / 値 = peek(st,10)
; collectionNumber : BYTE (+11, 1byte) poke st,11,値 / 値 = peek(st,11)
; usage : GameInputUsage (+12, 4byte) varptr(st)+12 を基点に操作(4byte:入れ子/配列)
; hardwareVersion : GameInputVersion (+16, 8byte) varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; firmwareVersion : GameInputVersion (+24, 8byte) varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; deviceId : APP_LOCAL_DEVICE_ID (+32, 32byte) varptr(st)+32 を基点に操作(32byte:入れ子/配列)
; deviceRootId : APP_LOCAL_DEVICE_ID (+64, 32byte) varptr(st)+64 を基点に操作(32byte:入れ子/配列)
; deviceFamily : GameInputDeviceFamily (+96, 4byte) st.24 = 値 / 値 = st.24 (lpoke/lpeek も可)
; capabilities : GameInputDeviceCapabilities (+100, 4byte) st.25 = 値 / 値 = st.25 (lpoke/lpeek も可)
; supportedInput : GameInputKind (+104, 4byte) st.26 = 値 / 値 = st.26 (lpoke/lpeek も可)
; supportedRumbleMotors : GameInputRumbleMotors (+108, 4byte) st.27 = 値 / 値 = st.27 (lpoke/lpeek も可)
; inputReportCount : DWORD (+112, 4byte) st.28 = 値 / 値 = st.28 (lpoke/lpeek も可)
; outputReportCount : DWORD (+116, 4byte) st.29 = 値 / 値 = st.29 (lpoke/lpeek も可)
; featureReportCount : DWORD (+120, 4byte) st.30 = 値 / 値 = st.30 (lpoke/lpeek も可)
; controllerAxisCount : DWORD (+124, 4byte) st.31 = 値 / 値 = st.31 (lpoke/lpeek も可)
; controllerButtonCount : DWORD (+128, 4byte) st.32 = 値 / 値 = st.32 (lpoke/lpeek も可)
; controllerSwitchCount : DWORD (+132, 4byte) st.33 = 値 / 値 = st.33 (lpoke/lpeek も可)
; touchPointCount : DWORD (+136, 4byte) st.34 = 値 / 値 = st.34 (lpoke/lpeek も可)
; touchSensorCount : DWORD (+140, 4byte) st.35 = 値 / 値 = st.35 (lpoke/lpeek も可)
; forceFeedbackMotorCount : DWORD (+144, 4byte) st.36 = 値 / 値 = st.36 (lpoke/lpeek も可)
; hapticFeedbackMotorCount : DWORD (+148, 4byte) st.37 = 値 / 値 = st.37 (lpoke/lpeek も可)
; deviceStringCount : DWORD (+152, 4byte) st.38 = 値 / 値 = st.38 (lpoke/lpeek も可)
; deviceDescriptorSize : DWORD (+156, 4byte) st.39 = 値 / 値 = st.39 (lpoke/lpeek も可)
; inputReportInfo : GameInputRawDeviceReportInfo* (+160, 8byte) varptr(st)+160 を基点に操作(8byte:入れ子/配列)
; outputReportInfo : GameInputRawDeviceReportInfo* (+168, 8byte) varptr(st)+168 を基点に操作(8byte:入れ子/配列)
; featureReportInfo : GameInputRawDeviceReportInfo* (+176, 8byte) varptr(st)+176 を基点に操作(8byte:入れ子/配列)
; controllerAxisInfo : GameInputControllerAxisInfo* (+184, 8byte) varptr(st)+184 を基点に操作(8byte:入れ子/配列)
; controllerButtonInfo : GameInputControllerButtonInfo* (+192, 8byte) varptr(st)+192 を基点に操作(8byte:入れ子/配列)
; controllerSwitchInfo : GameInputControllerSwitchInfo* (+200, 8byte) varptr(st)+200 を基点に操作(8byte:入れ子/配列)
; keyboardInfo : GameInputKeyboardInfo* (+208, 8byte) varptr(st)+208 を基点に操作(8byte:入れ子/配列)
; mouseInfo : GameInputMouseInfo* (+216, 8byte) varptr(st)+216 を基点に操作(8byte:入れ子/配列)
; touchSensorInfo : GameInputTouchSensorInfo* (+224, 8byte) varptr(st)+224 を基点に操作(8byte:入れ子/配列)
; motionInfo : GameInputMotionInfo* (+232, 8byte) varptr(st)+232 を基点に操作(8byte:入れ子/配列)
; arcadeStickInfo : GameInputArcadeStickInfo* (+240, 8byte) varptr(st)+240 を基点に操作(8byte:入れ子/配列)
; flightStickInfo : GameInputFlightStickInfo* (+248, 8byte) varptr(st)+248 を基点に操作(8byte:入れ子/配列)
; gamepadInfo : GameInputGamepadInfo* (+256, 8byte) varptr(st)+256 を基点に操作(8byte:入れ子/配列)
; racingWheelInfo : GameInputRacingWheelInfo* (+264, 8byte) varptr(st)+264 を基点に操作(8byte:入れ子/配列)
; uiNavigationInfo : GameInputUiNavigationInfo* (+272, 8byte) varptr(st)+272 を基点に操作(8byte:入れ子/配列)
; forceFeedbackMotorInfo : GameInputForceFeedbackMotorInfo* (+280, 8byte) varptr(st)+280 を基点に操作(8byte:入れ子/配列)
; hapticFeedbackMotorInfo : GameInputHapticFeedbackMotorInfo* (+288, 8byte) varptr(st)+288 を基点に操作(8byte:入れ子/配列)
; displayName : GameInputString* (+296, 8byte) varptr(st)+296 を基点に操作(8byte:入れ子/配列)
; deviceStrings : GameInputString* (+304, 8byte) varptr(st)+304 を基点に操作(8byte:入れ子/配列)
; deviceDescriptorData : void* (+312, 8byte) qpoke st,312,値 / qpeek(st,312) ※IronHSPのみ。3.7/3.8は lpoke st,312,下位 : lpoke st,316,上位
; supportedSystemButtons : GameInputSystemButtons (+320, 4byte) st.80 = 値 / 値 = st.80 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GameInputUsage
#field short page
#field short id
#endstruct
#defstruct global GameInputVersion
#field short major
#field short minor
#field short build
#field short revision
#endstruct
#defstruct global APP_LOCAL_DEVICE_ID
#field byte value 32
#endstruct
#defstruct global GameInputDeviceInfo
#field int infoSize
#field short vendorId
#field short productId
#field short revisionNumber
#field byte interfaceNumber
#field byte collectionNumber
#field GameInputUsage usage
#field GameInputVersion hardwareVersion
#field GameInputVersion firmwareVersion
#field APP_LOCAL_DEVICE_ID deviceId
#field APP_LOCAL_DEVICE_ID deviceRootId
#field int deviceFamily
#field int capabilities
#field int supportedInput
#field int supportedRumbleMotors
#field int inputReportCount
#field int outputReportCount
#field int featureReportCount
#field int controllerAxisCount
#field int controllerButtonCount
#field int controllerSwitchCount
#field int touchPointCount
#field int touchSensorCount
#field int forceFeedbackMotorCount
#field int hapticFeedbackMotorCount
#field int deviceStringCount
#field int deviceDescriptorSize
#field intptr inputReportInfo
#field intptr outputReportInfo
#field intptr featureReportInfo
#field intptr controllerAxisInfo
#field intptr controllerButtonInfo
#field intptr controllerSwitchInfo
#field intptr keyboardInfo
#field intptr mouseInfo
#field intptr touchSensorInfo
#field intptr motionInfo
#field intptr arcadeStickInfo
#field intptr flightStickInfo
#field intptr gamepadInfo
#field intptr racingWheelInfo
#field intptr uiNavigationInfo
#field intptr forceFeedbackMotorInfo
#field intptr hapticFeedbackMotorInfo
#field intptr displayName
#field intptr deviceStrings
#field intptr deviceDescriptorData
#field int supportedSystemButtons
#endstruct
stdim st, GameInputDeviceInfo ; NSTRUCT 変数を確保
st->infoSize = 100
mes "infoSize=" + st->infoSize