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

GameInputForceFeedbackMotorInfo

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

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

フィールド

フィールドサイズx64x86説明
supportedAxesGameInputFeedbackAxes4+0+0フォースフィードバックが作用する軸を示すフラグである。
locationGameInputLocation4+4+4モーターの配置位置を示す値である。
locationIdDWORD4+8+8同一位置内でのモーター識別IDである。
maxSimultaneousEffectsDWORD4+12+12同時再生可能な最大エフェクト数である。
isConstantEffectSupportedBYTE1+16+16定常力エフェクトに対応するかを示す真偽値である。
isRampEffectSupportedBYTE1+17+17ランプエフェクトに対応するかを示す真偽値である。
isSineWaveEffectSupportedBYTE1+18+18正弦波エフェクトに対応するかを示す真偽値である。
isSquareWaveEffectSupportedBYTE1+19+19矩形波エフェクトに対応するかを示す真偽値である。
isTriangleWaveEffectSupportedBYTE1+20+20三角波エフェクトに対応するかを示す真偽値である。
isSawtoothUpWaveEffectSupportedBYTE1+21+21上昇ノコギリ波エフェクトに対応するかを示す真偽値である。
isSawtoothDownWaveEffectSupportedBYTE1+22+22下降ノコギリ波エフェクトに対応するかを示す真偽値である。
isSpringEffectSupportedBYTE1+23+23スプリングエフェクトに対応するかを示す真偽値である。
isFrictionEffectSupportedBYTE1+24+24摩擦エフェクトに対応するかを示す真偽値である。
isDamperEffectSupportedBYTE1+25+25ダンパーエフェクトに対応するかを示す真偽値である。
isInertiaEffectSupportedBYTE1+26+26慣性エフェクトに対応するかを示す真偽値である。

各言語での定義

#include <windows.h>

