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

FILTERKEYS

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

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

フィールド

フィールドサイズx64x86説明
cbSizeDWORD4+0+0この構造体のサイズ(バイト)。
dwFlagsDWORD4+4+4フィルターキー機能の動作を制御するフラグ群。
iWaitMSecDWORD4+8+8キーを受け付けるまでの待機時間(ミリ秒)。
iDelayMSecDWORD4+12+12リピート開始までの遅延時間(ミリ秒)。
iRepeatMSecDWORD4+16+16キーリピートの間隔(ミリ秒)。
iBounceMSecDWORD4+20+20バウンス(二重押下)を無視する時間(ミリ秒)。

各言語での定義

#include <windows.h>

// FILTERKEYS  (x64 24 / x86 24 バイト)
typedef struct FILTERKEYS {
    DWORD cbSize;
    DWORD dwFlags;
    DWORD iWaitMSec;
    DWORD iDelayMSec;
    DWORD iRepeatMSec;
    DWORD iBounceMSec;
} FILTERKEYS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FILTERKEYS
{
    public uint cbSize;
    public uint dwFlags;
    public uint iWaitMSec;
    public uint iDelayMSec;
    public uint iRepeatMSec;
    public uint iBounceMSec;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FILTERKEYS
    Public cbSize As UInteger
    Public dwFlags As UInteger
    Public iWaitMSec As UInteger
    Public iDelayMSec As UInteger
    Public iRepeatMSec As UInteger
    Public iBounceMSec As UInteger
End Structure
import ctypes
from ctypes import wintypes

class FILTERKEYS(ctypes.Structure):
    _fields_ = [
        ("cbSize", wintypes.DWORD),
        ("dwFlags", wintypes.DWORD),
        ("iWaitMSec", wintypes.DWORD),
        ("iDelayMSec", wintypes.DWORD),
        ("iRepeatMSec", wintypes.DWORD),
        ("iBounceMSec", wintypes.DWORD),
    ]
#[repr(C)]
pub struct FILTERKEYS {
    pub cbSize: u32,
    pub dwFlags: u32,
    pub iWaitMSec: u32,
    pub iDelayMSec: u32,
    pub iRepeatMSec: u32,
    pub iBounceMSec: u32,
}
import "golang.org/x/sys/windows"

type FILTERKEYS struct {
	cbSize uint32
	dwFlags uint32
	iWaitMSec uint32
	iDelayMSec uint32
	iRepeatMSec uint32
	iBounceMSec uint32
}
type
  FILTERKEYS = record
    cbSize: DWORD;
    dwFlags: DWORD;
    iWaitMSec: DWORD;
    iDelayMSec: DWORD;
    iRepeatMSec: DWORD;
    iBounceMSec: DWORD;
  end;
const FILTERKEYS = extern struct {
    cbSize: u32,
    dwFlags: u32,
    iWaitMSec: u32,
    iDelayMSec: u32,
    iRepeatMSec: u32,
    iBounceMSec: u32,
};
type
  FILTERKEYS {.bycopy.} = object
    cbSize: uint32
    dwFlags: uint32
    iWaitMSec: uint32
    iDelayMSec: uint32
    iRepeatMSec: uint32
    iBounceMSec: uint32
struct FILTERKEYS
{
    uint cbSize;
    uint dwFlags;
    uint iWaitMSec;
    uint iDelayMSec;
    uint iRepeatMSec;
    uint iBounceMSec;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; FILTERKEYS サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; iWaitMSec : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; iDelayMSec : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; iRepeatMSec : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; iBounceMSec : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global FILTERKEYS
    #field int cbSize
    #field int dwFlags
    #field int iWaitMSec
    #field int iDelayMSec
    #field int iRepeatMSec
    #field int iBounceMSec
#endstruct

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