ホーム › UI.Input.GameInput › GameInputControllerAxisInfo
GameInputControllerAxisInfo
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| mappedInputKinds | GameInputKind | 4 | +0 | +0 | この軸が対応づく入力種別を示すフラグである。 |
| label | GameInputLabel | 4 | +4 | +4 | 軸に付与された物理ラベルを示す値である。 |
| isContinuous | BYTE | 1 | +8 | +8 | 連続値の軸であるかを示す真偽値である。 |
| isNonlinear | BYTE | 1 | +9 | +9 | 非線形の軸であるかを示す真偽値である。 |
| isQuantized | BYTE | 1 | +10 | +10 | 量子化された軸であるかを示す真偽値である。 |
| hasRestValue | BYTE | 1 | +11 | +11 | 静止位置の値を持つかを示す真偽値である。 |
| restValue | FLOAT | 4 | +12 | +12 | 軸の静止位置の値である。 |
| resolution | ULONGLONG | 8 | +16 | +16 | 軸の分解能(取り得る値の段階数)である。 |
| legacyDInputIndex | WORD | 2 | +24 | +24 | DirectInput互換でのインデックスである。 |
| legacyHidIndex | WORD | 2 | +26 | +26 | HID互換でのインデックスである。 |
| rawReportIndex | DWORD | 4 | +28 | +28 | 生レポート内でのインデックスである。 |
| inputReport | GameInputRawDeviceReportInfo* | 8/4 | +32 | +32 | 対応する入力レポート情報へのポインタである。 |
| inputReportItem | GameInputRawDeviceReportItemInfo* | 8/4 | +40 | +36 | 対応する入力レポートアイテム情報へのポインタである。 |
各言語での定義
#include <windows.h>
// GameInputControllerAxisInfo (x64 48 / x86 40 バイト)
typedef struct GameInputControllerAxisInfo {
GameInputKind mappedInputKinds;
GameInputLabel label;
BYTE isContinuous;
BYTE isNonlinear;
BYTE isQuantized;
BYTE hasRestValue;
FLOAT restValue;
ULONGLONG resolution;
WORD legacyDInputIndex;
WORD legacyHidIndex;
DWORD rawReportIndex;
GameInputRawDeviceReportInfo* inputReport;
GameInputRawDeviceReportItemInfo* inputReportItem;
} GameInputControllerAxisInfo;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GameInputControllerAxisInfo
{
public int mappedInputKinds;
public int label;
public byte isContinuous;
public byte isNonlinear;
public byte isQuantized;
public byte hasRestValue;
public float restValue;
public ulong resolution;
public ushort legacyDInputIndex;
public ushort legacyHidIndex;
public uint rawReportIndex;
public IntPtr inputReport;
public IntPtr inputReportItem;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GameInputControllerAxisInfo
Public mappedInputKinds As Integer
Public label As Integer
Public isContinuous As Byte
Public isNonlinear As Byte
Public isQuantized As Byte
Public hasRestValue As Byte
Public restValue As Single
Public resolution As ULong
Public legacyDInputIndex As UShort
Public legacyHidIndex As UShort
Public rawReportIndex As UInteger
Public inputReport As IntPtr
Public inputReportItem As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class GameInputControllerAxisInfo(ctypes.Structure):
_fields_ = [
("mappedInputKinds", ctypes.c_int),
("label", ctypes.c_int),
("isContinuous", ctypes.c_ubyte),
("isNonlinear", ctypes.c_ubyte),
("isQuantized", ctypes.c_ubyte),
("hasRestValue", ctypes.c_ubyte),
("restValue", ctypes.c_float),
("resolution", ctypes.c_ulonglong),
("legacyDInputIndex", ctypes.c_ushort),
("legacyHidIndex", ctypes.c_ushort),
("rawReportIndex", wintypes.DWORD),
("inputReport", ctypes.c_void_p),
("inputReportItem", ctypes.c_void_p),
]#[repr(C)]
pub struct GameInputControllerAxisInfo {
pub mappedInputKinds: i32,
pub label: i32,
pub isContinuous: u8,
pub isNonlinear: u8,
pub isQuantized: u8,
pub hasRestValue: u8,
pub restValue: f32,
pub resolution: u64,
pub legacyDInputIndex: u16,
pub legacyHidIndex: u16,
pub rawReportIndex: u32,
pub inputReport: *mut core::ffi::c_void,
pub inputReportItem: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type GameInputControllerAxisInfo struct {
mappedInputKinds int32
label int32
isContinuous byte
isNonlinear byte
isQuantized byte
hasRestValue byte
restValue float32
resolution uint64
legacyDInputIndex uint16
legacyHidIndex uint16
rawReportIndex uint32
inputReport uintptr
inputReportItem uintptr
}type
GameInputControllerAxisInfo = record
mappedInputKinds: Integer;
label: Integer;
isContinuous: Byte;
isNonlinear: Byte;
isQuantized: Byte;
hasRestValue: Byte;
restValue: Single;
resolution: UInt64;
legacyDInputIndex: Word;
legacyHidIndex: Word;
rawReportIndex: DWORD;
inputReport: Pointer;
inputReportItem: Pointer;
end;const GameInputControllerAxisInfo = extern struct {
mappedInputKinds: i32,
label: i32,
isContinuous: u8,
isNonlinear: u8,
isQuantized: u8,
hasRestValue: u8,
restValue: f32,
resolution: u64,
legacyDInputIndex: u16,
legacyHidIndex: u16,
rawReportIndex: u32,
inputReport: ?*anyopaque,
inputReportItem: ?*anyopaque,
};type
GameInputControllerAxisInfo {.bycopy.} = object
mappedInputKinds: int32
label: int32
isContinuous: uint8
isNonlinear: uint8
isQuantized: uint8
hasRestValue: uint8
restValue: float32
resolution: uint64
legacyDInputIndex: uint16
legacyHidIndex: uint16
rawReportIndex: uint32
inputReport: pointer
inputReportItem: pointerstruct GameInputControllerAxisInfo
{
int mappedInputKinds;
int label;
ubyte isContinuous;
ubyte isNonlinear;
ubyte isQuantized;
ubyte hasRestValue;
float restValue;
ulong resolution;
ushort legacyDInputIndex;
ushort legacyHidIndex;
uint rawReportIndex;
void* inputReport;
void* inputReportItem;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; GameInputControllerAxisInfo サイズ: 40 バイト(x86)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; mappedInputKinds : GameInputKind (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; label : GameInputLabel (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; isContinuous : BYTE (+8, 1byte) poke st,8,値 / 値 = peek(st,8)
; isNonlinear : BYTE (+9, 1byte) poke st,9,値 / 値 = peek(st,9)
; isQuantized : BYTE (+10, 1byte) poke st,10,値 / 値 = peek(st,10)
; hasRestValue : BYTE (+11, 1byte) poke st,11,値 / 値 = peek(st,11)
; restValue : FLOAT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; resolution : ULONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; legacyDInputIndex : WORD (+24, 2byte) wpoke st,24,値 / 値 = wpeek(st,24)
; legacyHidIndex : WORD (+26, 2byte) wpoke st,26,値 / 値 = wpeek(st,26)
; rawReportIndex : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; inputReport : GameInputRawDeviceReportInfo* (+32, 4byte) varptr(st)+32 を基点に操作(4byte:入れ子/配列)
; inputReportItem : GameInputRawDeviceReportItemInfo* (+36, 4byte) varptr(st)+36 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GameInputControllerAxisInfo サイズ: 48 バイト(x64)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; mappedInputKinds : GameInputKind (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; label : GameInputLabel (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; isContinuous : BYTE (+8, 1byte) poke st,8,値 / 値 = peek(st,8)
; isNonlinear : BYTE (+9, 1byte) poke st,9,値 / 値 = peek(st,9)
; isQuantized : BYTE (+10, 1byte) poke st,10,値 / 値 = peek(st,10)
; hasRestValue : BYTE (+11, 1byte) poke st,11,値 / 値 = peek(st,11)
; restValue : FLOAT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; resolution : ULONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; legacyDInputIndex : WORD (+24, 2byte) wpoke st,24,値 / 値 = wpeek(st,24)
; legacyHidIndex : WORD (+26, 2byte) wpoke st,26,値 / 値 = wpeek(st,26)
; rawReportIndex : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; inputReport : GameInputRawDeviceReportInfo* (+32, 8byte) varptr(st)+32 を基点に操作(8byte:入れ子/配列)
; inputReportItem : GameInputRawDeviceReportItemInfo* (+40, 8byte) varptr(st)+40 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global GameInputControllerAxisInfo
#field int mappedInputKinds
#field int label
#field byte isContinuous
#field byte isNonlinear
#field byte isQuantized
#field byte hasRestValue
#field float restValue
#field int64 resolution
#field short legacyDInputIndex
#field short legacyHidIndex
#field int rawReportIndex
#field intptr inputReport
#field intptr inputReportItem
#endstruct
stdim st, GameInputControllerAxisInfo ; NSTRUCT 変数を確保
st->mappedInputKinds = 100
mes "mappedInputKinds=" + st->mappedInputKinds