ホーム › UI.Input.Pointer › POINTER_DEVICE_PROPERTY
POINTER_DEVICE_PROPERTY
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| logicalMin | INT | 4 | +0 | +0 | プロパティの論理値の最小値。 |
| logicalMax | INT | 4 | +4 | +4 | プロパティの論理値の最大値。 |
| physicalMin | INT | 4 | +8 | +8 | プロパティの物理値の最小値。 |
| physicalMax | INT | 4 | +12 | +12 | プロパティの物理値の最大値。 |
| unit | DWORD | 4 | +16 | +16 | 値の単位を示すHID単位コード。 |
| unitExponent | DWORD | 4 | +20 | +20 | 単位に適用する10のべき乗指数。 |
| usagePageId | WORD | 2 | +24 | +24 | プロパティのHID使用ページID。 |
| usageId | WORD | 2 | +26 | +26 | プロパティのHID使用法ID。 |
各言語での定義
#include <windows.h>
// POINTER_DEVICE_PROPERTY (x64 28 / x86 28 バイト)
typedef struct POINTER_DEVICE_PROPERTY {
INT logicalMin;
INT logicalMax;
INT physicalMin;
INT physicalMax;
DWORD unit;
DWORD unitExponent;
WORD usagePageId;
WORD usageId;
} POINTER_DEVICE_PROPERTY;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct POINTER_DEVICE_PROPERTY
{
public int logicalMin;
public int logicalMax;
public int physicalMin;
public int physicalMax;
public uint unit;
public uint unitExponent;
public ushort usagePageId;
public ushort usageId;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure POINTER_DEVICE_PROPERTY
Public logicalMin As Integer
Public logicalMax As Integer
Public physicalMin As Integer
Public physicalMax As Integer
Public unit As UInteger
Public unitExponent As UInteger
Public usagePageId As UShort
Public usageId As UShort
End Structureimport ctypes
from ctypes import wintypes
class POINTER_DEVICE_PROPERTY(ctypes.Structure):
_fields_ = [
("logicalMin", ctypes.c_int),
("logicalMax", ctypes.c_int),
("physicalMin", ctypes.c_int),
("physicalMax", ctypes.c_int),
("unit", wintypes.DWORD),
("unitExponent", wintypes.DWORD),
("usagePageId", ctypes.c_ushort),
("usageId", ctypes.c_ushort),
]#[repr(C)]
pub struct POINTER_DEVICE_PROPERTY {
pub logicalMin: i32,
pub logicalMax: i32,
pub physicalMin: i32,
pub physicalMax: i32,
pub unit: u32,
pub unitExponent: u32,
pub usagePageId: u16,
pub usageId: u16,
}import "golang.org/x/sys/windows"
type POINTER_DEVICE_PROPERTY struct {
logicalMin int32
logicalMax int32
physicalMin int32
physicalMax int32
unit uint32
unitExponent uint32
usagePageId uint16
usageId uint16
}type
POINTER_DEVICE_PROPERTY = record
logicalMin: Integer;
logicalMax: Integer;
physicalMin: Integer;
physicalMax: Integer;
unit: DWORD;
unitExponent: DWORD;
usagePageId: Word;
usageId: Word;
end;const POINTER_DEVICE_PROPERTY = extern struct {
logicalMin: i32,
logicalMax: i32,
physicalMin: i32,
physicalMax: i32,
unit: u32,
unitExponent: u32,
usagePageId: u16,
usageId: u16,
};type
POINTER_DEVICE_PROPERTY {.bycopy.} = object
logicalMin: int32
logicalMax: int32
physicalMin: int32
physicalMax: int32
unit: uint32
unitExponent: uint32
usagePageId: uint16
usageId: uint16struct POINTER_DEVICE_PROPERTY
{
int logicalMin;
int logicalMax;
int physicalMin;
int physicalMax;
uint unit;
uint unitExponent;
ushort usagePageId;
ushort usageId;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; POINTER_DEVICE_PROPERTY サイズ: 28 バイト(x64)
dim st, 7 ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; logicalMin : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; logicalMax : INT (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; physicalMin : INT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; physicalMax : INT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; unit : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; unitExponent : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; usagePageId : WORD (+24, 2byte) wpoke st,24,値 / 値 = wpeek(st,24)
; usageId : WORD (+26, 2byte) wpoke st,26,値 / 値 = wpeek(st,26)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global POINTER_DEVICE_PROPERTY
#field int logicalMin
#field int logicalMax
#field int physicalMin
#field int physicalMax
#field int unit
#field int unitExponent
#field short usagePageId
#field short usageId
#endstruct
stdim st, POINTER_DEVICE_PROPERTY ; NSTRUCT 変数を確保
st->logicalMin = 100
mes "logicalMin=" + st->logicalMin