// GameInputForceFeedbackMotorInfo  (x64 28 / x86 28 バイト)
typedef struct GameInputForceFeedbackMotorInfo {
    GameInputFeedbackAxes supportedAxes;
    GameInputLocation location;
    DWORD locationId;
    DWORD maxSimultaneousEffects;
    BYTE isConstantEffectSupported;
    BYTE isRampEffectSupported;
    BYTE isSineWaveEffectSupported;
    BYTE isSquareWaveEffectSupported;
    BYTE isTriangleWaveEffectSupported;
    BYTE isSawtoothUpWaveEffectSupported;
    BYTE isSawtoothDownWaveEffectSupported;
    BYTE isSpringEffectSupported;
    BYTE isFrictionEffectSupported;
    BYTE isDamperEffectSupported;
    BYTE isInertiaEffectSupported;
} GameInputForceFeedbackMotorInfo;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GameInputForceFeedbackMotorInfo
{
    public int supportedAxes;
    public int location;
    public uint locationId;
    public uint maxSimultaneousEffects;
    public byte isConstantEffectSupported;
    public byte isRampEffectSupported;
    public byte isSineWaveEffectSupported;
    public byte isSquareWaveEffectSupported;
    public byte isTriangleWaveEffectSupported;
    public byte isSawtoothUpWaveEffectSupported;
    public byte isSawtoothDownWaveEffectSupported;
    public byte isSpringEffectSupported;
    public byte isFrictionEffectSupported;
    public byte isDamperEffectSupported;
    public byte isInertiaEffectSupported;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GameInputForceFeedbackMotorInfo
    Public supportedAxes As Integer
    Public location As Integer
    Public locationId As UInteger
    Public maxSimultaneousEffects As UInteger
    Public isConstantEffectSupported As Byte
    Public isRampEffectSupported As Byte
    Public isSineWaveEffectSupported As Byte
    Public isSquareWaveEffectSupported As Byte
    Public isTriangleWaveEffectSupported As Byte
    Public isSawtoothUpWaveEffectSupported As Byte
    Public isSawtoothDownWaveEffectSupported As Byte
    Public isSpringEffectSupported As Byte
    Public isFrictionEffectSupported As Byte
    Public isDamperEffectSupported As Byte
    Public isInertiaEffectSupported As Byte
End Structure
import ctypes
from ctypes import wintypes

class GameInputForceFeedbackMotorInfo(ctypes.Structure):
    _fields_ = [
        ("supportedAxes", ctypes.c_int),
        ("location", ctypes.c_int),
        ("locationId", wintypes.DWORD),
        ("maxSimultaneousEffects", wintypes.DWORD),
        ("isConstantEffectSupported", ctypes.c_ubyte),
        ("isRampEffectSupported", ctypes.c_ubyte),
        ("isSineWaveEffectSupported", ctypes.c_ubyte),
        ("isSquareWaveEffectSupported", ctypes.c_ubyte),
        ("isTriangleWaveEffectSupported", ctypes.c_ubyte),
        ("isSawtoothUpWaveEffectSupported", ctypes.c_ubyte),
        ("isSawtoothDownWaveEffectSupported", ctypes.c_ubyte),
        ("isSpringEffectSupported", ctypes.c_ubyte),
        ("isFrictionEffectSupported", ctypes.c_ubyte),
        ("isDamperEffectSupported", ctypes.c_ubyte),
        ("isInertiaEffectSupported", ctypes.c_ubyte),
    ]
#[repr(C)]
pub struct GameInputForceFeedbackMotorInfo {
    pub supportedAxes: i32,
    pub location: i32,
    pub locationId: u32,
    pub maxSimultaneousEffects: u32,
    pub isConstantEffectSupported: u8,
    pub isRampEffectSupported: u8,
    pub isSineWaveEffectSupported: u8,
    pub isSquareWaveEffectSupported: u8,
    pub isTriangleWaveEffectSupported: u8,
    pub isSawtoothUpWaveEffectSupported: u8,
    pub isSawtoothDownWaveEffectSupported: u8,
    pub isSpringEffectSupported: u8,
    pub isFrictionEffectSupported: u8,
    pub isDamperEffectSupported: u8,
    pub isInertiaEffectSupported: u8,
}
import "golang.org/x/sys/windows"

type GameInputForceFeedbackMotorInfo struct {
	supportedAxes int32
	location int32
	locationId uint32
	maxSimultaneousEffects uint32
	isConstantEffectSupported byte
	isRampEffectSupported byte
	isSineWaveEffectSupported byte
	isSquareWaveEffectSupported byte
	isTriangleWaveEffectSupported byte
	isSawtoothUpWaveEffectSupported byte
	isSawtoothDownWaveEffectSupported byte
	isSpringEffectSupported byte
	isFrictionEffectSupported byte
	isDamperEffectSupported byte
	isInertiaEffectSupported byte
}
type
  GameInputForceFeedbackMotorInfo = record
    supportedAxes: Integer;
    location: Integer;
    locationId: DWORD;
    maxSimultaneousEffects: DWORD;
    isConstantEffectSupported: Byte;
    isRampEffectSupported: Byte;
    isSineWaveEffectSupported: Byte;
    isSquareWaveEffectSupported: Byte;
    isTriangleWaveEffectSupported: Byte;
    isSawtoothUpWaveEffectSupported: Byte;
    isSawtoothDownWaveEffectSupported: Byte;
    isSpringEffectSupported: Byte;
    isFrictionEffectSupported: Byte;
    isDamperEffectSupported: Byte;
    isInertiaEffectSupported: Byte;
  end;
const GameInputForceFeedbackMotorInfo = extern struct {
    supportedAxes: i32,
    location: i32,
    locationId: u32,
    maxSimultaneousEffects: u32,
    isConstantEffectSupported: u8,
    isRampEffectSupported: u8,
    isSineWaveEffectSupported: u8,
    isSquareWaveEffectSupported: u8,
    isTriangleWaveEffectSupported: u8,
    isSawtoothUpWaveEffectSupported: u8,
    isSawtoothDownWaveEffectSupported: u8,
    isSpringEffectSupported: u8,
    isFrictionEffectSupported: u8,
    isDamperEffectSupported: u8,
    isInertiaEffectSupported: u8,
};
type
  GameInputForceFeedbackMotorInfo {.bycopy.} = object
    supportedAxes: int32
    location: int32
    locationId: uint32
    maxSimultaneousEffects: uint32
    isConstantEffectSupported: uint8
    isRampEffectSupported: uint8
    isSineWaveEffectSupported: uint8
    isSquareWaveEffectSupported: uint8
    isTriangleWaveEffectSupported: uint8
    isSawtoothUpWaveEffectSupported: uint8
    isSawtoothDownWaveEffectSupported: uint8
    isSpringEffectSupported: uint8
    isFrictionEffectSupported: uint8
    isDamperEffectSupported: uint8
    isInertiaEffectSupported: uint8
struct GameInputForceFeedbackMotorInfo
{
    int supportedAxes;
    int location;
    uint locationId;
    uint maxSimultaneousEffects;
    ubyte isConstantEffectSupported;
    ubyte isRampEffectSupported;
    ubyte isSineWaveEffectSupported;
    ubyte isSquareWaveEffectSupported;
    ubyte isTriangleWaveEffectSupported;
    ubyte isSawtoothUpWaveEffectSupported;
    ubyte isSawtoothDownWaveEffectSupported;
    ubyte isSpringEffectSupported;
    ubyte isFrictionEffectSupported;
    ubyte isDamperEffectSupported;
    ubyte isInertiaEffectSupported;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GameInputForceFeedbackMotorInfo サイズ: 28 バイト(x64)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; supportedAxes : GameInputFeedbackAxes (+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 も可)
; maxSimultaneousEffects : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; isConstantEffectSupported : BYTE (+16, 1byte)  poke st,16,値  /  値 = peek(st,16)
; isRampEffectSupported : BYTE (+17, 1byte)  poke st,17,値  /  値 = peek(st,17)
; isSineWaveEffectSupported : BYTE (+18, 1byte)  poke st,18,値  /  値 = peek(st,18)
; isSquareWaveEffectSupported : BYTE (+19, 1byte)  poke st,19,値  /  値 = peek(st,19)
; isTriangleWaveEffectSupported : BYTE (+20, 1byte)  poke st,20,値  /  値 = peek(st,20)
; isSawtoothUpWaveEffectSupported : BYTE (+21, 1byte)  poke st,21,値  /  値 = peek(st,21)
; isSawtoothDownWaveEffectSupported : BYTE (+22, 1byte)  poke st,22,値  /  値 = peek(st,22)
; isSpringEffectSupported : BYTE (+23, 1byte)  poke st,23,値  /  値 = peek(st,23)
; isFrictionEffectSupported : BYTE (+24, 1byte)  poke st,24,値  /  値 = peek(st,24)
; isDamperEffectSupported : BYTE (+25, 1byte)  poke st,25,値  /  値 = peek(st,25)
; isInertiaEffectSupported : BYTE (+26, 1byte)  poke st,26,値  /  値 = peek(st,26)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global GameInputForceFeedbackMotorInfo
    #field int supportedAxes
    #field int location
    #field int locationId
    #field int maxSimultaneousEffects
    #field byte isConstantEffectSupported
    #field byte isRampEffectSupported
    #field byte isSineWaveEffectSupported
    #field byte isSquareWaveEffectSupported
    #field byte isTriangleWaveEffectSupported
    #field byte isSawtoothUpWaveEffectSupported
    #field byte isSawtoothDownWaveEffectSupported
    #field byte isSpringEffectSupported
    #field byte isFrictionEffectSupported
    #field byte isDamperEffectSupported
    #field byte isInertiaEffectSupported
#endstruct

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