libnds
Macros | Typedefs | Enumerations
input.h File Reference

common values for keypad input. More...

#include <nds/ndstypes.h>

Macros

#define KEYXY_DEBUG   BIT(3)
 ARM7: Debug button.
 
#define KEYXY_LID   BIT(7)
 ARM7: Lid state.
 
#define KEYXY_TOUCH   BIT(6)
 ARM7: Touchscreen pendown.
 
#define KEYXY_X   BIT(0)
 ARM7: Keypad X button.
 
#define KEYXY_Y   BIT(1)
 ARM7: Keypad Y button.
 
#define REG_KEYCNT   (*(vuint16 *)0x04000132)
 Key input control register.
 
#define REG_KEYINPUT   (*(vuint16 *)0x04000130)
 Key input register. More...
 

Typedefs

typedef enum KEYPAD_BITS KEYPAD_BITS
 Enum values for the keypad buttons.
 

Enumerations

enum  KEYPAD_BITS {
  KEY_A = BIT(0) ,
  KEY_B = BIT(1) ,
  KEY_SELECT = BIT(2) ,
  KEY_START = BIT(3) ,
  KEY_RIGHT = BIT(4) ,
  KEY_LEFT = BIT(5) ,
  KEY_UP = BIT(6) ,
  KEY_DOWN = BIT(7) ,
  KEY_R = BIT(8) ,
  KEY_L = BIT(9) ,
  KEY_X = BIT(10) ,
  KEY_Y = BIT(11) ,
  KEY_TOUCH = BIT(12) ,
  KEY_LID = BIT(13) ,
  KEY_DEBUG = BIT(14)
}
 Enum values for the keypad buttons. More...
 

Detailed Description

common values for keypad input.

Common values that can be used on both the ARM9 and ARM7.

Macro Definition Documentation

◆ REG_KEYINPUT

#define REG_KEYINPUT   (*(vuint16 *)0x04000130)

Key input register.

On the ARM9, the hinge "button", the touch status, and the X and Y buttons cannot be accessed directly.

Enumeration Type Documentation

◆ KEYPAD_BITS

Enum values for the keypad buttons.

Enumerator
KEY_A 

Keypad A button.

KEY_B 

Keypad B button.

KEY_SELECT 

Keypad SELECT button.

KEY_START 

Keypad START button.

KEY_RIGHT 

Keypad RIGHT button.

KEY_LEFT 

Keypad LEFT button.

KEY_UP 

Keypad UP button.

KEY_DOWN 

Keypad DOWN button.

KEY_R 

Right shoulder button.

KEY_L 

Left shoulder button.

KEY_X 

Keypad X button.

KEY_Y 

Keypad Y button.

KEY_TOUCH 

Touchscreen pendown.

KEY_LID 

Lid state.

KEY_DEBUG 

Debug button.