28 BUTTON_DOWN = BIT_FLAG(0),
29 BUTTON_UP = BIT_FLAG(1),
30 BUTTON_RIGHT = BIT_FLAG(2),
31 BUTTON_LEFT = BIT_FLAG(3),
32 BUTTON_CROSS = BUTTON_LEFT | BUTTON_RIGHT | BUTTON_UP | BUTTON_DOWN,
33 BUTTON_TWO = BIT_FLAG(8),
34 BUTTON_ONE = BIT_FLAG(9),
35 BUTTON_B = BIT_FLAG(10),
36 BUTTON_A = BIT_FLAG(11),
void offStatus(u16 status)
Disables a status flag.
void updateEnd()
Get the new button states for the next frame.
bool triggerJump()
Returns whether the jump button (2) was pressed this frame.
void onStatus(u16 status)
Enables a status flag.
int triggerA() const
Returns whether A was pressed this frame.
u16 mTriggeredButtonsDemo
The buttons newly pressed down in demo mode.
int triggerJumpBase() const
Returns whether the jump button (2) was pressed this frame.
bool checkHipAttack()
Checks whether a hip attack should be performed this frame.
void offDemoButton(int)
Sets a button for demo mode to not pressed down.
int buttonCrouch() const
Returns whether the crouch button (down) is pressed down.
bool triggerJumpBuf(int n)
Returns whether a jump occurred in the last n frames.
int buttonDoor() const
Returns whether the correct buttons (up, no left or right) for a door open is pressed down.
u16 mDemoDoShake
Trigger a shake event in demo mode.
u8 mHipAtkHoldCount
Counts how long the down button is held for the hip attack.
int buttonCross() const
Returns whether a directional button is pressed down.
int mRemoconID
This remote's ID, -1 if invalid.
int buttonUp() const
Returns whether the up button is pressed down.
u8 mActiveShakeJump
Whether a shake is active this frame.
int buttonLeft() const
Returns whether the left button is pressed down.
bool mActionTriggered
Set if eat, fire or jump is triggered.
bool mHipAtkHoldStart
Whether the hip attack holding started.
int triggerAttack() const
Returns whether the attack button (1 / B) was pressed this frame.
u16 mPrevDownButtons
The buttons pressed down in the last frame.
~dAcPyKey_c()
Destroys the controller manager.
bool buttonWalk(int *direction) const
Returns whether left / right is pressed down. Sets the direction to 0 for right and 1 for left.
void onDemoTrigger(int)
Sets a button for demo mode to pressed this frame.
int mShakeCooldown
Cooldown counter for shake events.
void clearCrossKey()
Clears the left and right directional buttons.
int buttonTwo() const
Returns whether the two button is pressed down.
void onDemoButton(int)
Sets a button for demo mode to pressed down.
u8 triggerShakeJump() const
Returns whether a shake event was triggered this frame.
int buttonHipAttack() const
Returns whether the correct buttons (down, no other directions) for a hip attack is pressed down.
int triggerOne() const
Returns whether the one button was pressed this frame.
int buttonRight() const
Returns whether the right button is pressed down.
u16 mDownButtons
The buttons currently pressed down.
int triggerCross() const
Returns whether a directional button was pressed this frame.
int buttonCarry() const
Returns whether the carry button (1 / B) is pressed down.
int triggerDown() const
Returns whether the down button was pressed this frame.
void update()
Call each frame to process the inputs.
void clearAllKey()
Clears all input state.
int buttonOne() const
Returns whether the one button is pressed down.
u16 mPrevTriggeredButtons
The buttons newly pressed down in the last frame.
int triggerTwo() const
Returns whether the two button was pressed this frame.
int triggerLeft() const
Returns whether the left button was pressed this frame.
bool triggerFire()
Returns whether the fire button was pressed this frame.
int triggerRight() const
Returns whether the right button was pressed this frame.
dAcPyKey_c()
Constructs a new controller manager.
int buttonYoshiJump() const
Returns whether the Yoshi jump button (2) is pressed down.
bool triggerEat()
Returns whether the eat button (1 / B) was pressed this frame.
bool mHipAtkRead
Whether hip attack was checked for this frame.
u8 mTriggerShakeJump
Whether a shake was triggered this frame.
u16 mTriggeredButtons
The buttons newly pressed down.
int triggerUp() const
Returns whether the up button was pressed this frame.
STATUS_e
Status flags for the controller manager.
@ STATUS_SHAKE_COOLDOWN
Is in cooldown for shake events.
@ STATUS_FORCE_NO_JUMP
Force a jump input to be ignored.
@ STATUS_FORCE_RIGHT
Override the input to always only be the right button.
@ STATUS_DISABLE_LR
Disable left and right directional buttons.
@ STATUS_FORCE_JUMP
Force the jump button to be pressed down.
@ STATUS_DEMO
Do not use inputs from the remote.
@ STATUS_NO_INPUT
Disable all inputs.
void clearShakeJump()
Clears the shake event state.
int buttonDush() const
Returns whether the run button is pressed down.
void onDemoShake()
Sets a shake event for demo mode to be triggered this frame.
BUTTONS_e
Button flags for the controller manager.
u16 mDownButtonsDemo
The buttons currently pressed down in demo mode.
int buttonDown() const
Returns whether the down button is pressed down.
int mJumpButtonHistory[4][10]
Stores the last 10 frames of the jump button state for each remote.
int mJumpTriggeredHistory[4][10]
Stores the last 10 frames of jump events for each remote.
int buttonJump()
Returns whether the jump button (2) is pressed down.
void init()
Initialize the button manager.
u16 mStatus
Uses FLAGS_e enum.