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

GameInputArcadeStickInfo

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

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

フィールド

フィールドサイズx64x86説明
menuButtonLabelGameInputLabel4+0+0メニューボタンの物理ラベルである。
viewButtonLabelGameInputLabel4+4+4ビューボタンの物理ラベルである。
stickUpLabelGameInputLabel4+8+8スティック上方向の物理ラベルである。
stickDownLabelGameInputLabel4+12+12スティック下方向の物理ラベルである。
stickLeftLabelGameInputLabel4+16+16スティック左方向の物理ラベルである。
stickRightLabelGameInputLabel4+20+20スティック右方向の物理ラベルである。
actionButton1LabelGameInputLabel4+24+24アクションボタン1の物理ラベルである。
actionButton2LabelGameInputLabel4+28+28アクションボタン2の物理ラベルである。
actionButton3LabelGameInputLabel4+32+32アクションボタン3の物理ラベルである。
actionButton4LabelGameInputLabel4+36+36アクションボタン4の物理ラベルである。
actionButton5LabelGameInputLabel4+40+40アクションボタン5の物理ラベルである。
actionButton6LabelGameInputLabel4+44+44アクションボタン6の物理ラベルである。
specialButton1LabelGameInputLabel4+48+48特殊ボタン1の物理ラベルである。
specialButton2LabelGameInputLabel4+52+52特殊ボタン2の物理ラベルである。

各言語での定義

#include <windows.h>

