Gnash  0.8.11dev
Public Member Functions | Static Public Member Functions | List of all members
gnash::EventDevice Class Reference

#include <InputDevice.h>

Inheritance diagram for gnash::EventDevice:
gnash::InputDevice

Public Member Functions

 EventDevice ()
 
const char * id ()
 
virtual bool init ()
 
virtual bool init (const std::string &filespec, size_t size)
 
virtual bool check ()
 
gnash::key::code scancode_to_gnash_key (int code, bool shift)
 
- Public Member Functions inherited from gnash::InputDevice
 InputDevice ()
 
 InputDevice (int x, int y)
 
virtual ~InputDevice ()
 
bool init (devicetype_e type)
 
bool init (devicetype_e type, size_t size)
 
bool init (devicetype_e type, const std::string &filespec)
 
bool init (devicetype_e type, const std::string &filespec, size_t size)
 
InputDevice::devicetype_e getType ()
 
void setType (InputDevice::devicetype_e x)
 
std::unique_ptr< std::uint8_t[]> readData (size_t size)
 
std::shared_ptr< input_data_tpopData ()
 
void setScreenSize (int x, int y)
 
void dump () const
 

Static Public Member Functions

static std::vector< std::shared_ptr< InputDevice > > scanForDevices ()
 
- Static Public Member Functions inherited from gnash::InputDevice
static DSOEXPORT std::vector< std::shared_ptr< InputDevice > > scanForDevices ()
 
static DSOEXPORT std::unique_ptr< int[]> convertAbsCoords (int x, int y, int width, int height)
 

Additional Inherited Members

- Public Types inherited from gnash::InputDevice
enum  devicetype_e {
  UNKNOWN, KEYBOARD, UMOUSE, MOUSE,
  TABLET, TOUCHSCREEN, TOUCHMOUSE, POWERBUTTON,
  SLEEPBUTTON, SERIALUSB, INFRARED, UINPUT,
  TSLIB
}
 
- Protected Member Functions inherited from gnash::InputDevice
void addData (bool pressed, key::code key, int modifier, int x, int y)
 
- Protected Attributes inherited from gnash::InputDevice
devicetype_e _type
 
std::string _filespec
 
int _fd
 
input_data_t _input_data
 
std::unique_ptr< std::uint8_t[]> _buffer
 
std::queue< std::shared_ptr< input_data_t > > _data
 
int _screen_width
 
int _screen_height
 

Constructor & Destructor Documentation

§ EventDevice()

gnash::EventDevice::EventDevice ( )

Referenced by scanForDevices().

Member Function Documentation

§ check()

bool gnash::EventDevice::check ( )
virtual
Note
A typical touchscreen event is actually a series of events, one for each piece of data. The sequence is terminated by the EV_SYN message. An example from evtests looks like this: Event: time 697585.633672, type 3 (Absolute), code 0 (X), value 127 Event: time 697585.633679, type 3 (Absolute), code 1 (Y), value 72 Event: time 697585.633681, type 3 (Absolute), code 24 (Pressure), value 41 Event: time 697585.633684, type 1 (Key), code 330 (Touch), value 1 Event: time 697585.633686, -----------— Report Sync ---------—

Everytime we get the EV_SYN message we add this fully populated event to queue of events. As the GUI polls for events, there may be multiple events in the queue by the time the main event loop comes around to process the events.

Implements gnash::InputDevice.

References _, gnash::InputDevice::_data, gnash::InputDevice::_fd, gnash::InputDevice::_input_data, gnash::InputDevice::input_data_t::brake, gnash::InputDevice::input_data_t::button, gnash::InputDevice::input_data_t::distance, EV_SYN, gnash::InputDevice::input_data_t::gas, gnash::key::GNASH_MOD_ALT, gnash::key::GNASH_MOD_CONTROL, gnash::key::GNASH_MOD_NONE, gnash::key::GNASH_MOD_SHIFT, gnash::InputDevice::input_data_t::key, gnash::log_debug(), gnash::log_unimpl(), gnash::InputDevice::input_data_t::modifier, gnash::InputDevice::input_data_t::position, gnash::InputDevice::input_data_t::pressed, gnash::InputDevice::input_data_t::pressure, gnash::InputDevice::readData(), gnash::InputDevice::input_data_t::rudder, gnash::InputDevice::input_data_t::rx, gnash::InputDevice::input_data_t::ry, gnash::InputDevice::input_data_t::rz, scancode_to_gnash_key(), gnash::InputDevice::input_data_t::throttle, gnash::InputDevice::input_data_t::tiltX, gnash::InputDevice::input_data_t::tiltY, gnash::InputDevice::input_data_t::volumne, gnash::InputDevice::input_data_t::x, gnash::InputDevice::input_data_t::y, and gnash::InputDevice::input_data_t::z.

