EVDEV (was: RE: [AD] fbcon directcolor modes patch, and possible other patches)

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Hi,

> Btw, I'm pretty sure using /dev/input/mice or /dev/input/mouse? is
wrong
> for the evdev driver.  Only the /dev/input/event? devices use the
event
> protocol.

I just discovered that too :)

The attached patch [init.diff] should be applied above the previous
(mickeys)
one.  But I expect it to apply correctly to stock Allegro too.

It fixes the incorrect device names.  Also, the driver now tests if the
device
is a mouse by asking if it generates BTN_MOUSE events (see new function
has_event).  And it gets the number of buttons from the device (see new
function get_num_buttons).



To fix the tablet mouse moving too quickly, I have added a configuration
entry
(ev_abs_to_rel_[xyz]).  This is different from mouse_set_speed values,
because
it is dependent on the hardware, not on the application.  This also fix
the
parkinsonian behavior of the tablet mouse.

I also fixed the fact that mouse_position didn't work for tablet mice.

The attached patch [tablet.diff] should be applied above the 2 previous
ones.
I expect it to apply correctly if init.diff wasn't applied.



A note about joysticks:  It should possible to use a joystick or a
gamepad as a
mouse, by adding a few lines to the lmseev driver.  If someone has a
joystick
or gamepad and wants to try that, they can add some of the BTN_* (from
/usr/include/linux/input.h) to 'process_key' and some of the ABS_* to
`process_abs'.  They will also have to specify "mouse_device" in
allegro.cfg to
point to the /dev/input/event<number> for the joystick/gamepad.  The
changes
should be very easy, such as:
        case BTN_LEFT:
        case BTN_TOUCH:
        case BTN_JOYSTICK: // added line
           button_left = !!event->value;
           break;

-- 
Annie


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

Attachment: tablet.diff
Description: tablet.diff

Attachment: init.diff
Description: init.diff



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/