Cocos2d-x  v4
EventKeyboard Class Reference

Keyboard event. More...

Inherits Event.

Public Types

enum  KeyCode
 KeyCode The key (code). More...
 
- Public Types inherited from Event
enum  Type
 Type Event type.
 

Public Member Functions

 EventKeyboard (KeyCode keyCode, bool isPressed)
 Constructor. More...
 
- Public Member Functions inherited from Event
virtual ~Event ()
 Destructor.
 
Type getType () const
 Gets the event type. More...
 
void stopPropagation ()
 Stops propagation for current event.
 
bool isStopped () const
 Checks whether the event has been stopped. More...
 
NodegetCurrentTarget ()
 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...
 

Additional Inherited Members

- Public Attributes inherited from Ref
unsigned int _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 
void * _scriptObject
 scriptObject, support for swift
 
bool _rooted
 When true, it means that the object was already rooted.
 
- Protected Member Functions inherited from Event
 Event (Type type)
 Constructor.
 

Detailed Description

Keyboard event.

Member Enumeration Documentation

◆ KeyCode

enum KeyCode
strong

KeyCode The key (code).

@js NA

Constructor & Destructor Documentation

◆ EventKeyboard()

EventKeyboard ( KeyCode  keyCode,
bool  isPressed 
)

Constructor.

Parameters
keyCodeA given keycode.
isPressedTrue if the key is pressed. @js ctor

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