ホーム › UI.Accessibility › MOUSEKEYS
MOUSEKEYS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | この構造体のサイズ(バイト)。 |
| dwFlags | DWORD | 4 | +4 | +4 | マウスキー機能の動作を制御するフラグ群。 |
| iMaxSpeed | DWORD | 4 | +8 | +8 | ポインタの最大移動速度。 |
| iTimeToMaxSpeed | DWORD | 4 | +12 | +12 | 最大速度に達するまでの時間。 |
| iCtrlSpeed | DWORD | 4 | +16 | +16 | Ctrlキー併用時の速度乗数。 |
| dwReserved1 | DWORD | 4 | +20 | +20 | 予約フィールド。使用しない。 |
| dwReserved2 | DWORD | 4 | +24 | +24 | 予約フィールド。使用しない。 |
各言語での定義
#include <windows.h>
// MOUSEKEYS (x64 28 / x86 28 バイト)
typedef struct MOUSEKEYS {
DWORD cbSize;
DWORD dwFlags;
DWORD iMaxSpeed;
DWORD iTimeToMaxSpeed;
DWORD iCtrlSpeed;
DWORD dwReserved1;
DWORD dwReserved2;
} MOUSEKEYS;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MOUSEKEYS
{
public uint cbSize;
public uint dwFlags;
public uint iMaxSpeed;
public uint iTimeToMaxSpeed;
public uint iCtrlSpeed;
public uint dwReserved1;
public uint dwReserved2;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MOUSEKEYS
Public cbSize As UInteger
Public dwFlags As UInteger
Public iMaxSpeed As UInteger
Public iTimeToMaxSpeed As UInteger
Public iCtrlSpeed As UInteger
Public dwReserved1 As UInteger
Public dwReserved2 As UInteger
End Structureimport ctypes
from ctypes import wintypes
class MOUSEKEYS(ctypes.Structure):
_fields_ = [
("cbSize", wintypes.DWORD),
("dwFlags", wintypes.DWORD),
("iMaxSpeed", wintypes.DWORD),
("iTimeToMaxSpeed", wintypes.DWORD),
("iCtrlSpeed", wintypes.DWORD),
("dwReserved1", wintypes.DWORD),
("dwReserved2", wintypes.DWORD),
]#[repr(C)]
pub struct MOUSEKEYS {
pub cbSize: u32,
pub dwFlags: u32,
pub iMaxSpeed: u32,
pub iTimeToMaxSpeed: u32,
pub iCtrlSpeed: u32,
pub dwReserved1: u32,
pub dwReserved2: u32,
}import "golang.org/x/sys/windows"
type MOUSEKEYS struct {
cbSize uint32
dwFlags uint32
iMaxSpeed uint32
iTimeToMaxSpeed uint32
iCtrlSpeed uint32
dwReserved1 uint32
dwReserved2 uint32
}type
MOUSEKEYS = record
cbSize: DWORD;
dwFlags: DWORD;
iMaxSpeed: DWORD;
iTimeToMaxSpeed: DWORD;
iCtrlSpeed: DWORD;
dwReserved1: DWORD;
dwReserved2: DWORD;
end;const MOUSEKEYS = extern struct {
cbSize: u32,
dwFlags: u32,
iMaxSpeed: u32,
iTimeToMaxSpeed: u32,
iCtrlSpeed: u32,
dwReserved1: u32,
dwReserved2: u32,
};type
MOUSEKEYS {.bycopy.} = object
cbSize: uint32
dwFlags: uint32
iMaxSpeed: uint32
iTimeToMaxSpeed: uint32
iCtrlSpeed: uint32
dwReserved1: uint32
dwReserved2: uint32struct MOUSEKEYS
{
uint cbSize;
uint dwFlags;
uint iMaxSpeed;
uint iTimeToMaxSpeed;
uint iCtrlSpeed;
uint dwReserved1;
uint dwReserved2;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MOUSEKEYS サイズ: 28 バイト(x64)
dim st, 7 ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; iMaxSpeed : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; iTimeToMaxSpeed : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; iCtrlSpeed : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; dwReserved1 : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; dwReserved2 : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MOUSEKEYS
#field int cbSize
#field int dwFlags
#field int iMaxSpeed
#field int iTimeToMaxSpeed
#field int iCtrlSpeed
#field int dwReserved1
#field int dwReserved2
#endstruct
stdim st, MOUSEKEYS ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize