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

MOUSEKEYS

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

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

フィールド

フィールドサイズx64x86説明
cbSizeDWORD4+0+0この構造体のサイズ(バイト)。
dwFlagsDWORD4+4+4マウスキー機能の動作を制御するフラグ群。
iMaxSpeedDWORD4+8+8ポインタの最大移動速度。
iTimeToMaxSpeedDWORD4+12+12最大速度に達するまでの時間。
iCtrlSpeedDWORD4+16+16Ctrlキー併用時の速度乗数。
dwReserved1DWORD4+20+20予約フィールド。使用しない。
dwReserved2DWORD4+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 Structure
import 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: uint32
struct 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