WebView2 日本語リファレンス
WebView2構造体 › COREWEBVIEW2_PHYSICAL_KEY_STATUS

COREWEBVIEW2_PHYSICAL_KEY_STATUS

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

フィールド

フィールドサイズx64x86
RepeatCountDWORD4+0+0
ScanCodeDWORD4+4+4
IsExtendedKeyBOOL4+8+8
IsMenuKeyDownBOOL4+12+12
WasKeyDownBOOL4+16+16
IsKeyReleasedBOOL4+20+20

各言語での定義

#include <windows.h>

// COREWEBVIEW2_PHYSICAL_KEY_STATUS  (x64 24 / x86 24 バイト)
typedef struct COREWEBVIEW2_PHYSICAL_KEY_STATUS {
    DWORD RepeatCount;
    DWORD ScanCode;
    BOOL IsExtendedKey;
    BOOL IsMenuKeyDown;
    BOOL WasKeyDown;
    BOOL IsKeyReleased;
} COREWEBVIEW2_PHYSICAL_KEY_STATUS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct COREWEBVIEW2_PHYSICAL_KEY_STATUS
{
    public uint RepeatCount;
    public uint ScanCode;
    [MarshalAs(UnmanagedType.Bool)] public bool IsExtendedKey;
    [MarshalAs(UnmanagedType.Bool)] public bool IsMenuKeyDown;
    [MarshalAs(UnmanagedType.Bool)] public bool WasKeyDown;
    [MarshalAs(UnmanagedType.Bool)] public bool IsKeyReleased;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure COREWEBVIEW2_PHYSICAL_KEY_STATUS
    Public RepeatCount As UInteger
    Public ScanCode As UInteger
    <MarshalAs(UnmanagedType.Bool)> Public IsExtendedKey As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public IsMenuKeyDown As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public WasKeyDown As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public IsKeyReleased As Boolean
End Structure
import ctypes
from ctypes import wintypes

class COREWEBVIEW2_PHYSICAL_KEY_STATUS(ctypes.Structure):
    _fields_ = [
        ("RepeatCount", wintypes.DWORD),
        ("ScanCode", wintypes.DWORD),
        ("IsExtendedKey", wintypes.BOOL),
        ("IsMenuKeyDown", wintypes.BOOL),
        ("WasKeyDown", wintypes.BOOL),
        ("IsKeyReleased", wintypes.BOOL),
    ]
#[repr(C)]
pub struct COREWEBVIEW2_PHYSICAL_KEY_STATUS {
    pub RepeatCount: u32,
    pub ScanCode: u32,
    pub IsExtendedKey: i32,
    pub IsMenuKeyDown: i32,
    pub WasKeyDown: i32,
    pub IsKeyReleased: i32,
}
import "golang.org/x/sys/windows"

type COREWEBVIEW2_PHYSICAL_KEY_STATUS struct {
	RepeatCount uint32
	ScanCode uint32
	IsExtendedKey int32
	IsMenuKeyDown int32
	WasKeyDown int32
	IsKeyReleased int32
}
type
  COREWEBVIEW2_PHYSICAL_KEY_STATUS = record
    RepeatCount: DWORD;
    ScanCode: DWORD;
    IsExtendedKey: BOOL;
    IsMenuKeyDown: BOOL;
    WasKeyDown: BOOL;
    IsKeyReleased: BOOL;
  end;
const COREWEBVIEW2_PHYSICAL_KEY_STATUS = extern struct {
    RepeatCount: u32,
    ScanCode: u32,
    IsExtendedKey: i32,
    IsMenuKeyDown: i32,
    WasKeyDown: i32,
    IsKeyReleased: i32,
};
type
  COREWEBVIEW2_PHYSICAL_KEY_STATUS {.bycopy.} = object
    RepeatCount: uint32
    ScanCode: uint32
    IsExtendedKey: int32
    IsMenuKeyDown: int32
    WasKeyDown: int32
    IsKeyReleased: int32
struct COREWEBVIEW2_PHYSICAL_KEY_STATUS
{
    uint RepeatCount;
    uint ScanCode;
    int IsExtendedKey;
    int IsMenuKeyDown;
    int WasKeyDown;
    int IsKeyReleased;
}

HSP用 定義

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

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

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