#include <GizmoLinuxInputDevice.hpp>
Public Member Functions | |
bool | createEventPress (int Type, int Code) |
Write a "press" event to the device (two events, with value 1, then 0). | |
bool | createEventPressMod (int Type, int Code, boost::python::object Modifiers) |
Write event to the device with modifiers. | |
bool | createEventRaw (int Type, int Code, int Value) |
Write event to the device. | |
bool | createEvents (int Type, int Code, int Value, int NumWrites) |
Write multiple similar events to the device. | |
bool | getSendNullEvents () const |
Get whether or not the Gizmo sends NULL events. | |
bool | grabExclusiveAccess (bool Grab) |
Grab a device for exlusive access (or ungrab). | |
bool | processEvent () |
Should we process the event based on the minimum time between events? | |
bool | remapKey (int CurCode, int NewCode) |
Remap a key on the input device. | |
void | setMinimumTimeBetweenEvents (float Seconds) |
Remap a key on the device. | |
void | setSendNullEvents (bool SendNull) |
Set whether or not the Gizmo sends NULL events. | |
GizmoLinuxInputDevice () | |
Serialize Constructor. | |
GizmoLinuxInputDevice (const H::DeviceInfo &DeviceInfo) | |
Default Constructor. | |
virtual | ~GizmoLinuxInputDevice () |
Destructor. | |
Static Public Member Functions | |
static void | buildInputEventsVectorFromBuffer (std::vector< struct input_event > &EventVector, H::DynamicBuffer< char > const &Buffer) |
Build an event list from a read buffer. | |
Protected Attributes | |
H::DeviceInfo | mDeviceInfo |
Info about the device. | |
unsigned long | mLastEventTime |
Time of last event. | |
unsigned long | mMinTimeBetweenEvents |
Minimum time between events (smooth out trigger happy controllers). | |
bool | mSendNullEvents |
Send NULL events if the device creates them? | |
Friends | |
class | boost::serialization::access |
Definition at line 64 of file GizmoLinuxInputDevice.hpp.
GizmoLinuxInputDevice::GizmoLinuxInputDevice | ( | ) |
Serialize Constructor.
GizmoLinuxInputDevice Serialize Constructor.
Definition at line 69 of file GizmoLinuxInputDevice.cpp.
References mLastEventTime, mMinTimeBetweenEvents, and mSendNullEvents.
GizmoLinuxInputDevice::GizmoLinuxInputDevice | ( | const H::DeviceInfo & | DeviceInfo | ) |
Default Constructor.
GizmoLinuxInputDevice Default Constructor.
Definition at line 59 of file GizmoLinuxInputDevice.cpp.
References mDeviceInfo, mLastEventTime, mMinTimeBetweenEvents, and mSendNullEvents.
GizmoLinuxInputDevice::~GizmoLinuxInputDevice | ( | ) | [virtual] |
Destructor.
GizmoLinuxInputDevice Destructor.
Definition at line 78 of file GizmoLinuxInputDevice.cpp.
bool GizmoLinuxInputDevice::createEventPress | ( | int | Type, | |
int | Code | |||
) |
Write a "press" event to the device (two events, with value 1, then 0).
Create a key press event on the device.
Type | GizmoEventType of the event | |
Code | GizmoKey (or other code) of the event |
This creates two events, to simulate a key press First send event with value 1, then value 0
Note: This is available in Python as createEvent as well as createEventPress
Definition at line 133 of file GizmoLinuxInputDevice.cpp.
References createEventRaw().
bool GizmoLinuxInputDevice::createEventPressMod | ( | int | Type, | |
int | Code, | |||
boost::python::object | Modifiers | |||
) |
Write event to the device with modifiers.
Create a key press event on the device plus modifiers.
Type | GizmoEventType of the event | |
Code | GizmoKey (or other code) of the event | |
Modifiers | List of modifiers |
Send modifiers with value 1, then send event with value 1, then value 0, then send modifiers with value 0
Note: This is available in Python as createEvent as well as createEventPress, and createEventPressMod
Definition at line 157 of file GizmoLinuxInputDevice.cpp.
References createEventRaw().
bool GizmoLinuxInputDevice::createEventRaw | ( | int | Type, | |
int | Code, | |||
int | Value | |||
) |
Write event to the device.
Create an event on the device.
Type | GizmoEventType of the event | |
Code | GizmoKey (or other code) of the event | |
Value | Value of the event |
The Value field can mean many things, however for key press events a Value of 1 means turn the key "on", and 0 means turn the key "off"
Note: Writes the event, and a NULL event to signal a refresh
Definition at line 108 of file GizmoLinuxInputDevice.cpp.
References H::DeviceInfo::FileDescriptor, and mDeviceInfo.
Referenced by createEventPress(), and createEventPressMod().
bool GizmoLinuxInputDevice::createEvents | ( | int | Type, | |
int | Code, | |||
int | Value, | |||
int | NumWrites | |||
) |
Write multiple similar events to the device.
Create multiple events on the device.
Type | GizmoEventType of the event | |
Code | GizmoKey (or other code) of the event | |
Value | Value of the event | |
NumWrites | Number of time to write the event (default == 1) |
The Value field can mean many things, however for key press events a Value of 1 means turn the key "on", and 0 means turn the key "off"
Note: Writes the events, then a NULL event to signal a refresh
Definition at line 189 of file GizmoLinuxInputDevice.cpp.
References H::DeviceInfo::FileDescriptor, and mDeviceInfo.
bool GizmoLinuxInputDevice::getSendNullEvents | ( | ) | const |
Get whether or not the Gizmo sends NULL events.
Definition at line 208 of file GizmoLinuxInputDevice.cpp.
References mSendNullEvents.
bool GizmoLinuxInputDevice::grabExclusiveAccess | ( | bool | Grab | ) |
Grab a device for exlusive access (or ungrab).
Set a device's exlusive access property.
Grab | Enable exlusive access if Grab is true |
Definition at line 222 of file GizmoLinuxInputDevice.cpp.
References cdbg, H::DeviceInfo::DeviceName, H::DeviceInfo::FileDescriptor, and mDeviceInfo.
bool GizmoLinuxInputDevice::processEvent | ( | ) |
Should we process the event based on the minimum time between events?
Definition at line 236 of file GizmoLinuxInputDevice.cpp.
References mLastEventTime, and mMinTimeBetweenEvents.
Referenced by Gizmod::GizmoStandard::processEvent(), Gizmod::GizmoPowermate::processEvent(), and Gizmod::GizmoATIX10::processEvent().
bool GizmoLinuxInputDevice::remapKey | ( | int | CurCode, | |
int | NewCode | |||
) |
Remap a key on the input device.
CurCode | Key to change the mapping of | |
NewCode | New code of the key |
Definition at line 249 of file GizmoLinuxInputDevice.cpp.
References cdbg, H::DeviceInfo::DeviceName, H::DeviceInfo::FileDescriptor, and mDeviceInfo.
void GizmoLinuxInputDevice::setMinimumTimeBetweenEvents | ( | float | Seconds | ) |
Remap a key on the device.
Set the minimum time between events.
Set the minimum time between events
Seconds | The time in seconds |
Definition at line 269 of file GizmoLinuxInputDevice.cpp.
References mMinTimeBetweenEvents.
Referenced by Gizmod::GizmoATIX10::GizmoATIX10().
void GizmoLinuxInputDevice::setSendNullEvents | ( | bool | SendNull | ) |
Set whether or not the Gizmo sends NULL events.
SendNull | Set to true if the device should send NULL events |
Definition at line 277 of file GizmoLinuxInputDevice.cpp.
References mSendNullEvents.
void GizmoLinuxInputDevice::buildInputEventsVectorFromBuffer | ( | std::vector< struct input_event > & | EventVector, | |
H::DynamicBuffer< char > const & | Buffer | |||
) | [static] |
Build an event list from a read buffer.
Build an event vector from a read buffer.
EventVector | Reference to a vector which will contain the results | |
Buffer | The bufer to convert into events |
Definition at line 90 of file GizmoLinuxInputDevice.cpp.
Referenced by Gizmod::GizmoEventStandard::buildEventsVectorFromBuffer(), Gizmod::GizmoEventPowermate::buildEventsVectorFromBuffer(), and Gizmod::GizmoEventATIX10::buildEventsVectorFromBuffer().