cocos2d-x  3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
EventKeyboard Class Reference

Keyboard event. More...

#include <CCEventKeyboard.h>

Inheritance diagram for EventKeyboard:
Event Ref

Public Types

enum  KeyCode {
  KEY_NONE, KEY_PAUSE, KEY_SCROLL_LOCK, KEY_PRINT,
  KEY_SYSREQ, KEY_BREAK, KEY_ESCAPE, KEY_BACK = KEY_ESCAPE,
  KEY_BACKSPACE, KEY_TAB, KEY_BACK_TAB, KEY_RETURN,
  KEY_CAPS_LOCK, KEY_SHIFT, KEY_LEFT_SHIFT = KEY_SHIFT, KEY_RIGHT_SHIFT,
  KEY_CTRL, KEY_LEFT_CTRL = KEY_CTRL, KEY_RIGHT_CTRL, KEY_ALT,
  KEY_LEFT_ALT = KEY_ALT, KEY_RIGHT_ALT, KEY_MENU, KEY_HYPER,
  KEY_INSERT, KEY_HOME, KEY_PG_UP, KEY_DELETE,
  KEY_END, KEY_PG_DOWN, KEY_LEFT_ARROW, KEY_RIGHT_ARROW,
  KEY_UP_ARROW, KEY_DOWN_ARROW, KEY_NUM_LOCK, KEY_KP_PLUS,
  KEY_KP_MINUS, KEY_KP_MULTIPLY, KEY_KP_DIVIDE, KEY_KP_ENTER,
  KEY_KP_HOME, KEY_KP_UP, KEY_KP_PG_UP, KEY_KP_LEFT,
  KEY_KP_FIVE, KEY_KP_RIGHT, KEY_KP_END, KEY_KP_DOWN,
  KEY_KP_PG_DOWN, KEY_KP_INSERT, KEY_KP_DELETE, KEY_F1,
  KEY_F2, KEY_F3, KEY_F4, KEY_F5,
  KEY_F6, KEY_F7, KEY_F8, KEY_F9,
  KEY_F10, KEY_F11, KEY_F12, KEY_SPACE,
  KEY_EXCLAM, KEY_QUOTE, KEY_NUMBER, KEY_DOLLAR,
  KEY_PERCENT, KEY_CIRCUMFLEX, KEY_AMPERSAND, KEY_APOSTROPHE,
  KEY_LEFT_PARENTHESIS, KEY_RIGHT_PARENTHESIS, KEY_ASTERISK, KEY_PLUS,
  KEY_COMMA, KEY_MINUS, KEY_PERIOD, KEY_SLASH,
  KEY_0, KEY_1, KEY_2, KEY_3,
  KEY_4, KEY_5, KEY_6, KEY_7,
  KEY_8, KEY_9, KEY_COLON, KEY_SEMICOLON,
  KEY_LESS_THAN, KEY_EQUAL, KEY_GREATER_THAN, KEY_QUESTION,
  KEY_AT, KEY_CAPITAL_A, KEY_CAPITAL_B, KEY_CAPITAL_C,
  KEY_CAPITAL_D, KEY_CAPITAL_E, KEY_CAPITAL_F, KEY_CAPITAL_G,
  KEY_CAPITAL_H, KEY_CAPITAL_I, KEY_CAPITAL_J, KEY_CAPITAL_K,
  KEY_CAPITAL_L, KEY_CAPITAL_M, KEY_CAPITAL_N, KEY_CAPITAL_O,
  KEY_CAPITAL_P, KEY_CAPITAL_Q, KEY_CAPITAL_R, KEY_CAPITAL_S,
  KEY_CAPITAL_T, KEY_CAPITAL_U, KEY_CAPITAL_V, KEY_CAPITAL_W,
  KEY_CAPITAL_X, KEY_CAPITAL_Y, KEY_CAPITAL_Z, KEY_LEFT_BRACKET,
  KEY_BACK_SLASH, KEY_RIGHT_BRACKET, KEY_UNDERSCORE, KEY_GRAVE,
  KEY_A, KEY_B, KEY_C, KEY_D,
  KEY_E, KEY_F, KEY_G, KEY_H,
  KEY_I, KEY_J, KEY_K, KEY_L,
  KEY_M, KEY_N, KEY_O, KEY_P,
  KEY_Q, KEY_R, KEY_S, KEY_T,
  KEY_U, KEY_V, KEY_W, KEY_X,
  KEY_Y, KEY_Z, KEY_LEFT_BRACE, KEY_BAR,
  KEY_RIGHT_BRACE, KEY_TILDE, KEY_EURO, KEY_POUND,
  KEY_YEN, KEY_MIDDLE_DOT, KEY_SEARCH, KEY_DPAD_LEFT,
  KEY_DPAD_RIGHT, KEY_DPAD_UP, KEY_DPAD_DOWN, KEY_DPAD_CENTER,
  KEY_ENTER, KEY_PLAY
}
 KeyCode The key (code). More...
 
