casa
5.7.0-16
|
Event for when the user makes a keyboard command when a canvas has focus. More...
#include <PlotEvent.h>
Public Types | |
enum | Modifier { CONTROL, SHIFT, ALT, F } |
Modifier for a key press. More... | |
Public Member Functions | |
PlotKeyEvent (PlotCanvas *canvas, char key, const std::vector< Modifier > &mods) | |
Constructor that takes the originating canvas, the key pressed, and any modifiers. More... | |
~PlotKeyEvent () | |
Destructor. More... | |
void * | origin () const |
Overrides PlotEvent::origin(). More... | |
PlotCanvas * | canvas () const |
Returns the originating canvas. More... | |
char | key () const |
Returns the pressed character key. More... | |
std::vector< Modifier > | modifiers () const |
Returns the key modifiers. More... | |
casacore::String | toString () const |
Returns a casacore::String representation of this key event. More... | |
Public Member Functions inherited from casa::PlotEvent | |
PlotEvent () | |
virtual | ~PlotEvent () |
Static Public Member Functions | |
static casacore::String | modifier (Modifier f) |
Converts between KeyModifier and its casacore::String representation. More... | |
static Modifier | modifier (casacore::String f) |
Protected Attributes | |
PlotCanvas * | m_canvas |
char | m_key |
std::vector< Modifier > | m_mods |
Event for when the user makes a keyboard command when a canvas has focus.
An example of a keyboard command would be "ctrl+s" or "n" or "shift+g" or "F3". Note that this event is only valid for key commands that can be represented with a char (or, in the case of the F1-F12 keys, the F modifier plus the character representation of the number).
Definition at line 216 of file PlotEvent.h.
casa::PlotKeyEvent::PlotKeyEvent | ( | PlotCanvas * | canvas, |
char | key, | ||
const std::vector< Modifier > & | mods | ||
) |
Constructor that takes the originating canvas, the key pressed, and any modifiers.
casa::PlotKeyEvent::~PlotKeyEvent | ( | ) |
Destructor.
PlotCanvas* casa::PlotKeyEvent::canvas | ( | ) | const |
Returns the originating canvas.
Referenced by origin().
char casa::PlotKeyEvent::key | ( | ) | const |
Returns the pressed character key.
|
inlinestatic |
Converts between KeyModifier and its casacore::String representation.
Definition at line 248 of file PlotEvent.h.
|
inlinestatic |
Definition at line 258 of file PlotEvent.h.
References ALT, CONTROL, casacore::String::downcase(), F, and SHIFT.
std::vector<Modifier> casa::PlotKeyEvent::modifiers | ( | ) | const |
Returns the key modifiers.
|
inlinevirtual |
Overrides PlotEvent::origin().
Implements casa::PlotEvent.
Definition at line 231 of file PlotEvent.h.
References canvas().
casacore::String casa::PlotKeyEvent::toString | ( | ) | const |
Returns a casacore::String representation of this key event.
|
protected |
Definition at line 271 of file PlotEvent.h.
|
protected |
Definition at line 272 of file PlotEvent.h.
|
protected |
Definition at line 273 of file PlotEvent.h.