Win32 API 日本語リファレンス
ホームUI.Input.GameInput › GameInputFlightStickInfo

GameInputFlightStickInfo

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

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

フィールド

フィールドサイズx64x86説明
menuButtonLabelGameInputLabel4+0+0メニューボタンの物理ラベルである。
viewButtonLabelGameInputLabel4+4+4ビューボタンの物理ラベルである。
firePrimaryButtonLabelGameInputLabel4+8+8主発射ボタンの物理ラベルである。
fireSecondaryButtonLabelGameInputLabel4+12+12副発射ボタンの物理ラベルである。
hatSwitchKindGameInputSwitchKind4+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 Structure
import 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: int32
struct 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