UdonLibrary
1.0.0
機械システム研究部 C++ ライブラリ
読み取り中…
検索中…
一致する文字列を見つけられません
PadPS5.hpp
[詳解]
1
//
2
// 通信用メッセージ
3
//
4
// Copyright (c) 2022-2024 udonrobo
5
//
6
7
#pragma once
8
9
#include <
Udon/Traits/EnumerableMacro.hpp
>
10
11
#include <stdint.h>
12
13
namespace
Udon
14
{
15
namespace
Message
16
{
17
20
struct
PadPS5
21
{
22
bool
isConnected
;
// 接続状態
23
24
bool
triangle
;
// ▵
25
bool
circle
;
// ○
26
bool
cross
;
// ×
27
bool
square
;
// □
28
29
bool
up
;
// ↑
30
bool
right
;
// →
31
bool
down
;
// ↓
32
bool
left
;
// ←
33
34
bool
l1
;
35
bool
r1
;
36
37
bool
l2
;
38
bool
r2
;
39
40
bool
l3
;
// 左スティック押し込み
41
bool
r3
;
// 右スティック押し込み
42
43
bool
create
;
// 左上 \|/ ボタン
44
bool
option
;
// 右上 ≡ ボタン
45
46
bool
touch
;
// タッチパッド
47
48
bool
mic
;
// ミュートボタン
49
bool
ps
;
// PSボタン
50
51
int8_t
analogRightX
;
52
int8_t
analogRightY
;
53
54
int8_t
analogLeftX
;
55
int8_t
analogLeftY
;
56
57
void
clear
()
58
{
59
*
this
= {};
60
}
61
62
#ifdef ARDUINO
64
void
show()
const
65
{
66
if
(
isConnected
)
67
{
68
Serial.print(
"connected "
);
69
}
70
else
71
{
72
Serial.print(
"disconnected "
);
73
}
74
75
Serial.print(
triangle
), Serial.print(
' '
);
76
Serial.print(
circle
), Serial.print(
' '
);
77
Serial.print(
cross
), Serial.print(
' '
);
78
Serial.print(
square
), Serial.print(
' '
);
79
80
Serial.print(
up
), Serial.print(
' '
);
81
Serial.print(
right
), Serial.print(
' '
);
82
Serial.print(
down
), Serial.print(
' '
);
83
Serial.print(
left
), Serial.print(
' '
);
84
85
Serial.print(
l1
), Serial.print(
' '
);
86
Serial.print(
r1
), Serial.print(
' '
);
87
Serial.print(
l2
), Serial.print(
' '
);
88
Serial.print(
r2
), Serial.print(
' '
);
89
Serial.print(
l3
), Serial.print(
' '
);
90
Serial.print(
r3
), Serial.print(
' '
);
91
92
Serial.print(
create
), Serial.print(
' '
);
93
Serial.print(
option
), Serial.print(
' '
);
94
Serial.print(
touch
), Serial.print(
' '
);
95
Serial.print(
mic
), Serial.print(
' '
);
96
Serial.print(
ps
), Serial.print(
' '
);
97
98
Serial.print(
analogRightX
), Serial.print(
'\t'
);
99
Serial.print(
analogRightY
), Serial.print(
'\t'
);
100
Serial.print(
analogLeftX
), Serial.print(
'\t'
);
101
Serial.print(
analogLeftY
);
102
}
103
#endif
104
105
UDON_ENUMERABLE
(
106
isConnected
,
107
triangle
,
circle
,
cross
,
square
,
108
up
,
right
,
down
,
left
,
109
l1
,
r1
,
l2
,
r2
,
l3
,
r3
,
110
create
,
option
,
touch
,
mic
,
ps
,
111
analogRightX
,
analogRightY
,
analogLeftX
,
analogLeftY
);
112
};
113
}
// namespace Message
114
}
// namespace Udon
EnumerableMacro.hpp
Udon
Definition
Bit.hpp:12
Udon::Message::PadPS5
PS5コントローラーのボタン情報
Definition
PadPS5.hpp:21
Udon::Message::PadPS5::cross
bool cross
Definition
PadPS5.hpp:26
Udon::Message::PadPS5::clear
void clear()
Definition
PadPS5.hpp:57
Udon::Message::PadPS5::analogRightX
int8_t analogRightX
Definition
PadPS5.hpp:51
Udon::Message::PadPS5::r2
bool r2
Definition
PadPS5.hpp:38
Udon::Message::PadPS5::isConnected
bool isConnected
Definition
PadPS5.hpp:22
Udon::Message::PadPS5::l2
bool l2
Definition
PadPS5.hpp:37
Udon::Message::PadPS5::r3
bool r3
Definition
PadPS5.hpp:41
Udon::Message::PadPS5::right
bool right
Definition
PadPS5.hpp:30
Udon::Message::PadPS5::down
bool down
Definition
PadPS5.hpp:31
Udon::Message::PadPS5::analogLeftY
int8_t analogLeftY
Definition
PadPS5.hpp:55
Udon::Message::PadPS5::triangle
bool triangle
Definition
PadPS5.hpp:24
Udon::Message::PadPS5::square
bool square
Definition
PadPS5.hpp:27
Udon::Message::PadPS5::touch
bool touch
Definition
PadPS5.hpp:46
Udon::Message::PadPS5::ps
bool ps
Definition
PadPS5.hpp:49
Udon::Message::PadPS5::circle
bool circle
Definition
PadPS5.hpp:25
Udon::Message::PadPS5::option
bool option
Definition
PadPS5.hpp:44
Udon::Message::PadPS5::l1
bool l1
Definition
PadPS5.hpp:34
Udon::Message::PadPS5::left
bool left
Definition
PadPS5.hpp:32
Udon::Message::PadPS5::analogLeftX
int8_t analogLeftX
Definition
PadPS5.hpp:54
Udon::Message::PadPS5::l3
bool l3
Definition
PadPS5.hpp:40
Udon::Message::PadPS5::UDON_ENUMERABLE
UDON_ENUMERABLE(isConnected, triangle, circle, cross, square, up, right, down, left, l1, r1, l2, r2, l3, r3, create, option, touch, mic, ps, analogRightX, analogRightY, analogLeftX, analogLeftY)
Udon::Message::PadPS5::create
bool create
Definition
PadPS5.hpp:43
Udon::Message::PadPS5::r1
bool r1
Definition
PadPS5.hpp:35
Udon::Message::PadPS5::mic
bool mic
Definition
PadPS5.hpp:48
Udon::Message::PadPS5::up
bool up
Definition
PadPS5.hpp:29
Udon::Message::PadPS5::analogRightY
int8_t analogRightY
Definition
PadPS5.hpp:52