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

GameInputGamepadInfo

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

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

フィールド

フィールドサイズx64x86説明
menuButtonLabelGameInputLabel4+0+0メニューボタンの物理ラベルである。
viewButtonLabelGameInputLabel4+4+4ビューボタンの物理ラベルである。
aButtonLabelGameInputLabel4+8+8Aボタンの物理ラベルである。
bButtonLabelGameInputLabel4+12+12Bボタンの物理ラベルである。
xButtonLabelGameInputLabel4+16+16Xボタンの物理ラベルである。
yButtonLabelGameInputLabel4+20+20Yボタンの物理ラベルである。
dpadUpLabelGameInputLabel4+24+24方向パッド上の物理ラベルである。
dpadDownLabelGameInputLabel4+28+28方向パッド下の物理ラベルである。
dpadLeftLabelGameInputLabel4+32+32方向パッド左の物理ラベルである。
dpadRightLabelGameInputLabel4+36+36方向パッド右の物理ラベルである。
leftShoulderButtonLabelGameInputLabel4+40+40左ショルダーボタンの物理ラベルである。
rightShoulderButtonLabelGameInputLabel4+44+44右ショルダーボタンの物理ラベルである。
leftThumbstickButtonLabelGameInputLabel4+48+48左スティック押し込みボタンの物理ラベルである。
rightThumbstickButtonLabelGameInputLabel4+52+52右スティック押し込みボタンの物理ラベルである。

各言語での定義

#include <windows.h>

// GameInputGamepadInfo  (x64 56 / x86 56 バイト)
typedef struct GameInputGamepadInfo {
    GameInputLabel menuButtonLabel;
    GameInputLabel viewButtonLabel;
    GameInputLabel aButtonLabel;
    GameInputLabel bButtonLabel;
    GameInputLabel xButtonLabel;
    GameInputLabel yButtonLabel;
    GameInputLabel dpadUpLabel;
    GameInputLabel dpadDownLabel;
    GameInputLabel dpadLeftLabel;
    GameInputLabel dpadRightLabel;
    GameInputLabel leftShoulderButtonLabel;
    GameInputLabel rightShoulderButtonLabel;
    GameInputLabel leftThumbstickButtonLabel;
    GameInputLabel rightThumbstickButtonLabel;
} GameInputGamepadInfo;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GameInputGamepadInfo
{
    public int menuButtonLabel;
    public int viewButtonLabel;
    public int aButtonLabel;
    public int bButtonLabel;
    public int xButtonLabel;
    public int yButtonLabel;
    public int dpadUpLabel;
    public int dpadDownLabel;
    public int dpadLeftLabel;
    public int dpadRightLabel;
    public int leftShoulderButtonLabel;
    public int rightShoulderButtonLabel;
    public int leftThumbstickButtonLabel;
    public int rightThumbstickButtonLabel;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GameInputGamepadInfo
    Public menuButtonLabel As Integer
    Public viewButtonLabel As Integer
    Public aButtonLabel As Integer
    Public bButtonLabel As Integer
    Public xButtonLabel As Integer
    Public yButtonLabel As Integer
    Public dpadUpLabel As Integer
    Public dpadDownLabel As Integer
    Public dpadLeftLabel As Integer
    Public dpadRightLabel As Integer
    Public leftShoulderButtonLabel As Integer
    Public rightShoulderButtonLabel As Integer
    Public leftThumbstickButtonLabel As Integer
    Public rightThumbstickButtonLabel As Integer
End Structure
import ctypes
from ctypes import wintypes

class GameInputGamepadInfo(ctypes.Structure):
    _fields_ = [
        ("menuButtonLabel", ctypes.c_int),
        ("viewButtonLabel", ctypes.c_int),
        ("aButtonLabel", ctypes.c_int),
        ("bButtonLabel", ctypes.c_int),
        ("xButtonLabel", ctypes.c_int),
        ("yButtonLabel", ctypes.c_int),
        ("dpadUpLabel", ctypes.c_int),
        ("dpadDownLabel", ctypes.c_int),
        ("dpadLeftLabel", ctypes.c_int),
        ("dpadRightLabel", ctypes.c_int),
        ("leftShoulderButtonLabel", ctypes.c_int),
        ("rightShoulderButtonLabel", ctypes.c_int),
        ("leftThumbstickButtonLabel", ctypes.c_int),
        ("rightThumbstickButtonLabel", ctypes.c_int),
    ]
#[repr(C)]
pub struct GameInputGamepadInfo {
    pub menuButtonLabel: i32,
    pub viewButtonLabel: i32,
    pub aButtonLabel: i32,
    pub bButtonLabel: i32,
    pub xButtonLabel: i32,
    pub yButtonLabel: i32,
    pub dpadUpLabel: i32,
    pub dpadDownLabel: i32,
    pub dpadLeftLabel: i32,
    pub dpadRightLabel: i32,
    pub leftShoulderButtonLabel: i32,
    pub rightShoulderButtonLabel: i32,
    pub leftThumbstickButtonLabel: i32,
    pub rightThumbstickButtonLabel: i32,
}
import "golang.org/x/sys/windows"

type GameInputGamepadInfo struct {
	menuButtonLabel int32
	viewButtonLabel int32
	aButtonLabel int32
	bButtonLabel int32
	xButtonLabel int32
	yButtonLabel int32
	dpadUpLabel int32
	dpadDownLabel int32
	dpadLeftLabel int32
	dpadRightLabel int32
	leftShoulderButtonLabel int32
	rightShoulderButtonLabel int32
	leftThumbstickButtonLabel int32
	rightThumbstickButtonLabel int32
}
type
  GameInputGamepadInfo = record
    menuButtonLabel: Integer;
    viewButtonLabel: Integer;
    aButtonLabel: Integer;
    bButtonLabel: Integer;
    xButtonLabel: Integer;
    yButtonLabel: Integer;
    dpadUpLabel: Integer;
    dpadDownLabel: Integer;
    dpadLeftLabel: Integer;
    dpadRightLabel: Integer;
    leftShoulderButtonLabel: Integer;
    rightShoulderButtonLabel: Integer;
    leftThumbstickButtonLabel: Integer;
    rightThumbstickButtonLabel: Integer;
  end;
const GameInputGamepadInfo = extern struct {
    menuButtonLabel: i32,
    viewButtonLabel: i32,
    aButtonLabel: i32,
    bButtonLabel: i32,
    xButtonLabel: i32,
    yButtonLabel: i32,
    dpadUpLabel: i32,
    dpadDownLabel: i32,
    dpadLeftLabel: i32,
    dpadRightLabel: i32,
    leftShoulderButtonLabel: i32,
    rightShoulderButtonLabel: i32,
    leftThumbstickButtonLabel: i32,
    rightThumbstickButtonLabel: i32,
};
type
  GameInputGamepadInfo {.bycopy.} = object
    menuButtonLabel: int32
    viewButtonLabel: int32
    aButtonLabel: int32
    bButtonLabel: int32
    xButtonLabel: int32
    yButtonLabel: int32
    dpadUpLabel: int32
    dpadDownLabel: int32
    dpadLeftLabel: int32
    dpadRightLabel: int32
    leftShoulderButtonLabel: int32
    rightShoulderButtonLabel: int32
    leftThumbstickButtonLabel: int32
    rightThumbstickButtonLabel: int32
struct GameInputGamepadInfo
{
    int menuButtonLabel;
    int viewButtonLabel;
    int aButtonLabel;
    int bButtonLabel;
    int xButtonLabel;
    int yButtonLabel;
    int dpadUpLabel;
    int dpadDownLabel;
    int dpadLeftLabel;
    int dpadRightLabel;
    int leftShoulderButtonLabel;
    int rightShoulderButtonLabel;
    int leftThumbstickButtonLabel;
    int rightThumbstickButtonLabel;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GameInputGamepadInfo サイズ: 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 も可)
; aButtonLabel : GameInputLabel (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; bButtonLabel : GameInputLabel (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; xButtonLabel : GameInputLabel (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; yButtonLabel : GameInputLabel (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; dpadUpLabel : GameInputLabel (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; dpadDownLabel : GameInputLabel (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; dpadLeftLabel : GameInputLabel (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; dpadRightLabel : GameInputLabel (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; leftShoulderButtonLabel : GameInputLabel (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; rightShoulderButtonLabel : GameInputLabel (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; leftThumbstickButtonLabel : GameInputLabel (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; rightThumbstickButtonLabel : GameInputLabel (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global GameInputGamepadInfo
    #field int menuButtonLabel
    #field int viewButtonLabel
    #field int aButtonLabel
    #field int bButtonLabel
    #field int xButtonLabel
    #field int yButtonLabel
    #field int dpadUpLabel
    #field int dpadDownLabel
    #field int dpadLeftLabel
    #field int dpadRightLabel
    #field int leftShoulderButtonLabel
    #field int rightShoulderButtonLabel
    #field int leftThumbstickButtonLabel
    #field int rightThumbstickButtonLabel
#endstruct

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