2 #include <Multimedia/SDX.h>
3 #include <Multimedia/Key.h>
4 #include <Multimedia/InputEnum.h>
13 PadType inputType = PadType::KeyAndPad1;
15 Joypad(
const Joypad &joypad){};
16 Joypad operator =(
const Joypad &joypad){};
60 SDL_JoystickEventState(SDL_ENABLE);
61 handle = SDL_JoystickOpen(0);
115 const int N = DxLib::GetJoypadInputState(static_cast<int>(inputType));
116 DxLib::GetJoypadAnalogInput( &StickX , &StickY, (
int)inputType );
117 Down.
Update( N & (
int)PadCode::Down);
118 Left.
Update( N & (
int)PadCode::Left );
119 Right.
Update( N & (
int)PadCode::Right );
120 Up.
Update( N & (
int)PadCode::Up );
121 Button1.
Update( N & (
int)PadCode::Button1 );
122 Button2.
Update( N & (
int)PadCode::Button2 );
123 Button3.
Update( N & (
int)PadCode::Button3 );
124 Button4.
Update( N & (
int)PadCode::Button4 );
125 Button5.
Update( N & (
int)PadCode::Button5 );
126 Button6.
Update( N & (
int)PadCode::Button6 );
127 Button7.
Update( N & (
int)PadCode::Button7 );
128 Button8.
Update( N & (
int)PadCode::Button8 );
129 Button9.
Update( N & (
int)PadCode::Button9 );
130 Button10.
Update( N & (
int)PadCode::Button10 );
131 Button11.
Update( N & (
int)PadCode::Button11 );
132 Button12.
Update( N & (
int)PadCode::Button12 );
133 Button13.
Update( N & (
int)PadCode::Button13 );
134 Button14.
Update( N & (
int)PadCode::Button14 );
135 Button15.
Update( N & (
int)PadCode::Button15 );
136 Button16.
Update( N & (
int)PadCode::Button16 );
137 Button17.
Update( N & (
int)PadCode::Button17 );
138 Button18.
Update( N & (
int)PadCode::Button18 );
139 Button19.
Update( N & (
int)PadCode::Button19 );
140 Button20.
Update( N & (
int)PadCode::Button20 );
141 Button21.
Update( N & (
int)PadCode::Button21 );
142 Button22.
Update( N & (
int)PadCode::Button22 );
143 Button23.
Update( N & (
int)PadCode::Button23 );
144 Button24.
Update( N & (
int)PadCode::Button24 );
145 Button25.
Update( N & (
int)PadCode::Button25 );
146 Button26.
Update( N & (
int)PadCode::Button26 );
147 Button27.
Update( N & (
int)PadCode::Button27 );
148 Button28.
Update( N & (LONG64)PadCode::Button28 );
150 Down.
Update( press[(
int)PadCode::Down]);
151 Left.
Update(press[(
int)PadCode::Left]);
152 Right.
Update(press[(
int)PadCode::Right]);
153 Up.
Update(press[(
int)PadCode::Up]);
154 Button1.
Update(press[(
int)PadCode::Button1]);
155 Button2.
Update(press[(
int)PadCode::Button2]);
156 Button3.
Update(press[(
int)PadCode::Button3]);
157 Button4.
Update(press[(
int)PadCode::Button4]);
158 Button5.
Update(press[(
int)PadCode::Button5]);
159 Button6.
Update(press[(
int)PadCode::Button6]);
160 Button7.
Update(press[(
int)PadCode::Button7]);
161 Button8.
Update(press[(
int)PadCode::Button8]);
162 Button9.
Update(press[(
int)PadCode::Button9]);
163 Button10.
Update(press[(
int)PadCode::Button10]);
164 Button11.
Update(press[(
int)PadCode::Button11]);
165 Button12.
Update(press[(
int)PadCode::Button12]);
166 Button13.
Update(press[(
int)PadCode::Button13]);
167 Button14.
Update(press[(
int)PadCode::Button14]);
168 Button15.
Update(press[(
int)PadCode::Button15]);
169 Button16.
Update(press[(
int)PadCode::Button16]);
170 Button17.
Update(press[(
int)PadCode::Button17]);
171 Button18.
Update(press[(
int)PadCode::Button18]);
172 Button19.
Update(press[(
int)PadCode::Button19]);
173 Button20.
Update(press[(
int)PadCode::Button20]);
174 Button21.
Update(press[(
int)PadCode::Button21]);
175 Button22.
Update(press[(
int)PadCode::Button22]);
176 Button23.
Update(press[(
int)PadCode::Button23]);
177 Button24.
Update(press[(
int)PadCode::Button24]);
178 Button25.
Update(press[(
int)PadCode::Button25]);
179 Button26.
Update(press[(
int)PadCode::Button26]);
180 Button27.
Update(press[(
int)PadCode::Button27]);
181 Button28.
Update(press[(
int)PadCode::Button28]);
198 bool SetInputToKey(PadCode padInput,KeyCode keyInput1 ,KeyCode keyInput2, KeyCode keyInput3,KeyCode keyInput4)
202 return !DxLib::SetJoypadInputToKeyInput( (
int)inputType , (
int)padInput, (
int)keyInput1, (
int)keyInput2, (
int)keyInput3, (
int)keyInput4 ) ;
214 return !DxLib::StartJoypadVibration((
int)inputType,
int(強さ * 1000), 振動ミリ秒);
224 return !DxLib::StopJoypadVibration((
int)inputType);
234 return DxLib::GetJoypadNum();
static int GetCount()
接続中のパッド数を取得.
Definition: Joypad.h:231
bool StopVibration()
パッドの振動を停止する.
Definition: Joypad.h:221
bool SetInputToKey(PadCode padInput, KeyCode keyInput1, KeyCode keyInput2, KeyCode keyInput3, KeyCode keyInput4)
キーのパッド割当て設定.
Definition: Joypad.h:199
void Reset()
キーのリセット.
Definition: Key.h:17
void Update(int 押下フラグ)
押下状態の更新.
Definition: Key.h:26
PadType GetInputType()
パッドタイプの取得.
Definition: Joypad.h:186
void Reset()
状態のリセット.
Definition: Joypad.h:72
void Make(PadType パッドタイプ)
パッドの作成.
Definition: Joypad.h:66
void Update()
状態の更新.
Definition: Joypad.h:112
bool StartVibration(double 強さ, int 振動ミリ秒)
パッドを振動させる.
Definition: Joypad.h:211
void SetInputType(PadType 入力タイプ)
パッドタイプの設定.
Definition: Joypad.h:192