Point Cloud Library (PCL)  1.14.1-dev
List of all members | Public Member Functions | Static Public Attributes | Protected Attributes
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 pattern for the ALT key More...
 
static const unsigned int Ctrl = 2
 bit pattern for the Control key More...
 
static const unsigned int Shift = 4
 bit pattern for the Shift key More...
 

Protected Attributes

bool action_
 
unsigned int modifiers_ {0}
 
unsigned char key_code_
 
std::string key_sym_
 

Detailed Description

/brief Class representing key hit/release events

Definition at line 48 of file keyboard_event.h.

Constructor & Destructor Documentation

◆ KeyboardEvent()

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

Constructor.

Parameters
[in]actiontrue for key was pressed, false for released
[in]key_symthe key-name that caused the action
[in]keythe key code that caused the action
[in]altwhether the alt key was pressed at the time where this event was triggered
[in]ctrlwhether the ctrl was pressed at the time where this event was triggered
[in]shiftwhether the shift was pressed at the time where this event was triggered

Definition at line 119 of file keyboard_event.h.

References Alt, Ctrl, modifiers_, and Shift.

Member Function Documentation

◆ getKeyCode()

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 155 of file keyboard_event.h.

References key_code_.

◆ getKeySym()

const std::string & pcl::visualization::KeyboardEvent::getKeySym ( ) const
inline
Returns
name of the key that caused the event

Definition at line 161 of file keyboard_event.h.

References key_sym_.

◆ isAltPressed()

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 137 of file keyboard_event.h.

References Alt, and modifiers_.

◆ isCtrlPressed()

bool pcl::visualization::KeyboardEvent::isCtrlPressed ( ) const
inline
Returns
whether the ctrl was pressed at the time where this event was triggered

Definition at line 143 of file keyboard_event.h.

References Ctrl, and modifiers_.

◆ isShiftPressed()

bool pcl::visualization::KeyboardEvent::isShiftPressed ( ) const
inline
Returns
whether the shift was pressed at the time where this event was triggered

Definition at line 149 of file keyboard_event.h.

References modifiers_, and Shift.

◆ keyDown()

bool pcl::visualization::KeyboardEvent::keyDown ( ) const
inline
Returns
true if a key-press caused the event, false otherwise

Definition at line 167 of file keyboard_event.h.

References action_.

◆ keyUp()

bool pcl::visualization::KeyboardEvent::keyUp ( ) const
inline
Returns
true if a key-release caused the event, false otherwise

Definition at line 173 of file keyboard_event.h.

References action_.

Member Data Documentation

◆ action_

bool pcl::visualization::KeyboardEvent::action_
protected

Definition at line 113 of file keyboard_event.h.

Referenced by keyDown(), and keyUp().

◆ Alt

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

bit pattern for the ALT key

Definition at line 52 of file keyboard_event.h.

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

◆ Ctrl

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

bit pattern for the Control key

Definition at line 54 of file keyboard_event.h.

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

◆ key_code_

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

Definition at line 115 of file keyboard_event.h.

Referenced by getKeyCode().

◆ key_sym_

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

Definition at line 116 of file keyboard_event.h.

Referenced by getKeySym().

◆ modifiers_

unsigned int pcl::visualization::KeyboardEvent::modifiers_ {0}
protected

Definition at line 114 of file keyboard_event.h.

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

◆ Shift

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

bit pattern for the Shift key

Definition at line 56 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: