ホーム › UI.Input.GameInput › GameInputGamepadInfo
GameInputGamepadInfo
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| menuButtonLabel | GameInputLabel | 4 | +0 | +0 | メニューボタンの物理ラベルである。 |
| viewButtonLabel | GameInputLabel | 4 | +4 | +4 | ビューボタンの物理ラベルである。 |
| aButtonLabel | GameInputLabel | 4 | +8 | +8 | Aボタンの物理ラベルである。 |
| bButtonLabel | GameInputLabel | 4 | +12 | +12 | Bボタンの物理ラベルである。 |
| xButtonLabel | GameInputLabel | 4 | +16 | +16 | Xボタンの物理ラベルである。 |
| yButtonLabel | GameInputLabel | 4 | +20 | +20 | Yボタンの物理ラベルである。 |
| dpadUpLabel | GameInputLabel | 4 | +24 | +24 | 方向パッド上の物理ラベルである。 |
| dpadDownLabel | GameInputLabel | 4 | +28 | +28 | 方向パッド下の物理ラベルである。 |
| dpadLeftLabel | GameInputLabel | 4 | +32 | +32 | 方向パッド左の物理ラベルである。 |
| dpadRightLabel | GameInputLabel | 4 | +36 | +36 | 方向パッド右の物理ラベルである。 |
| leftShoulderButtonLabel | GameInputLabel | 4 | +40 | +40 | 左ショルダーボタンの物理ラベルである。 |
| rightShoulderButtonLabel | GameInputLabel | 4 | +44 | +44 | 右ショルダーボタンの物理ラベルである。 |
| leftThumbstickButtonLabel | GameInputLabel | 4 | +48 | +48 | 左スティック押し込みボタンの物理ラベルである。 |
| rightThumbstickButtonLabel | GameInputLabel | 4 | +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 Structureimport 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: int32struct 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