§ id()

const char* gnash::EventDevice::id ( )
inlinevirtual

Implements gnash::InputDevice.

§ init() [1/2]

bool gnash::EventDevice::init ( )
virtual

Reimplemented from gnash::InputDevice.

§ init() [2/2]

bool gnash::EventDevice::init ( const std::string &  filespec,
size_t  size 
)
virtual

§ scancode_to_gnash_key()

gnash::key::code gnash::EventDevice::scancode_to_gnash_key ( int  code,
bool  shift 
)

References gnash::key::_0, gnash::key::_1, gnash::key::_2, gnash::key::_3, gnash::key::_4, gnash::key::_5, gnash::key::_6, gnash::key::_7, gnash::key::_8, gnash::key::_9, gnash::key::A, gnash::key::a, gnash::key::ALT, gnash::key::AMPERSAND, gnash::key::ASTERISK, gnash::key::B, gnash::key::b, gnash::key::BACKSLASH, gnash::key::BACKSPACE, gnash::key::C, gnash::key::c, gnash::key::CAPSLOCK, gnash::key::COMMA, gnash::key::CONTROL, gnash::key::D, gnash::key::d, gnash::key::DELETEKEY, gnash::key::DOLLAR, gnash::key::DOUBLE_QUOTE, gnash::key::DOWN, gnash::key::E, gnash::key::e, gnash::key::END, gnash::key::ENTER, gnash::key::EQUALS, gnash::key::ESCAPE, gnash::key::EXCLAM, gnash::key::F, gnash::key::f, gnash::key::F1, gnash::key::F10, gnash::key::F11, gnash::key::F12, gnash::key::F2, gnash::key::F3, gnash::key::F4, gnash::key::F5, gnash::key::F6, gnash::key::F7, gnash::key::F8, gnash::key::F9, gnash::key::G, gnash::key::g, gnash::key::H, gnash::key::h, gnash::key::HASH, gnash::key::HOME, gnash::key::I, gnash::key::i, gnash::key::INSERT, gnash::key::INVALID, gnash::key::J, gnash::key::j, gnash::key::K, gnash::key::k, gnash::key::KP_0, gnash::key::KP_1, gnash::key::KP_2, gnash::key::KP_3, gnash::key::KP_4, gnash::key::KP_5, gnash::key::KP_6, gnash::key::KP_7, gnash::key::KP_8, gnash::key::KP_9, gnash::key::KP_ADD, gnash::key::KP_DECIMAL, gnash::key::KP_ENTER, gnash::key::KP_MULTIPLY, gnash::key::KP_SUBTRACT, gnash::key::L, gnash::key::l, gnash::key::LEFT, gnash::key::LEFT_BRACE, gnash::key::M, gnash::key::m, gnash::key::MINUS, gnash::key::N, gnash::key::n, gnash::key::NUM_LOCK, gnash::key::O, gnash::key::o, gnash::key::P, gnash::key::p, gnash::key::PAREN_LEFT, gnash::key::PAREN_RIGHT, gnash::key::PERCENT, gnash::key::PGDN, gnash::key::PGUP, gnash::key::Q, gnash::key::q, gnash::key::R, gnash::key::r, gnash::key::RIGHT, gnash::key::RIGHT_BRACE, gnash::key::S, gnash::key::s, gnash::key::SEMICOLON, gnash::key::SHIFT, gnash::key::SINGLE_QUOTE, gnash::key::SLASH, gnash::key::SPACE, gnash::key::T, gnash::key::t, gnash::key::TAB, gnash::key::U, gnash::key::u, gnash::key::UP, gnash::key::V, gnash::key::v, gnash::key::W, gnash::key::w, gnash::key::X, gnash::key::x, gnash::key::Y, gnash::key::y, gnash::key::Z, and gnash::key::z.

Referenced by check().

§ scanForDevices()

std::vector< std::shared_ptr< InputDevice > > gnash::EventDevice::scanForDevices ( )
static

The documentation for this class was generated from the following files: