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

GameInputTouchSensorInfo

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

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

フィールド

フィールドサイズx64x86説明
mappedInputKindsGameInputKind4+0+0このセンサーが対応づく入力種別を示すフラグである。
labelGameInputLabel4+4+4センサーに付与された物理ラベルを示す値である。
locationGameInputLocation4+8+8センサーの配置位置を示す値である。
locationIdDWORD4+12+12同一位置内でのセンサー識別IDである。
resolutionXULONGLONG8+16+16X方向の分解能である。
resolutionYULONGLONG8+24+24Y方向の分解能である。
shapeGameInputTouchShape4+32+32タッチ面の形状を示す値である。
aspectRatioFLOAT4+36+36タッチ面の縦横比である。
orientationFLOAT4+40+40センサーの向き(角度)である。
physicalWidthFLOAT4+44+44タッチ面の物理的な幅である。
physicalHeightFLOAT4+48+48タッチ面の物理的な高さである。
maxPressureFLOAT4+52+52検出可能な最大圧力値である。
maxProximityFLOAT4+56+56検出可能な最大近接度である。
maxTouchPointsDWORD4+60+60同時検出可能な最大接触点数である。

各言語での定義

#include <windows.h>

// GameInputTouchSensorInfo  (x64 64 / x86 64 バイト)
typedef struct GameInputTouchSensorInfo {
    GameInputKind mappedInputKinds;
    GameInputLabel label;
    GameInputLocation location;
    DWORD locationId;
    ULONGLONG resolutionX;
    ULONGLONG resolutionY;
    GameInputTouchShape shape;
    FLOAT aspectRatio;
    FLOAT orientation;
    FLOAT physicalWidth;
    FLOAT physicalHeight;
    FLOAT maxPressure;
    FLOAT maxProximity;
    DWORD maxTouchPoints;
} GameInputTouchSensorInfo;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GameInputTouchSensorInfo
{
    public int mappedInputKinds;
    public int label;
    public int location;
    public uint locationId;
    public ulong resolutionX;
    public ulong resolutionY;
    public int shape;
    public float aspectRatio;
    public float orientation;
    public float physicalWidth;
    public float physicalHeight;
    public float maxPressure;
    public float maxProximity;
    public uint maxTouchPoints;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GameInputTouchSensorInfo
    Public mappedInputKinds As Integer
    Public label As Integer
    Public location As Integer
    Public locationId As UInteger
    Public resolutionX As ULong
    Public resolutionY As ULong
    Public shape As Integer
    Public aspectRatio As Single
    Public orientation As Single
    Public physicalWidth As Single
    Public physicalHeight As Single
    Public maxPressure As Single
    Public maxProximity As Single
    Public maxTouchPoints As UInteger
End Structure
import ctypes
from ctypes import wintypes

class GameInputTouchSensorInfo(ctypes.Structure):
    _fields_ = [
        ("mappedInputKinds", ctypes.c_int),
        ("label", ctypes.c_int),
        ("location", ctypes.c_int),
        ("locationId", wintypes.DWORD),
        ("resolutionX", ctypes.c_ulonglong),
        ("resolutionY", ctypes.c_ulonglong),
        ("shape", ctypes.c_int),
        ("aspectRatio", ctypes.c_float),
        ("orientation", ctypes.c_float),
        ("physicalWidth", ctypes.c_float),
        ("physicalHeight", ctypes.c_float),
        ("maxPressure", ctypes.c_float),
        ("maxProximity", ctypes.c_float),
        ("maxTouchPoints", wintypes.DWORD),
    ]
#[repr(C)]
pub struct GameInputTouchSensorInfo {
    pub mappedInputKinds: i32,
    pub label: i32,
    pub location: i32,
    pub locationId: u32,
    pub resolutionX: u64,
    pub resolutionY: u64,
    pub shape: i32,
    pub aspectRatio: f32,
    pub orientation: f32,
    pub physicalWidth: f32,
    pub physicalHeight: f32,
    pub maxPressure: f32,
    pub maxProximity: f32,
    pub maxTouchPoints: u32,
}
import "golang.org/x/sys/windows"

type GameInputTouchSensorInfo struct {
	mappedInputKinds int32
	label int32
	location int32
	locationId uint32
	resolutionX uint64
	resolutionY uint64
	shape int32
	aspectRatio float32
	orientation float32
	physicalWidth float32
	physicalHeight float32
	maxPressure float32
	maxProximity float32
	maxTouchPoints uint32
}
type
  GameInputTouchSensorInfo = record
    mappedInputKinds: Integer;
    label: Integer;
    location: Integer;
    locationId: DWORD;
    resolutionX: UInt64;
    resolutionY: UInt64;
    shape: Integer;
    aspectRatio: Single;
    orientation: Single;
    physicalWidth: Single;
    physicalHeight: Single;
    maxPressure: Single;
    maxProximity: Single;
    maxTouchPoints: DWORD;
  end;
const GameInputTouchSensorInfo = extern struct {
    mappedInputKinds: i32,
    label: i32,
    location: i32,
    locationId: u32,
    resolutionX: u64,
    resolutionY: u64,
    shape: i32,
    aspectRatio: f32,
    orientation: f32,
    physicalWidth: f32,
    physicalHeight: f32,
    maxPressure: f32,
    maxProximity: f32,
    maxTouchPoints: u32,
};
type
  GameInputTouchSensorInfo {.bycopy.} = object
    mappedInputKinds: int32
    label: int32
    location: int32
    locationId: uint32
    resolutionX: uint64
    resolutionY: uint64
    shape: int32
    aspectRatio: float32
    orientation: float32
    physicalWidth: float32
    physicalHeight: float32
    maxPressure: float32
    maxProximity: float32
    maxTouchPoints: uint32
struct GameInputTouchSensorInfo
{
    int mappedInputKinds;
    int label;
    int location;
    uint locationId;
    ulong resolutionX;
    ulong resolutionY;
    int shape;
    float aspectRatio;
    float orientation;
    float physicalWidth;
    float physicalHeight;
    float maxPressure;
    float maxProximity;
    uint maxTouchPoints;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GameInputTouchSensorInfo サイズ: 64 バイト(x64)
dim st, 16    ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; mappedInputKinds : GameInputKind (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; label : GameInputLabel (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; location : GameInputLocation (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; locationId : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; resolutionX : ULONGLONG (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; resolutionY : ULONGLONG (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; shape : GameInputTouchShape (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; aspectRatio : FLOAT (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; orientation : FLOAT (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; physicalWidth : FLOAT (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; physicalHeight : FLOAT (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; maxPressure : FLOAT (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; maxProximity : FLOAT (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; maxTouchPoints : DWORD (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global GameInputTouchSensorInfo
    #field int mappedInputKinds
    #field int label
    #field int location
    #field int locationId
    #field int64 resolutionX
    #field int64 resolutionY
    #field int shape
    #field float aspectRatio
    #field float orientation
    #field float physicalWidth
    #field float physicalHeight
    #field float maxPressure
    #field float maxProximity
    #field int maxTouchPoints
#endstruct

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