// GameInputArcadeStickInfo  (x64 56 / x86 56 バイト)
typedef struct GameInputArcadeStickInfo {
    GameInputLabel menuButtonLabel;
    GameInputLabel viewButtonLabel;
    GameInputLabel stickUpLabel;
    GameInputLabel stickDownLabel;
    GameInputLabel stickLeftLabel;
    GameInputLabel stickRightLabel;
    GameInputLabel actionButton1Label;
    GameInputLabel actionButton2Label;
    GameInputLabel actionButton3Label;
    GameInputLabel actionButton4Label;
    GameInputLabel actionButton5Label;
    GameInputLabel actionButton6Label;
    GameInputLabel specialButton1Label;
    GameInputLabel specialButton2Label;
} GameInputArcadeStickInfo;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GameInputArcadeStickInfo
{
    public int menuButtonLabel;
    public int viewButtonLabel;
    public int stickUpLabel;
    public int stickDownLabel;
    public int stickLeftLabel;
    public int stickRightLabel;
    public int actionButton1Label;
    public int actionButton2Label;
    public int actionButton3Label;
    public int actionButton4Label;
    public int actionButton5Label;
    public int actionButton6Label;
    public int specialButton1Label;
    public int specialButton2Label;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GameInputArcadeStickInfo
    Public menuButtonLabel As Integer
    Public viewButtonLabel As Integer
    Public stickUpLabel As Integer
    Public stickDownLabel As Integer
    Public stickLeftLabel As Integer
    Public stickRightLabel As Integer
    Public actionButton1Label As Integer
    Public actionButton2Label As Integer
    Public actionButton3Label As Integer
    Public actionButton4Label As Integer
    Public actionButton5Label As Integer
    Public actionButton6Label As Integer
    Public specialButton1Label As Integer
    Public specialButton2Label As Integer
End Structure
import ctypes
from ctypes import wintypes

class GameInputArcadeStickInfo(ctypes.Structure):
    _fields_ = [
        ("menuButtonLabel", ctypes.c_int),
        ("viewButtonLabel", ctypes.c_int),
        ("stickUpLabel", ctypes.c_int),
        ("stickDownLabel", ctypes.c_int),
        ("stickLeftLabel", ctypes.c_int),
        ("stickRightLabel", ctypes.c_int),
        ("actionButton1Label", ctypes.c_int),
        ("actionButton2Label", ctypes.c_int),
        ("actionButton3Label", ctypes.c_int),
        ("actionButton4Label", ctypes.c_int),
        ("actionButton5Label", ctypes.c_int),
        ("actionButton6Label", ctypes.c_int),
        ("specialButton1Label", ctypes.c_int),
        ("specialButton2Label", ctypes.c_int),
    ]
#[repr(C)]
pub struct GameInputArcadeStickInfo {
    pub menuButtonLabel: i32,
    pub viewButtonLabel: i32,
    pub stickUpLabel: i32,
    pub stickDownLabel: i32,
    pub stickLeftLabel: i32,
    pub stickRightLabel: i32,
    pub actionButton1Label: i32,
    pub actionButton2Label: i32,
    pub actionButton3Label: i32,
    pub actionButton4Label: i32,
    pub actionButton5Label: i32,
    pub actionButton6Label: i32,
    pub specialButton1Label: i32,
    pub specialButton2Label: i32,
}
import "golang.org/x/sys/windows"

type GameInputArcadeStickInfo struct {
	menuButtonLabel int32
	viewButtonLabel int32
	stickUpLabel int32
	stickDownLabel int32
	stickLeftLabel int32
	stickRightLabel int32
	actionButton1Label int32
	actionButton2Label int32
	actionButton3Label int32
	actionButton4Label int32
	actionButton5Label int32
	actionButton6Label int32
	specialButton1Label int32
	specialButton2Label int32
}
type
  GameInputArcadeStickInfo = record
    menuButtonLabel: Integer;
    viewButtonLabel: Integer;
    stickUpLabel: Integer;
    stickDownLabel: Integer;
    stickLeftLabel: Integer;
    stickRightLabel: Integer;
    actionButton1Label: Integer;
    actionButton2Label: Integer;
    actionButton3Label: Integer;
    actionButton4Label: Integer;
    actionButton5Label: Integer;
    actionButton6Label: Integer;
    specialButton1Label: Integer;
    specialButton2Label: Integer;
  end;
const GameInputArcadeStickInfo = extern struct {
    menuButtonLabel: i32,
    viewButtonLabel: i32,
    stickUpLabel: i32,
    stickDownLabel: i32,
    stickLeftLabel: i32,
    stickRightLabel: i32,
    actionButton1Label: i32,
    actionButton2Label: i32,
    actionButton3Label: i32,
    actionButton4Label: i32,
    actionButton5Label: i32,
    actionButton6Label: i32,
    specialButton1Label: i32,
    specialButton2Label: i32,
};
type
  GameInputArcadeStickInfo {.bycopy.} = object
    menuButtonLabel: int32
    viewButtonLabel: int32
    stickUpLabel: int32
    stickDownLabel: int32
    stickLeftLabel: int32
    stickRightLabel: int32
    actionButton1Label: int32
    actionButton2Label: int32
    actionButton3Label: int32
    actionButton4Label: int32
    actionButton5Label: int32
    actionButton6Label: int32
    specialButton1Label: int32
    specialButton2Label: int32
struct GameInputArcadeStickInfo
{
    int menuButtonLabel;
    int viewButtonLabel;
    int stickUpLabel;
    int stickDownLabel;
    int stickLeftLabel;
    int stickRightLabel;
    int actionButton1Label;
    int actionButton2Label;
    int actionButton3Label;
    int actionButton4Label;
    int actionButton5Label;
    int actionButton6Label;
    int specialButton1Label;
    int specialButton2Label;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GameInputArcadeStickInfo サイズ: 56 バイト(x64)
dim st, 14    ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; menuButtonLabel : GameInputLabel (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; viewButtonLabel : GameInputLabel (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; stickUpLabel : GameInputLabel (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; stickDownLabel : GameInputLabel (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; stickLeftLabel : GameInputLabel (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; stickRightLabel : GameInputLabel (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; actionButton1Label : GameInputLabel (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; actionButton2Label : GameInputLabel (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; actionButton3Label : GameInputLabel (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; actionButton4Label : GameInputLabel (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; actionButton5Label : GameInputLabel (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; actionButton6Label : GameInputLabel (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; specialButton1Label : GameInputLabel (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; specialButton2Label : GameInputLabel (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global GameInputArcadeStickInfo
    #field int menuButtonLabel
    #field int viewButtonLabel
    #field int stickUpLabel
    #field int stickDownLabel
    #field int stickLeftLabel
    #field int stickRightLabel
    #field int actionButton1Label
    #field int actionButton2Label
    #field int actionButton3Label
    #field int actionButton4Label
    #field int actionButton5Label
    #field int actionButton6Label
    #field int specialButton1Label
    #field int specialButton2Label
#endstruct

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