pcl::visualization::KeyboardEvent Class Reference

/brief Class representing key hit/release events More...

`#include <pcl/visualization/keyboard_event.h>`

## Public Member Functions

| KeyboardEvent (bool action, const std::string &key_sym, unsigned char key, bool alt, bool ctrl, bool shift)
| Constructor. More...
bool | isAltPressed () const
bool | isCtrlPressed () const
bool | isShiftPressed () const
unsigned char | getKeyCode () const
const std::string & | getKeySym () const
bool | keyDown () const
bool | keyUp () const

## Static Public Attributes

static const unsigned int | Alt = 1
| bit patter for the ALT key More...
static const unsigned int | Ctrl = 2
| bit patter for the Control key More...
static const unsigned int | Shift = 4
| bit patter for the Shift key More...

## Protected Attributes

bool | action_
unsigned int | modifiers_
unsigned char | key_code_
std::string | key_sym_

## Detailed Description

/brief Class representing key hit/release events

Definition at line 49 of file keyboard_event.h.

## Constructor & Destructor Documentation

pcl::visualization::KeyboardEvent::KeyboardEvent | ( | bool | action,
|  | const std::string & | key_sym,
|  | unsigned char | key,
|  | bool | alt,
|  | bool | ctrl,
|  | bool | shift
| ) |  |

inline

Constructor.

Parameters

  [in] | action | true for key was pressed, false for released
  [in] | key_sym | the key-name that caused the action
  [in] | key | the key code that caused the action
  [in] | alt | whether the alt key was pressed at the time where this event was triggered
  [in] | ctrl | whether the ctrl was pressed at the time where this event was triggered
  [in] | shift | whether the shift was pressed at the time where this event was triggered

Definition at line 120 of file keyboard_event.h.

References Alt, Ctrl, modifiers_, and Shift.

## Member Function Documentation

unsigned char pcl::visualization::KeyboardEvent::getKeyCode | ( |  | ) | const

inline

Returns
  the ASCII Code of the key that caused the event. If 0, then it was a special key, like ALT, F1, F2,... PgUp etc. Then the name of the key is in the keysym field.

Definition at line 156 of file keyboard_event.h.

References key_code_.

const std::string & pcl::visualization::KeyboardEvent::getKeySym | ( |  | ) | const

inline

Returns
  name of the key that caused the event

Definition at line 162 of file keyboard_event.h.

References key_sym_.

bool pcl::visualization::KeyboardEvent::isAltPressed | ( |  | ) | const

inline

Returns
  whether the alt key was pressed at the time where this event was triggered

Definition at line 138 of file keyboard_event.h.

References Alt, and modifiers_.

bool pcl::visualization::KeyboardEvent::isCtrlPressed | ( |  | ) | const

inline

Returns
  whether the ctrl was pressed at the time where this event was triggered

Definition at line 144 of file keyboard_event.h.

References Ctrl, and modifiers_.

bool pcl::visualization::KeyboardEvent::isShiftPressed | ( |  | ) | const

inline

Returns
  whether the shift was pressed at the time where this event was triggered

Definition at line 150 of file keyboard_event.h.

References modifiers_, and Shift.

bool pcl::visualization::KeyboardEvent::keyDown | ( |  | ) | const

inline

Returns
  true if a key-press caused the event, false otherwise

Definition at line 168 of file keyboard_event.h.

References action_.

bool pcl::visualization::KeyboardEvent::keyUp | ( |  | ) | const

inline

Returns
  true if a key-release caused the event, false otherwise

Definition at line 174 of file keyboard_event.h.

References action_.

## Member Data Documentation

bool pcl::visualization::KeyboardEvent::action_

protected

Definition at line 114 of file keyboard_event.h.

Referenced by keyDown(), and keyUp().

const unsigned int pcl::visualization::KeyboardEvent::Alt = 1

static

bit patter for the ALT key

Definition at line 53 of file keyboard_event.h.

Referenced by isAltPressed(), KeyboardEvent(), and pcl::visualization::MouseEvent::MouseEvent().

const unsigned int pcl::visualization::KeyboardEvent::Ctrl = 2

static

bit patter for the Control key

Definition at line 55 of file keyboard_event.h.

Referenced by isCtrlPressed(), KeyboardEvent(), and pcl::visualization::MouseEvent::MouseEvent().

unsigned char pcl::visualization::KeyboardEvent::key_code_

protected

Definition at line 116 of file keyboard_event.h.

Referenced by getKeyCode().

std::string pcl::visualization::KeyboardEvent::key_sym_

protected

Definition at line 117 of file keyboard_event.h.

Referenced by getKeySym().

unsigned int pcl::visualization::KeyboardEvent::modifiers_

protected

Definition at line 115 of file keyboard_event.h.

Referenced by isAltPressed(), isCtrlPressed(), isShiftPressed(), and KeyboardEvent().

const unsigned int pcl::visualization::KeyboardEvent::Shift = 4

static

bit patter for the Shift key

Definition at line 57 of file keyboard_event.h.

Referenced by isShiftPressed(), KeyboardEvent(), and pcl::visualization::MouseEvent::MouseEvent().

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

- /build/pcl-6_P28C/pcl-1.7.2/visualization/include/pcl/visualization/keyboard_event.h