#include <PS2Pad.h>
Inheritance diagram for Lamp::PS2Pad:
Public Types | |
enum | Button { button0 = 0, button1, button2, button3, buttonL2, buttonR2, buttonL1, buttonR1, buttonStart, buttonSelect, buttonL3, buttonR3, buttonPOVUp, buttonPOVRight, buttonPOVDown, buttonPOVLeft, maxButtonCount, buttonUnknown = -1, buttonSankaku = 0, buttonMaru = 1, buttonBatu = 2, buttonSikaku = 3 } |
ボタン | |
Public Member Functions | |
PS2Pad (Joystick *joystick) | |
コンストラクタ | |
virtual | ~PS2Pad () |
デストラクタ | |
virtual void | changeButtonMap (Button button, int id) |
ボタンマップの変更 | |
virtual int | getButtonMap (const Button button) |
ボタンマップの取得 | |
virtual Point2f | getLeftAxis () const |
左軸の取得 | |
virtual float | getLeftXAxis () const |
左X軸の取得 | |
virtual float | getLeftYAxis () const |
左Y軸の取得 | |
virtual Point2f | getRightAxis () const |
右軸の取得 | |
virtual float | getRightXAxis () const |
右X軸の取得 | |
virtual float | getRightYAxis () const |
右Y軸の取得 | |
virtual bool | upKeyPressed () const |
上キーが押されているか | |
virtual bool | upKeyDown () const |
上キーが下がった | |
virtual bool | upKeyUp () const |
上キーが上がった | |
virtual bool | downKeyPressed () const |
下キーが押されているか | |
virtual bool | downKeyDown () const |
下キーが下がった | |
virtual bool | downKeyUp () const |
下キーが上がった | |
virtual bool | leftKeyPressed () const |
左キーが押されているか | |
virtual bool | leftKeyDown () const |
左キーが下がった | |
virtual bool | leftKeyUp () const |
左キーが上がった | |
virtual bool | rightKeyPressed () const |
右キーが押されているか | |
virtual bool | rightKeyDown () const |
右キーが下がった | |
virtual bool | rightKeyUp () const |
右キーが上がった | |
virtual bool | buttonPressed (Button button) const |
ボタンが押されているか | |
virtual bool | buttonDown (Button button) const |
ボタンが下がった | |
virtual bool | buttonUp (Button button) const |
ボタンが上がった | |
virtual String | toString () const |
文字列への変換 | |
Static Public Member Functions | |
bool | checkCompatibility (Joystick *joystick) |
互換性チェック | |
String | getButtonString (Button button) |
ボタン文字列の取得 | |
Protected Member Functions | |
bool | povToUpKey (int pov) const |
視点コントローラ値から上キーへの変換 | |
bool | povToDownKey (int pov) const |
視点コントローラ値から下キーへの変換 | |
bool | povToLeftKey (int pov) const |
視点コントローラ値から左キーへの変換 | |
bool | povToRightKey (int pov) const |
視点コントローラ値から右キーへの変換 | |
Protected Attributes | |
int | buttonMap_ [maxButtonCount] |
ボタンマップ | |
bool | isSmartJoypad_ |
スマートジョイパッドフラグ | |
Static Protected Attributes | |
const int | deg45 = 4500 |
視点コントローラにおける45度 |
主にELECOM、LOASのPS2コントローラ変換ケーブルを使用した場合に対応している。 FFXI互換を謳っているUSBパッドはボタン並びが違っている模様。 SmartJoypadにも対応、Z軸、Z回転の扱いが逆になり、十字キーをボタンで認識している。
Definition at line 40 of file PS2Pad.h.
|
コンストラクタ
Definition at line 53 of file PS2Pad.cpp. References Assert, buttonMap_, changeButtonMap(), checkCompatibility(), Lamp::Joystick::getPOVCount(), isSmartJoypad_, and Lamp::Pad::joystick_. |
|
ボタンが下がった
Definition at line 199 of file PS2Pad.cpp. References Assert, Lamp::Joystick::buttonDown(), buttonMap_, and Lamp::Pad::joystick_. Referenced by Lamp::PS2PadCameraController::control(), downKeyDown(), leftKeyDown(), rightKeyDown(), toString(), and upKeyDown(). |
|
ボタンが押されているか
Definition at line 193 of file PS2Pad.cpp. References Assert, buttonMap_, Lamp::Joystick::buttonPressed(), and Lamp::Pad::joystick_. Referenced by Lamp::PS2PadCameraController::control(), downKeyPressed(), leftKeyPressed(), rightKeyPressed(), toString(), and upKeyPressed(). |
|
ボタンが上がった
Definition at line 205 of file PS2Pad.cpp. References Assert, buttonMap_, Lamp::Joystick::buttonUp(), and Lamp::Pad::joystick_. Referenced by downKeyUp(), leftKeyUp(), rightKeyUp(), toString(), and upKeyUp(). |
|
ボタンマップの変更
Definition at line 74 of file PS2Pad.cpp. References Assert, and buttonMap_. Referenced by PS2Pad(). |
|
互換性チェック
Definition at line 33 of file PS2Pad.cpp. References Lamp::Joystick::getButtonCount(), Lamp::Joystick::getPOVCount(), Lamp::Joystick::hasXAxis(), Lamp::Joystick::hasYAxis(), Lamp::Joystick::hasZAxis(), and Lamp::Joystick::hasZRotation(). Referenced by PS2Pad(). |
|
下キーが下がった
Definition at line 137 of file PS2Pad.cpp. References buttonDown(), Lamp::Joystick::getPOV(), Lamp::Joystick::getPrePOV(), isSmartJoypad_, Lamp::Pad::joystick_, and povToDownKey(). Referenced by Lamp::PS2PadCameraController::control(), and toString(). |
|
下キーが押されているか
Definition at line 131 of file PS2Pad.cpp. References buttonPressed(), Lamp::Joystick::getPOV(), isSmartJoypad_, Lamp::Pad::joystick_, and povToDownKey(). Referenced by toString(). |
|
下キーが上がった
Definition at line 144 of file PS2Pad.cpp. References buttonUp(), Lamp::Joystick::getPOV(), Lamp::Joystick::getPrePOV(), isSmartJoypad_, Lamp::Pad::joystick_, and povToDownKey(). Referenced by toString(). |
|
ボタンマップの取得
Definition at line 104 of file PS2Pad.h. References Assert, and buttonMap_. |
|
ボタン文字列の取得
Definition at line 213 of file PS2Pad.cpp. References Assert. |
|
左軸の取得
Definition at line 116 of file PS2Pad.h. References getLeftXAxis(), and getLeftYAxis(). Referenced by Lamp::PS2PadCameraController::control(). |
|
左X軸の取得
Definition at line 87 of file PS2Pad.cpp. References Lamp::Joystick::getXAxis(), and Lamp::Pad::joystick_. Referenced by getLeftAxis(), and toString(). |
|
左Y軸の取得
Definition at line 92 of file PS2Pad.cpp. References Lamp::Joystick::getYAxis(), and Lamp::Pad::joystick_. Referenced by getLeftAxis(), and toString(). |
|
右軸の取得
Definition at line 137 of file PS2Pad.h. References getRightXAxis(), and getRightYAxis(). Referenced by Lamp::PS2PadCameraController::control(). |
|
右X軸の取得
Definition at line 97 of file PS2Pad.cpp. References Lamp::Joystick::getZAxis(), Lamp::Joystick::getZRotation(), isSmartJoypad_, and Lamp::Pad::joystick_. Referenced by getRightAxis(), and toString(). |
|
右Y軸の取得
Definition at line 103 of file PS2Pad.cpp. References Lamp::Joystick::getZAxis(), Lamp::Joystick::getZRotation(), isSmartJoypad_, and Lamp::Pad::joystick_. Referenced by getRightAxis(), and toString(). |
|
左キーが下がった
Definition at line 157 of file PS2Pad.cpp. References buttonDown(), Lamp::Joystick::getPOV(), Lamp::Joystick::getPrePOV(), isSmartJoypad_, Lamp::Pad::joystick_, and povToLeftKey(). Referenced by toString(). |
|
左キーが押されているか
Definition at line 151 of file PS2Pad.cpp. References buttonPressed(), Lamp::Joystick::getPOV(), isSmartJoypad_, Lamp::Pad::joystick_, and povToLeftKey(). Referenced by toString(). |
|
左キーが上がった
Definition at line 164 of file PS2Pad.cpp. References buttonUp(), Lamp::Joystick::getPOV(), Lamp::Joystick::getPrePOV(), isSmartJoypad_, Lamp::Pad::joystick_, and povToLeftKey(). Referenced by toString(). |
|
視点コントローラ値から下キーへの変換
Definition at line 289 of file PS2Pad.h. References deg45. Referenced by downKeyDown(), downKeyPressed(), and downKeyUp(). |
|
視点コントローラ値から左キーへの変換
Definition at line 299 of file PS2Pad.h. References deg45. Referenced by leftKeyDown(), leftKeyPressed(), and leftKeyUp(). |
|
視点コントローラ値から右キーへの変換
Definition at line 309 of file PS2Pad.h. References deg45. Referenced by rightKeyDown(), rightKeyPressed(), and rightKeyUp(). |
|
視点コントローラ値から上キーへの変換
Definition at line 278 of file PS2Pad.h. References deg45. Referenced by upKeyDown(), upKeyPressed(), and upKeyUp(). |
|
右キーが下がった
Definition at line 177 of file PS2Pad.cpp. References buttonDown(), Lamp::Joystick::getPOV(), Lamp::Joystick::getPrePOV(), isSmartJoypad_, Lamp::Pad::joystick_, and povToRightKey(). Referenced by toString(). |
|
右キーが押されているか
Definition at line 171 of file PS2Pad.cpp. References buttonPressed(), Lamp::Joystick::getPOV(), isSmartJoypad_, Lamp::Pad::joystick_, and povToRightKey(). Referenced by toString(). |
|
右キーが上がった
Definition at line 184 of file PS2Pad.cpp. References buttonUp(), Lamp::Joystick::getPOV(), Lamp::Joystick::getPrePOV(), isSmartJoypad_, Lamp::Pad::joystick_, and povToRightKey(). Referenced by toString(). |
|
文字列への変換
Reimplemented from Lamp::Pad. Definition at line 224 of file PS2Pad.cpp. References buttonDown(), buttonPressed(), buttonUp(), downKeyDown(), downKeyPressed(), downKeyUp(), Lamp::String::format(), getLeftXAxis(), getLeftYAxis(), getRightXAxis(), getRightYAxis(), leftKeyDown(), leftKeyPressed(), leftKeyUp(), rightKeyDown(), rightKeyPressed(), rightKeyUp(), upKeyDown(), upKeyPressed(), and upKeyUp(). |
|
上キーが下がった
Definition at line 117 of file PS2Pad.cpp. References buttonDown(), Lamp::Joystick::getPOV(), Lamp::Joystick::getPrePOV(), isSmartJoypad_, Lamp::Pad::joystick_, and povToUpKey(). Referenced by Lamp::PS2PadCameraController::control(), and toString(). |
|
上キーが押されているか
Definition at line 111 of file PS2Pad.cpp. References buttonPressed(), Lamp::Joystick::getPOV(), isSmartJoypad_, Lamp::Pad::joystick_, and povToUpKey(). Referenced by toString(). |
|
上キーが上がった
Definition at line 124 of file PS2Pad.cpp. References buttonUp(), Lamp::Joystick::getPOV(), Lamp::Joystick::getPrePOV(), isSmartJoypad_, Lamp::Pad::joystick_, and povToUpKey(). Referenced by toString(). |