Dualie
Loading...
Searching...
No Matches
dl::Input Namespace Reference

A namespace that encapsulates all input-related functions and enumerations. More...

Enumerations

enum  InputType { PRESSED = 0 , HELD , RELEASED }
 
enum  Key {
  A = BIT(0) , B = BIT(1) , SELECT = BIT(2) , START = BIT(3) ,
  DRIGHT = BIT(4) , DLEFT = BIT(5) , DUP = BIT(6) , DDOWN = BIT(7) ,
  R = BIT(8) , L = BIT(9) , X = BIT(10) , Y = BIT(11) ,
  ZL = BIT(14) , ZR = BIT(15) , TOUCH = BIT(20) , CSTICK_RIGHT = BIT(24) ,
  CSTICK_LEFT = BIT(25) , CSTICK_UP = BIT(26) , CSTICK_DOWN = BIT(27) , CPAD_RIGHT = BIT(28) ,
  CPAD_LEFT = BIT(29) , CPAD_UP = BIT(30) , CPAD_DOWN = BIT(31) , UP = DUP | CPAD_UP ,
  DOWN = DDOWN | CPAD_DOWN , LEFT = DLEFT | CPAD_LEFT , RIGHT = DRIGHT | CPAD_RIGHT
}
 

Functions

bool isKeyPressed (Key key)
 Returns whether a certain key was pressed that frame. Note that this does not capture held buttons.
 
bool isKeyHeld (Key key)
 Returns whether a certain key was held that frame.
 
bool isKeyReleased (Key key)
 Returns whether a certain key was released that frame.
 
void updateInput ()
 

Variables

u32 KeyPressedMask = 0
 
u32 KeyHeldMask = 0
 
u32 KeyReleasedMask = 0
 
float SliderValue = 0
 
dl::Vector2f TouchPosition = dl::Vector2f(0,0)
 The touch position of the screen. If the screen is not touched, This will be (0,0). See LastTouchPosition.
 
dl::Vector2f LastTouchPosition = dl::Vector2f(0,0)
 The touch position of the screen. If the screen is not touched, This will be the last valid touch of the screen. See TouchPosition.
 

Detailed Description

A namespace that encapsulates all input-related functions and enumerations.

Enumeration Type Documentation

◆ Key

Enumerator

A.

B.

SELECT 

Select.

START 

Start.

DRIGHT 

D-Pad Right.

DLEFT 

D-Pad Left.

DUP 

D-Pad Up.

DDOWN 

D-Pad Down.

R.

L.

X.

Y.

ZL 

ZL (New 3DS only)

ZR 

ZR (New 3DS only)

TOUCH 

Touch (Not actually provided by HID)

CSTICK_RIGHT 

C-Stick Right (New 3DS only)

CSTICK_LEFT 

C-Stick Left (New 3DS only)

CSTICK_UP 

C-Stick Up (New 3DS only)

CSTICK_DOWN 

C-Stick Down (New 3DS only)

CPAD_RIGHT 

Circle Pad Right.

CPAD_LEFT 

Circle Pad Left.

CPAD_UP 

Circle Pad Up.

CPAD_DOWN 

Circle Pad Down.

UP 

D-Pad Up or Circle Pad Up.

DOWN 

D-Pad Down or Circle Pad Down.

LEFT 

D-Pad Left or Circle Pad Left.

RIGHT 

D-Pad Right or Circle Pad Right.

Function Documentation

◆ isKeyHeld()

bool dl::Input::isKeyHeld ( Key key)

Returns whether a certain key was held that frame.

Parameters
keyThe button to check
Returns
Whether the button is held

◆ isKeyPressed()

bool dl::Input::isKeyPressed ( Key key)

Returns whether a certain key was pressed that frame. Note that this does not capture held buttons.

Parameters
keyThe button to check
Returns
Whether the button is pressed

◆ isKeyReleased()

bool dl::Input::isKeyReleased ( Key key)

Returns whether a certain key was released that frame.

Parameters
keyThe button to check
Returns
Whether the button is released