ホーム › UI.Input.GameInput › GameInputFlightStickInfo
GameInputFlightStickInfo
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| menuButtonLabel | GameInputLabel | 4 | +0 | +0 | メニューボタンの物理ラベルである。 |
| viewButtonLabel | GameInputLabel | 4 | +4 | +4 | ビューボタンの物理ラベルである。 |
| firePrimaryButtonLabel | GameInputLabel | 4 | +8 | +8 | 主発射ボタンの物理ラベルである。 |
| fireSecondaryButtonLabel | GameInputLabel | 4 | +12 | +12 | 副発射ボタンの物理ラベルである。 |
| hatSwitchKind | GameInputSwitchKind | 4 | +16 | +16 | ハットスイッチの種別を示す値である。 |
各言語での定義
#include <windows.h>
// GameInputFlightStickInfo (x64 20 / x86 20 バイト)
typedef struct GameInputFlightStickInfo {
GameInputLabel menuButtonLabel;
GameInputLabel viewButtonLabel;
GameInputLabel firePrimaryButtonLabel;
GameInputLabel fireSecondaryButtonLabel;
GameInputSwitchKind hatSwitchKind;
} GameInputFlightStickInfo;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GameInputFlightStickInfo
{
public int menuButtonLabel;
public int viewButtonLabel;
public int firePrimaryButtonLabel;
public int fireSecondaryButtonLabel;
public int hatSwitchKind;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GameInputFlightStickInfo
Public menuButtonLabel As Integer
Public viewButtonLabel As Integer
Public firePrimaryButtonLabel As Integer
Public fireSecondaryButtonLabel As Integer
Public hatSwitchKind As Integer
End Structureimport ctypes
from ctypes import wintypes
class GameInputFlightStickInfo(ctypes.Structure):
_fields_ = [
("menuButtonLabel", ctypes.c_int),
("viewButtonLabel", ctypes.c_int),
("firePrimaryButtonLabel", ctypes.c_int),
("fireSecondaryButtonLabel", ctypes.c_int),
("hatSwitchKind", ctypes.c_int),
]#[repr(C)]
pub struct GameInputFlightStickInfo {
pub menuButtonLabel: i32,
pub viewButtonLabel: i32,
pub firePrimaryButtonLabel: i32,
pub fireSecondaryButtonLabel: i32,
pub hatSwitchKind: i32,
}import "golang.org/x/sys/windows"
type GameInputFlightStickInfo struct {
menuButtonLabel int32
viewButtonLabel int32
firePrimaryButtonLabel int32
fireSecondaryButtonLabel int32
hatSwitchKind int32
}type
GameInputFlightStickInfo = record
menuButtonLabel: Integer;
viewButtonLabel: Integer;
firePrimaryButtonLabel: Integer;
fireSecondaryButtonLabel: Integer;
hatSwitchKind: Integer;
end;const GameInputFlightStickInfo = extern struct {
menuButtonLabel: i32,
viewButtonLabel: i32,
firePrimaryButtonLabel: i32,
fireSecondaryButtonLabel: i32,
hatSwitchKind: i32,
};type
GameInputFlightStickInfo {.bycopy.} = object
menuButtonLabel: int32
viewButtonLabel: int32
firePrimaryButtonLabel: int32
fireSecondaryButtonLabel: int32
hatSwitchKind: int32struct GameInputFlightStickInfo
{
int menuButtonLabel;
int viewButtonLabel;
int firePrimaryButtonLabel;
int fireSecondaryButtonLabel;
int hatSwitchKind;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GameInputFlightStickInfo サイズ: 20 バイト(x64)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; menuButtonLabel : GameInputLabel (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; viewButtonLabel : GameInputLabel (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; firePrimaryButtonLabel : GameInputLabel (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; fireSecondaryButtonLabel : GameInputLabel (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; hatSwitchKind : GameInputSwitchKind (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global GameInputFlightStickInfo
#field int menuButtonLabel
#field int viewButtonLabel
#field int firePrimaryButtonLabel
#field int fireSecondaryButtonLabel
#field int hatSwitchKind
#endstruct
stdim st, GameInputFlightStickInfo ; NSTRUCT 変数を確保
st->menuButtonLabel = 100
mes "menuButtonLabel=" + st->menuButtonLabel