#include <gadget/Devices/KeyboardMouseDevice/InputArea.h>
Inheritance diagram for gadget::InputArea:


Public Types | |
| enum | lockState { Unlocked, Lock_LockKey, Lock_KeyDown } |
| Enum to keep track of current lock state for state machine. More... | |
Public Member Functions | |
| InputArea () | |
| ~InputArea () | |
| bool | config (jccl::ConfigElementPtr e) |
Protected Types | |
| typedef KeyboardMouseDevice::KeyboardMouseDeviceRegistry | km_registry_t |
| Shortened form of the keyboard/mouse device registry type name. | |
Protected Attributes | |
| lockState | mLockState |
| The current state of locking. | |
| int | mLockStoredKey |
| The key that was pressed down. | |
| int | mLockToggleKey |
| The key that toggles the locking. | |
| float | mMouseSensitivity |
| int | mSleepTimeMS |
| KeyboardMouseDevice * | mKeyboardMouseDevice |
| std::string | mKeyboardMouseDeviceName |
| Name of the remote display window (index in registry). | |
| km_registry_t::KeyboardMouseDeviceInfo | mKeyboardMouseDeviceInfo |
| Info structure for remote window. | |
Definition at line 51 of file InputArea.h.
typedef KeyboardMouseDevice::KeyboardMouseDeviceRegistry gadget::InputArea::km_registry_t [protected] |
Shortened form of the keyboard/mouse device registry type name.
Definition at line 71 of file InputArea.h.
Enum to keep track of current lock state for state machine.
| Unlocked | The mouse is free. |
| Lock_LockKey | The mouse is locked due to lock toggle key press. |
| Lock_KeyDown | The mouse is locked due to a key being held down. |
Definition at line 55 of file InputArea.h.
00056 { 00057 Unlocked, 00058 Lock_LockKey, 00059 Lock_KeyDown 00060 };
| gadget::InputArea::InputArea | ( | ) |
Definition at line 46 of file InputArea.cpp.
00047 : mLockState(Unlocked) 00048 , mLockStoredKey(-1) 00049 , mLockToggleKey(-1) 00050 , mMouseSensitivity(1.0f) 00051 , mSleepTimeMS(0) 00052 , mKeyboardMouseDevice(NULL) 00053 , mKeyboardMouseDeviceName("") 00054 { 00055 /* Do nothing. */ ; 00056 }
| gadget::InputArea::~InputArea | ( | ) | [inline] |
| bool gadget::InputArea::config | ( | jccl::ConfigElementPtr | e | ) |
Reimplemented in gadget::InputWindowWin32, and gadget::InputWindowXWin.
Definition at line 58 of file InputArea.cpp.
References gadgetDBG_INPUT_MGR(), Lock_LockKey, gadget::KeyboardMouseDevice::KeyboardMouseDeviceRegistry::KeyboardMouseDeviceInfo::mKeyboardMouseDevice, mKeyboardMouseDevice, mKeyboardMouseDeviceInfo, mKeyboardMouseDeviceName, mLockState, mLockToggleKey, and mSleepTimeMS.
Referenced by gadget::InputWindowXWin::config(), and gadget::InputWindowWin32::config().
00059 { 00060 // Get the lock information 00061 mLockToggleKey = e->getProperty<int>("lock_key"); 00062 bool start_locked = e->getProperty<bool>("start_locked"); 00063 00064 if (start_locked) 00065 { 00066 mLockState = Lock_LockKey; // Initialize to the locked state 00067 } 00068 00069 mSleepTimeMS = e->getProperty<int>("sleep_time"); 00070 00071 // Sanity check. 00072 if (mSleepTimeMS == 0) 00073 { 00074 mSleepTimeMS = 50; 00075 } 00076 00077 // If we have a pointer to a window in registry, then use that 00078 mKeyboardMouseDeviceName = e->getProperty<std::string>("keyboard_mouse_device_name"); 00079 00080 km_registry_t::KeyboardMouseDeviceInfo event_source_info; 00081 bool found_window = 00082 km_registry_t::instance()->getKeyboardMouseDevice(mKeyboardMouseDeviceName, 00083 event_source_info); 00084 00085 if(!found_window) 00086 { 00087 // Use vprDBG_WARNING_LVL for input_window config elements as they are 00088 // almost certainly mis-configured without a valid value for 00089 // keyboard_mouse_device_name. 00090 int level = e->getID() == std::string("input_window") ? vprDBG_WARNING_LVL 00091 : vprDBG_STATE_LVL; 00092 00093 vprDEBUG(gadgetDBG_INPUT_MGR, level) 00094 << "WARNING: Could not find keyboard/mouse device named '" 00095 << mKeyboardMouseDeviceName << "'\n" << vprDEBUG_FLUSH; 00096 vprDEBUG_NEXT(gadgetDBG_INPUT_MGR, level) 00097 << "No InputArea will be created for window named '" 00098 << e->getName() << "'.\n" << vprDEBUG_FLUSH; 00099 return false; 00100 } 00101 else 00102 { 00103 mKeyboardMouseDeviceInfo = event_source_info; 00104 mKeyboardMouseDevice = mKeyboardMouseDeviceInfo.mKeyboardMouseDevice; 00105 } 00106 00107 return true; 00108 }
lockState gadget::InputArea::mLockState [protected] |
The current state of locking.
Definition at line 73 of file InputArea.h.
Referenced by config(), gadget::InputWindowXWin::controlLoop(), gadget::InputWindowWin32::controlLoop(), gadget::InputAreaXWin::handleEvent(), and gadget::InputAreaWin32::updKeys().
int gadget::InputArea::mLockStoredKey [protected] |
The key that was pressed down.
Definition at line 74 of file InputArea.h.
Referenced by gadget::InputAreaXWin::handleEvent(), and gadget::InputAreaWin32::updKeys().
int gadget::InputArea::mLockToggleKey [protected] |
The key that toggles the locking.
Definition at line 75 of file InputArea.h.
Referenced by config(), gadget::InputAreaXWin::handleEvent(), and gadget::InputAreaWin32::updKeys().
float gadget::InputArea::mMouseSensitivity [protected] |
Definition at line 76 of file InputArea.h.
int gadget::InputArea::mSleepTimeMS [protected] |
Definition at line 77 of file InputArea.h.
Referenced by config(), gadget::InputWindowXWin::controlLoop(), and gadget::InputWindowWin32::controlLoop().
Definition at line 79 of file InputArea.h.
Referenced by gadget::InputAreaWin32::addKeyEvent(), gadget::InputAreaWin32::addMouseButtonEvent(), gadget::InputAreaWin32::addMouseMoveEvent(), config(), gadget::InputAreaWin32::getButtonMask(), gadget::InputAreaWin32::getModifierMask(), gadget::InputAreaXWin::handleEvent(), gadget::InputAreaXWin::handleEvents(), gadget::InputAreaWin32::handleEvents(), and gadget::InputAreaWin32::updKeys().
std::string gadget::InputArea::mKeyboardMouseDeviceName [protected] |
Name of the remote display window (index in registry).
Definition at line 82 of file InputArea.h.
Referenced by config().
Info structure for remote window.
Definition at line 85 of file InputArea.h.
Referenced by config().
1.5.1