ホーム › UI.Input.GameInput › GameInputHapticFeedbackParams
GameInputHapticFeedbackParams
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| waveformIndex | DWORD | 4 | +0 | +0 | 使用する波形のインデックスである。 |
| duration | ULONGLONG | 8 | +8 | +8 | 再生時間をマイクロ秒で指定する。 |
| intensity | FLOAT | 4 | +16 | +16 | 再生強度を0〜1で指定する。 |
| playCount | DWORD | 4 | +20 | +20 | 再生回数である。 |
| repeatDelay | ULONGLONG | 8 | +24 | +24 | 繰り返し間の遅延をマイクロ秒で指定する。 |
各言語での定義
#include <windows.h>
// GameInputHapticFeedbackParams (x64 32 / x86 32 バイト)
typedef struct GameInputHapticFeedbackParams {
DWORD waveformIndex;
ULONGLONG duration;
FLOAT intensity;
DWORD playCount;
ULONGLONG repeatDelay;
} GameInputHapticFeedbackParams;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GameInputHapticFeedbackParams
{
public uint waveformIndex;
public ulong duration;
public float intensity;
public uint playCount;
public ulong repeatDelay;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GameInputHapticFeedbackParams
Public waveformIndex As UInteger
Public duration As ULong
Public intensity As Single
Public playCount As UInteger
Public repeatDelay As ULong
End Structureimport ctypes
from ctypes import wintypes
class GameInputHapticFeedbackParams(ctypes.Structure):
_fields_ = [
("waveformIndex", wintypes.DWORD),
("duration", ctypes.c_ulonglong),
("intensity", ctypes.c_float),
("playCount", wintypes.DWORD),
("repeatDelay", ctypes.c_ulonglong),
]#[repr(C)]
pub struct GameInputHapticFeedbackParams {
pub waveformIndex: u32,
pub duration: u64,
pub intensity: f32,
pub playCount: u32,
pub repeatDelay: u64,
}import "golang.org/x/sys/windows"
type GameInputHapticFeedbackParams struct {
waveformIndex uint32
duration uint64
intensity float32
playCount uint32
repeatDelay uint64
}type
GameInputHapticFeedbackParams = record
waveformIndex: DWORD;
duration: UInt64;
intensity: Single;
playCount: DWORD;
repeatDelay: UInt64;
end;const GameInputHapticFeedbackParams = extern struct {
waveformIndex: u32,
duration: u64,
intensity: f32,
playCount: u32,
repeatDelay: u64,
};type
GameInputHapticFeedbackParams {.bycopy.} = object
waveformIndex: uint32
duration: uint64
intensity: float32
playCount: uint32
repeatDelay: uint64struct GameInputHapticFeedbackParams
{
uint waveformIndex;
ulong duration;
float intensity;
uint playCount;
ulong repeatDelay;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GameInputHapticFeedbackParams サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; waveformIndex : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; duration : ULONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; intensity : FLOAT (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; playCount : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; repeatDelay : ULONGLONG (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global GameInputHapticFeedbackParams
#field int waveformIndex
#field int64 duration
#field float intensity
#field int playCount
#field int64 repeatDelay
#endstruct
stdim st, GameInputHapticFeedbackParams ; NSTRUCT 変数を確保
st->waveformIndex = 100
mes "waveformIndex=" + st->waveformIndex