111 mSticks[nStick].mX = fX;
112 mSticks[nStick].mY = fY;
122 mPressures[nButton] = fPressure;
152 mConnected = nConnected;
157 mThreshold = fThreshold;
State of one controller port as the last poll read it.
Definition joypad.h:68
void SetThreshold(float fThreshold)
Definition joypad.h:156
void SetButtons(int nButtons)
Definition joypad.h:131
void SetStick(int nStick, float fX, float fY)
Set the position of a stick.
Definition joypad.h:110
void SetPad(int nPad)
Definition joypad.h:141
int GetButtons() const
Definition joypad.h:126
const JoypadStick * GetSticks() const
Definition joypad.h:94
void AddStickButtons(int *pButtons, bool bMenu)
Set the bits of the stick directions pushed past mThreshold.
const float * GetPressures() const
Definition joypad.h:99
int GetPad() const
Definition joypad.h:136
JoypadState()
Clear the buttons, the sticks, and the pressures, and give the port no pad.
void SetPressure(int nButton, float fPressure)
Set the pressure of a button.
Definition joypad.h:121
void SetConnected(int nConnected)
Definition joypad.h:151
int GetConnected() const
Definition joypad.h:146
Receiver of engine messages.
Definition msgsink.h:21
void JoypadSetStickMessages(bool bEnable)
Turn the analog stick messages of the controller poll on or off.
constexpr int kJoypadNumPorts
The number of controllers the poll reads, four multitap slots on each of two ports.
Definition joypad.h:12
void JoypadSetVibration(int nPad, int nSmallMotor, int nBigMotor)
Drive the vibration motors of the controller on a port.
void JoypadPoll()
Read every controller port that serves a pad, and send messages for what changed.
void JoypadMapDefault(bool bPort0Multitap, bool bPort1Multitap)
Give the controller ports to the pads.
void JoypadSetMenuControl(int nPad, bool bMenu)
Give the input of a controller to the menus or to the running world.
constexpr int kJoypadNumPads
The number of players the controllers can be given to.
Definition joypad.h:15
constexpr int kJoypadNoPad
The pad a port stores while no player uses it.
Definition joypad.h:18
void JoypadRemoveSink(MsgSink *pSink)
Remove a sink from the receivers of the controller messages.
void JoypadTerminate()
Shut the controller layer down.
void JoypadInit()
Open every controller port and give the first port to pad 0.
constexpr int kJoypadNumSticks
The number of analogue sticks of a controller.
Definition joypad.h:6
void JoypadAddSink(MsgSink *pSink)
Add a sink to the receivers of the controller messages.
JoypadButton
Buttons of a controller, the values JoypadInputMsg::mButton takes.
Definition joypad.h:25
@ kPadDLeft
Definition joypad.h:41
@ kPadSelect
Definition joypad.h:34
@ kPadNone
Definition joypad.h:50
@ kPadLeftStickUp
Definition joypad.h:42
@ kPadTriangle
Definition joypad.h:30
@ kPadRightStickRight
Definition joypad.h:47
@ kPadL2
Definition joypad.h:26
@ kPadLeftStickLeft
Definition joypad.h:45
@ kPadRightStickLeft
Definition joypad.h:49
@ kPadDRight
Definition joypad.h:39
@ kPadDDown
Definition joypad.h:40
@ kPadLeftStickDown
Definition joypad.h:44
@ kPadRightStickUp
Definition joypad.h:46
@ kPadDUp
Definition joypad.h:38
@ kPadStart
Definition joypad.h:37
@ kPadR3
Definition joypad.h:36
@ kPadL1
Definition joypad.h:28
@ kPadCross
Definition joypad.h:32
@ kPadCircle
Definition joypad.h:31
@ kPadL3
Definition joypad.h:35
@ kPadLeftStickRight
Definition joypad.h:43
@ kPadR2
Definition joypad.h:27
@ kPadR1
Definition joypad.h:29
@ kPadRightStickDown
Definition joypad.h:48
@ kPadSquare
Definition joypad.h:33
JoypadState * JoypadGetState(int nPad)
Report the state of a controller.
constexpr int kJoypadNumButtons
The number of buttons of a controller, counting the stick directions.
Definition joypad.h:9
int JoypadMultitapConnected()
Report whether a multitap is connected, as the controller poll last found.
int JoypadWait()
Wait for pad 0 to release every button and then press one.
Position of one analogue stick.
Definition joypad.h:58
float mY
Definition joypad.h:60
float mX
Definition joypad.h:59