#include <SimInput.h>
Inheritance diagram for gadget::SimInput:


Public Methods | |
| SimInput () | |
| virtual | ~SimInput () |
| virtual bool | config (jccl::ConfigElementPtr element) |
| Configures the keyboard interface. More... | |
| virtual std::string | getBaseType () |
| virtual vpr::ReturnStatus | writeObject (vpr::ObjectWriter *writer) |
| virtual vpr::ReturnStatus | readObject (vpr::ObjectReader *reader) |
Protected Methods | |
| virtual int | checkKeyPair (KeyModPair &pair) |
| Checks the given keypair. More... | |
| virtual int | checkKey (gadget::Keys keyId) |
| Gets number of times the key was pressed. More... | |
| std::vector< KeyModPair > | readKeyList (std::vector< jccl::ConfigElementPtr > &keyList) |
| Constructs the mod pair from a mod pair element. More... | |
Protected Attributes | |
| EventWindowInterface | mEventWin |
| The event window from which we receive events. More... | |
Has the common routines for accessing and seting up keyboard interface.
Definition at line 54 of file SimInput.h.
|
|
Definition at line 90 of file SimInput.h.
00091 {
00092 //vprDEBUG(vprDBG_ALL, vprDBG_VERB_LVL)<<"*** SimInput::SimInput()\n"<< vprDEBUG_FLUSH;
00093 }
|
|
|
Definition at line 94 of file SimInput.h.
00094 {}
|
|
|
Configures the keyboard interface.
Reimplemented in gadget::SimGloveGesture. Definition at line 70 of file SimInput.cpp. References mEventWin.
00071 {
00072 // Get the event source.
00073 mEventWin.init(element->getProperty<std::string>("event_window_proxy"));
00074
00075 return true;
00076 }
|
|
|
Definition at line 102 of file SimInput.h.
00103 {
00104 return std::string("SimInput");
00105 }
|
|
|
Definition at line 107 of file SimInput.h.
00108 {
00109 boost::ignore_unused_variable_warning(writer);
00110 return vpr::ReturnStatus::Succeed;
00111 }
|
|
|
Definition at line 113 of file SimInput.h.
00114 {
00115 boost::ignore_unused_variable_warning(reader);
00116 return vpr::ReturnStatus::Succeed;
00117 }
|
|
|
Checks the given keypair.
Definition at line 78 of file SimInput.cpp. References mEventWin.
00079 {
00080 if (pair.mModifier == -1) // ANY modifier
00081 {
00082 return mEventWin->keyPressed(pair.mKey);
00083 }
00084 if (mEventWin->modifierOnly(pair.mModifier))
00085 {
00086 return mEventWin->keyPressed(pair.mKey);
00087 }
00088 else // Mod not pressed
00089 {
00090 return 0;
00091 }
00092 }
|
|
|
Gets number of times the key was pressed.
Definition at line 94 of file SimInput.cpp. References mEventWin.
00095 {
00096 return mEventWin->keyPressed(keyId);
00097 }
|
|
|
Constructs the mod pair from a mod pair element. Takes as input a element that has a list of KeyModPair child elements.
Definition at line 42 of file SimInput.cpp. Referenced by gadget::SimGloveGesture::config.
00043 {
00044 std::vector<KeyModPair> key_vec;
00045
00046 if ( ! keyList.empty() )
00047 {
00048 #ifdef GADGET_DEBUG
00049 jccl::ConfigElementPtr first_element = keyList[0];
00050 std::string element_type(first_element->getID());
00051 vprASSERT(element_type == std::string("key_modifier_pair"));
00052 #endif
00053
00054 for ( std::vector<jccl::ConfigElementPtr>::iterator i = keyList.begin();
00055 i != keyList.end();
00056 ++i )
00057 {
00058 key_vec.push_back(KeyModPair((gadget::Keys) (*i)->getProperty<int>("key"),
00059 (gadget::Keys) (*i)->getProperty<int>("modifier_key")));
00060 }
00061 }
00062
00063 return key_vec;
00064 }
|
|
|
The event window from which we receive events.
Definition at line 147 of file SimInput.h. Referenced by checkKey, checkKeyPair, and config. |
1.2.14 written by Dimitri van Heesch,
© 1997-2002