Win32 API 日本語リファレンス
ホームUI.InteractionContext › INTERACTION_CONTEXT_OUTPUT2

INTERACTION_CONTEXT_OUTPUT2

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

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

フィールド

フィールドサイズx64x86説明
interactionIdINTERACTION_ID4+0+0発生したインタラクションの種別ID。
interactionFlagsINTERACTION_FLAGS4+4+4インタラクションの状態フラグ。開始・実行中・終了・慣性等を示す。
inputTypePOINTER_INPUT_TYPE4+8+8操作元のポインタ入力種別(タッチ・ペン等)。
contactCountDWORD4+12+12このインタラクションに関与した接触点の総数。
currentContactCountDWORD4+16+16現在アクティブな接触点の数。
xFLOAT4+20+20インタラクションの基準X座標(ピクセル)。
yFLOAT4+24+24インタラクションの基準Y座標(ピクセル)。
arguments_arguments_e__Union60+28+28interactionIdに応じた引数を格納する共用体(タップ・操作等)。

共用体: _arguments_e__Union x64 60B / x86 60B

フィールドサイズx64x86
manipulationINTERACTION_ARGUMENTS_MANIPULATION60+0+0
tapINTERACTION_ARGUMENTS_TAP4+0+0
crossSlideINTERACTION_ARGUMENTS_CROSS_SLIDE4+0+0

各言語での定義

#include <windows.h>

// INTERACTION_CONTEXT_OUTPUT2  (x64 88 / x86 88 バイト)
typedef struct INTERACTION_CONTEXT_OUTPUT2 {
    INTERACTION_ID interactionId;
    INTERACTION_FLAGS interactionFlags;
    POINTER_INPUT_TYPE inputType;
    DWORD contactCount;
    DWORD currentContactCount;
    FLOAT x;
    FLOAT y;
    _arguments_e__Union arguments;
} INTERACTION_CONTEXT_OUTPUT2;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct INTERACTION_CONTEXT_OUTPUT2
{
    public int interactionId;
    public uint interactionFlags;
    public int inputType;
    public uint contactCount;
    public uint currentContactCount;
    public float x;
    public float y;
    public _arguments_e__Union arguments;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure INTERACTION_CONTEXT_OUTPUT2
    Public interactionId As Integer
    Public interactionFlags As UInteger
    Public inputType As Integer
    Public contactCount As UInteger
    Public currentContactCount As UInteger
    Public x As Single
    Public y As Single
    Public arguments As _arguments_e__Union
End Structure
import ctypes
from ctypes import wintypes

class INTERACTION_CONTEXT_OUTPUT2(ctypes.Structure):
    _fields_ = [
        ("interactionId", ctypes.c_int),
        ("interactionFlags", wintypes.DWORD),
        ("inputType", ctypes.c_int),
        ("contactCount", wintypes.DWORD),
        ("currentContactCount", wintypes.DWORD),
        ("x", ctypes.c_float),
        ("y", ctypes.c_float),
        ("arguments", _arguments_e__Union),
    ]
#[repr(C)]
pub struct INTERACTION_CONTEXT_OUTPUT2 {
    pub interactionId: i32,
    pub interactionFlags: u32,
    pub inputType: i32,
    pub contactCount: u32,
    pub currentContactCount: u32,
    pub x: f32,
    pub y: f32,
    pub arguments: _arguments_e__Union,
}
import "golang.org/x/sys/windows"

type INTERACTION_CONTEXT_OUTPUT2 struct {
	interactionId int32
	interactionFlags uint32
	inputType int32
	contactCount uint32
	currentContactCount uint32
	x float32
	y float32
	arguments _arguments_e__Union
}
type
  INTERACTION_CONTEXT_OUTPUT2 = record
    interactionId: Integer;
    interactionFlags: DWORD;
    inputType: Integer;
    contactCount: DWORD;
    currentContactCount: DWORD;
    x: Single;
    y: Single;
    arguments: _arguments_e__Union;
  end;
const INTERACTION_CONTEXT_OUTPUT2 = extern struct {
    interactionId: i32,
    interactionFlags: u32,
    inputType: i32,
    contactCount: u32,
    currentContactCount: u32,
    x: f32,
    y: f32,
    arguments: _arguments_e__Union,
};
type
  INTERACTION_CONTEXT_OUTPUT2 {.bycopy.} = object
    interactionId: int32
    interactionFlags: uint32
    inputType: int32
    contactCount: uint32
    currentContactCount: uint32
    x: float32
    y: float32
    arguments: _arguments_e__Union
struct INTERACTION_CONTEXT_OUTPUT2
{
    int interactionId;
    uint interactionFlags;
    int inputType;
    uint contactCount;
    uint currentContactCount;
    float x;
    float y;
    _arguments_e__Union arguments;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; INTERACTION_CONTEXT_OUTPUT2 サイズ: 88 バイト(x64)
dim st, 22    ; 4byte整数×22(構造体サイズ 88 / 4 切り上げ)
; interactionId : INTERACTION_ID (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; interactionFlags : INTERACTION_FLAGS (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; inputType : POINTER_INPUT_TYPE (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; contactCount : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; currentContactCount : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; x : FLOAT (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; y : FLOAT (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; arguments : _arguments_e__Union (+28, 60byte)  varptr(st)+28 を基点に操作(60byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global INTERACTION_CONTEXT_OUTPUT2
    #field int interactionId
    #field int interactionFlags
    #field int inputType
    #field int contactCount
    #field int currentContactCount
    #field float x
    #field float y
    #field byte arguments 60
#endstruct

stdim st, INTERACTION_CONTEXT_OUTPUT2        ; NSTRUCT 変数を確保
st->interactionId = 100
mes "interactionId=" + st->interactionId
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。