ホーム › Devices.HumanInterfaceDevice › INDICATOR_LIST
INDICATOR_LIST
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| MakeCode | WORD | 2 | +0 | +0 | インジケーターに対応するキーのメイクコード。 |
| IndicatorFlags | WORD | 2 | +2 | +2 | 対応するインジケーターLEDを示すフラグ群。 |
各言語での定義
#include <windows.h>
// INDICATOR_LIST (x64 4 / x86 4 バイト)
typedef struct INDICATOR_LIST {
WORD MakeCode;
WORD IndicatorFlags;
} INDICATOR_LIST;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct INDICATOR_LIST
{
public ushort MakeCode;
public ushort IndicatorFlags;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure INDICATOR_LIST
Public MakeCode As UShort
Public IndicatorFlags As UShort
End Structureimport ctypes
from ctypes import wintypes
class INDICATOR_LIST(ctypes.Structure):
_fields_ = [
("MakeCode", ctypes.c_ushort),
("IndicatorFlags", ctypes.c_ushort),
]#[repr(C)]
pub struct INDICATOR_LIST {
pub MakeCode: u16,
pub IndicatorFlags: u16,
}import "golang.org/x/sys/windows"
type INDICATOR_LIST struct {
MakeCode uint16
IndicatorFlags uint16
}type
INDICATOR_LIST = record
MakeCode: Word;
IndicatorFlags: Word;
end;const INDICATOR_LIST = extern struct {
MakeCode: u16,
IndicatorFlags: u16,
};type
INDICATOR_LIST {.bycopy.} = object
MakeCode: uint16
IndicatorFlags: uint16struct INDICATOR_LIST
{
ushort MakeCode;
ushort IndicatorFlags;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; INDICATOR_LIST サイズ: 4 バイト(x64)
dim st, 1 ; 4byte整数×1(構造体サイズ 4 / 4 切り上げ)
; MakeCode : WORD (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; IndicatorFlags : WORD (+2, 2byte) wpoke st,2,値 / 値 = wpeek(st,2)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global INDICATOR_LIST
#field short MakeCode
#field short IndicatorFlags
#endstruct
stdim st, INDICATOR_LIST ; NSTRUCT 変数を確保
st->MakeCode = 100
mes "MakeCode=" + st->MakeCode