- Your Widget Set For OpenGL
Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | Related Pages

ufo::UKeyEvent Class Reference

This event is used for keyboard events. More...

#include <ukeyevent.hpp>

Inheritance diagram for ufo::UKeyEvent:

ufo::UInputEvent ufo::UWidgetEvent ufo::UEvent ufo::UObject ufo::UCollectable List of all members.

Public Member Functions

 UKeyEvent (UWidget *sourceA, Type typeA, UMod_t modifiersA, UKeyCode_t keyCodeA, uint16_t keyCharA=0)
UKeyCode_t getKeyCode ()
uint16_t getKeyChar ()

Static Public Attributes

const uint16_t CHAR_UNDEFINED

Protected Member Functions

virtual std::ostream & paramString (std::ostream &os) const

Protected Attributes

UKeyCode_t m_keyCode
uint16_t m_keyChar

Detailed Description

This event is used for keyboard events.

A key event is used for indicating two types of events:

1. KeyPressed / KeyReleased Events: Generated whenever a key is pressed or release. Only with these events you can get information about keys which do not generate character output.

2. KeyTyped Events: Generated whenever a Unicode character is entered. It can be represented by a single key press (e.g. 'u'), but most of the it represents multiple key presses (like shift + 'u' which results in a Unicode character 'U'). Some Keys canīt create Unicode character (like modifiers, action keys, ..) and donīt create KEY_TYPED events. The key code (returned by getKeyCode()) of KeyTyped events return always VK_UNDEFINED. The getKeyChar() returns a valid Unicode character or CHAR_UNDEFINED.

Please note:The virtual key constants (UK_*) may change in future without any warning.

Author:
Johannes Schmidt


Member Function Documentation

uint16_t ufo::UKeyEvent::getKeyChar  ) 
 

Returns the Unicode character for this key event. If this is a KEY_PRESSED or KEY_RELEASED key event, the value will be likely a CHAR_UNDEFINED ( at least for action keys, modifiers, ..)

UKeyCode_t ufo::UKeyEvent::getKeyCode  ) 
 

Returns the virtual key code for this key event. If this is a KEY_TYPED key event, this value will be always VK_UNDEFINED, else it should contain a valid key code.

virtual std::ostream& ufo::UKeyEvent::paramString std::ostream &  os  )  const [protected, virtual]
 

Prints some useful internal data to the ostream os. This method is meant only for debugging purposes.

Reimplemented from ufo::UInputEvent.


Member Data Documentation

const uint16_t ufo::UKeyEvent::CHAR_UNDEFINED [static]
 

KEY_PRESSED and KEY_RELEASED events which do not map to a valid Unicode character use this for the keyChar value.


The documentation for this class was generated from the following file:
The libUFO Project - written by Johannes Schmidt