casa
$Rev:20696$
|
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 vector< Modifier > &mods) | |
Constructor that takes the originating canvas, the key pressed, and any modifiers. | |
~PlotKeyEvent () | |
Destructor. | |
void * | origin () const |
Overrides PlotEvent::origin(). | |
PlotCanvas * | canvas () const |
Returns the originating canvas. | |
char | key () const |
Returns the pressed character key. | |
vector< Modifier > | modifiers () const |
Returns the key modifiers. | |
String | toString () const |
Returns a String representation of this key event. | |
Static Public Member Functions | |
static String | modifier (Modifier f) |
Converts between KeyModifier and its String representation. | |
static Modifier | modifier (String f) |
Protected Attributes | |
PlotCanvas * | m_canvas |
char | m_key |
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 218 of file PlotEvent.h.
Modifier for a key press.
Definition at line 221 of file PlotEvent.h.
casa::PlotKeyEvent::PlotKeyEvent | ( | PlotCanvas * | canvas, |
char | key, | ||
const vector< Modifier > & | mods | ||
) |
Constructor that takes the originating canvas, the key pressed, and any modifiers.
Destructor.
PlotCanvas* casa::PlotKeyEvent::canvas | ( | ) | const |
Returns the originating canvas.
Referenced by origin().
char casa::PlotKeyEvent::key | ( | ) | const |
Returns the pressed character key.
static String casa::PlotKeyEvent::modifier | ( | Modifier | f | ) | [inline, static] |
static Modifier casa::PlotKeyEvent::modifier | ( | String | f | ) | [inline, static] |
Definition at line 260 of file PlotEvent.h.
References ALT, CONTROL, casa::String::downcase(), F, and SHIFT.
vector<Modifier> casa::PlotKeyEvent::modifiers | ( | ) | const |
Returns the key modifiers.
void* casa::PlotKeyEvent::origin | ( | ) | const [inline, virtual] |
Overrides PlotEvent::origin().
Implements casa::PlotEvent.
Definition at line 233 of file PlotEvent.h.
References canvas().
String casa::PlotKeyEvent::toString | ( | ) | const |
Returns a String representation of this key event.
PlotCanvas* casa::PlotKeyEvent::m_canvas [protected] |
Definition at line 273 of file PlotEvent.h.
char casa::PlotKeyEvent::m_key [protected] |
Definition at line 274 of file PlotEvent.h.
vector<Modifier> casa::PlotKeyEvent::m_mods [protected] |
Definition at line 275 of file PlotEvent.h.