Laxkit  0.0.7.1
Public Member Functions | Public Attributes
Laxkit::LaxDevice Class Reference

Class to hold info about various input devices. More...

Inheritance diagram for Laxkit::LaxDevice:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual const charDeviceName ()
 Default is just to return name.
virtual const charDeviceType ()
 Default just returns NULL.
virtual int GetKey (int k)
 -1 returns number of buttons. Otherwise check status of that button number: return 1=on, 0=off.
virtual int GetButton (int b)
 -1 returns number of buttons. Otherwise check status of that button number: return 1=on, 0=off.
virtual double GetValue (int v, int w)
 -1 returns number of valuators. Otherwise check information of that valuator.
virtual int numFields ()
virtual int getFieldTypeInfo (int f, const char **nme, int *type, int *min, int *max, int *res)
 Retrieve device field info.
virtual int usesX ()
 Return nonzero if the device gets messages through X.
virtual int fd ()
virtual EventDatagetEvents ()
 Return an event stream if any events pending.
virtual int eventFilter (EventData **events_ret, XEvent *xev, anXWindow *target, int &isinput)
 Turn an XEvent into EventData object(s).
virtual int selectForWindow (anXWindow *win, unsigned long)
 Called after anXWindow::xlib_window exists, this sets up anything specific so the window gets related events.
virtual int clearReceiver (EventReceiver *receiver)
 Remove all reference to receiver.
virtual ~LaxDevice ()
 Empty virtual destructor.
virtual const charName (const char *nname)
 Name the device.

Public Attributes

int id
int subid
XID xid
charname
int active
int screen
int input_head
int input_group
int input_source

Detailed Description

Class to hold info about various input devices.

These might be knobs, midi devices, or perhaps wiimotes.

Todo:
maybe have default device objects for LaxMouse, LaxKeyboard, Touchpad, MultiTouchPad, Midi, Wiimote

Member Function Documentation

int Laxkit::LaxDevice::clearReceiver ( EventReceiver receiver)
virtual

Remove all reference to receiver.

Return 0 for successful clearing, or nonzero for error or not found.

Reimplemented in Laxkit::LaxKeyboard, and Laxkit::LaxMouse.

int Laxkit::LaxDevice::eventFilter ( EventData **  events_ret,
XEvent *  xev,
anXWindow target,
int isinput 
)
virtual

Turn an XEvent into EventData object(s).

Return 1 if event is absorbed, and nothing else should try to parse it. Use the returned EventDatas instead. Return 0 if event is ignored.

Reimplemented in Laxkit::CoreXlibKeyboard, and Laxkit::CoreXlibPointer.

Referenced by Laxkit::DeviceManager::eventFilter().

int Laxkit::LaxDevice::getFieldTypeInfo ( int  f,
const char **  nme,
int type,
int min,
int max,
int res 
)
virtual

Retrieve device field info.

nme is a name describing the field, such as "Keys", "Buttons", or "Pressure".

Type can be 0 for key, 1 for button, 2 for value.

For keys, min and max are the min and max keycodes.*** really? For buttons, min is 0, and max is the number of buttons available. For values, returns the minimum value, maximum value, and resolution of the value.

Return 0 for successful return of info, else 1 for info not available.

double Laxkit::LaxDevice::GetValue ( int  v,
int  w 
)
virtual

-1 returns number of valuators. Otherwise check information of that valuator.

w=0,1,2=value, min, max

int Laxkit::LaxDevice::numFields ( )
virtual

Return -2 if unititialized, -1 field type info not available

int Laxkit::LaxDevice::selectForWindow ( anXWindow win,
unsigned  long 
)
virtual

Called after anXWindow::xlib_window exists, this sets up anything specific so the window gets related events.

Return 0 for successful selection, nonzero for nothing done.

Reimplemented in Laxkit::CoreXlibKeyboard, and Laxkit::CoreXlibPointer.

Referenced by Laxkit::DeviceManager::selectForWindow().


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

Mon Feb 17 2014 11:52:59, Laxkit