- Public Types inherited from Event
enum  Type {
  TOUCH, KEYBOARD, ACCELERATION, MOUSE,
  FOCUS, GAME_CONTROLLER, CUSTOM
}
 Type Event type. More...
 

Public Member Functions

 EventKeyboard (KeyCode keyCode, bool isPressed)
 Constructor. More...
 
- Public Member Functions inherited from Event
virtual ~Event ()
 Destructor. More...
 
var ~Event ()
 Destructor. More...
 
local ~Event ()
 Destructor. More...
 
Type getType () const
 Gets the event type. More...
 
var getType ()
 Gets the event type. More...
 
local getType ()
 Gets the event type. More...
 
void stopPropagation ()
 Stops propagation for current event. More...
 
var stopPropagation ()
 Stops propagation for current event. More...
 
local stopPropagation ()
 Stops propagation for current event. More...
 
bool isStopped () const
 Checks whether the event has been stopped. More...
 
NodegetCurrentTarget ()
 Gets current target of the event. More...
 
var getCurrentTarget ()
 Gets current target of the event. More...
 
local getCurrentTarget ()
 Gets current target of the event. More...
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor. More...
 

Friends

class EventListenerKeyboard

Additional Inherited Members

- Public Attributes inherited from Event
CC_CONSTRUCTOR_ACCESS __pad0__: Event(Type type)
var __pad0__: Event(Type type)
local __pad0__: Event(Type type)
- Protected Member Functions inherited from Event
void setCurrentTarget (Node *target)
 Sets current target. More...
 
var setCurrentTarget ( var target)
 Sets current target. More...
 
local setCurrentTarget ( local target)
 Sets current target. More...
 
- Protected Member Functions inherited from Ref
 Ref ()
 Constructor. More...
 
 Ref ()
 Constructor. More...
 
- Protected Attributes inherited from Event
Type _type
 Event type. More...
 
bool _isStopped
 whether the event has been stopped. More...
 
var _isStopped
 whether the event has been stopped. More...
 
local _isStopped
 whether the event has been stopped. More...
 
Node_currentTarget
 Current target. More...
 
var _currentTarget
 Current target. More...
 
local _currentTarget
 Current target. More...
 
- Protected Attributes inherited from Ref
unsigned int _referenceCount
 count of references More...
 
local _referenceCount
 count of references More...
 

Detailed Description

Keyboard event.

Constructor & Destructor Documentation

EventKeyboard ( KeyCode  keyCode,
bool  isPressed 
)

Constructor.

Parameters
keyCodeA given keycode.
isPressedTrue if the key is pressed.
var ctor ( var  keyCode,
var  isPressed 
)

Constructor.

Parameters
keyCodeA given keycode.
isPressedTrue if the key is pressed.
local EventKeyboard ( local  keyCode,
local  isPressed 
)

Constructor.

Parameters
keyCodeA given keycode.
isPressedTrue if the key is pressed.

Friends And Related Function Documentation

friend class EventListenerKeyboard
friend
local EventListenerKeyboard
friend

The documentation for this class was generated from the following file: