Win32 API 日本語リファレンス
ホームUI.Input.GameInput › GameInputHapticFeedbackMotorInfo

GameInputHapticFeedbackMotorInfo

構造体
サイズx64: 24 バイト / x86: 20 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
mappedRumbleMotorsGameInputRumbleMotors4+0+0対応づくランブルモーターを示すフラグである。
locationGameInputLocation4+4+4モーターの配置位置を示す値である。
locationIdDWORD4+8+8同一位置内でのモーター識別IDである。
waveformCountDWORD4+12+12waveformInfo配列の波形個数である。
waveformInfoGameInputHapticWaveformInfo*8/4+16+16対応する波形情報配列へのポインタである。

各言語での定義

#include <windows.h>

// GameInputHapticFeedbackMotorInfo  (x64 24 / x86 20 バイト)
typedef struct GameInputHapticFeedbackMotorInfo {
    GameInputRumbleMotors mappedRumbleMotors;
    GameInputLocation location;
    DWORD locationId;
    DWORD waveformCount;
    GameInputHapticWaveformInfo* waveformInfo;
} GameInputHapticFeedbackMotorInfo;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GameInputHapticFeedbackMotorInfo
{
    public int mappedRumbleMotors;
    public int location;
    public uint locationId;
    public uint waveformCount;
    public IntPtr waveformInfo;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GameInputHapticFeedbackMotorInfo
    Public mappedRumbleMotors As Integer
    Public location As Integer
    Public locationId As UInteger
    Public waveformCount As UInteger
    Public waveformInfo As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class GameInputHapticFeedbackMotorInfo(ctypes.Structure):
    _fields_ = [
        ("mappedRumbleMotors", ctypes.c_int),
        ("location", ctypes.c_int),
        ("locationId", wintypes.DWORD),
        ("waveformCount", wintypes.DWORD),
        ("waveformInfo", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct GameInputHapticFeedbackMotorInfo {
    pub mappedRumbleMotors: i32,
    pub location: i32,
    pub locationId: u32,
    pub waveformCount: u32,
    pub waveformInfo: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type GameInputHapticFeedbackMotorInfo struct {
	mappedRumbleMotors int32
	location int32
	locationId uint32
	waveformCount uint32
	waveformInfo uintptr
}
type
  GameInputHapticFeedbackMotorInfo = record
    mappedRumbleMotors: Integer;
    location: Integer;
    locationId: DWORD;
    waveformCount: DWORD;
    waveformInfo: Pointer;
  end;
const GameInputHapticFeedbackMotorInfo = extern struct {
    mappedRumbleMotors: i32,
    location: i32,
    locationId: u32,
    waveformCount: u32,
    waveformInfo: ?*anyopaque,
};
type
  GameInputHapticFeedbackMotorInfo {.bycopy.} = object
    mappedRumbleMotors: int32
    location: int32
    locationId: uint32
    waveformCount: uint32
    waveformInfo: pointer
struct GameInputHapticFeedbackMotorInfo
{
    int mappedRumbleMotors;
    int location;
    uint locationId;
    uint waveformCount;
    void* waveformInfo;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; GameInputHapticFeedbackMotorInfo サイズ: 20 バイト(x86)
dim st, 5    ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; mappedRumbleMotors : GameInputRumbleMotors (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; location : GameInputLocation (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; locationId : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; waveformCount : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; waveformInfo : GameInputHapticWaveformInfo* (+16, 4byte)  varptr(st)+16 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GameInputHapticFeedbackMotorInfo サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; mappedRumbleMotors : GameInputRumbleMotors (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; location : GameInputLocation (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; locationId : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; waveformCount : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; waveformInfo : GameInputHapticWaveformInfo* (+16, 8byte)  varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global GameInputHapticFeedbackMotorInfo
    #field int mappedRumbleMotors
    #field int location
    #field int locationId
    #field int waveformCount
    #field intptr waveformInfo
#endstruct

stdim st, GameInputHapticFeedbackMotorInfo        ; NSTRUCT 変数を確保
st->mappedRumbleMotors = 100
mes "mappedRumbleMotors=" + st->mappedRumbleMotors