QtMoko v18 - based on 2.6.32

Neil Brown neilb at suse.de
Mon Mar 8 21:47:23 CET 2010


On Mon, 8 Mar 2010 17:16:58 +0100
Radek Polak <psonek2 at seznam.cz> wrote:

>  BTW. /dev/input/mice is a placeholder to make X read all kinds of mice at
> > once. It is supposed to simplify the configuration as you could replace
> > your PS/2 mouse with a USB one, a touchpad or even a good old serial
> > mouse. But if you know the concrete input of the Touchscreen (cat
> > /proc/bus/input/devices) you can enter this one into the xorg.conf.  
> 
> Maybe i dont understand it correctly, but i thought that touchscreen is 
> different from mouse and should not appear in /dev/input/mice because it 
> generates absolute screen coordinates while mouse generates relative 
> coordinates. But that is just my impression, i havent read any docs about it 
> yet :)


/dev/input/mice combines multiple point-like device and generates relative
motion events.  For a touch screen, it reports differences between consecutive
locations so you can use it like a touchpad.

A key data structure is in drives/input/mousedev.c and is mousedev_ids.
This data structure identifies what sort of devices will be handled
by /dev/input/mice.
It has a section:
	{
		.flags = INPUT_DEVICE_ID_MATCH_EVBIT |
				INPUT_DEVICE_ID_MATCH_KEYBIT |
				INPUT_DEVICE_ID_MATCH_ABSBIT,
		.evbit = { BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS) },
		.keybit = { [BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH) },
		.absbit = { BIT_MASK(ABS_X) | BIT_MASK(ABS_Y) },
	},	/* A tablet like device, at least touch detection,
		   two absolute axes */

which means that any device which generates absolute X and Y events as well
as a key calls 'touch' is included.
In andy-tracking, this stanza has "#if 0 / #endif" around it.
In om-gta02-2.6.32 it does not.
That might explain the difference.

The #if hack was in there to support X servers that did not support hot-plug
of input devices, so that people could still use e.g a bluetooth mouse
(through /dev/input/mice) it they like, while also getting absolute events
from the touchscreen.

To get things working with 2.6.32 you need to do one of:

 - Put the "#if 0" hack back
 - Tell X not to open /dev/input/mice, so you will not be able to use
   e.g. a bluetooth mouse, but there will be no confusion with the
   touchscreen.
 - Use an X server that supports got-plug of input devices, and make sure
   it doesn't open /dev/input/mice as well.  This is the ideal configuration,
   but last time I looked (a couple of years ago) no such X server existed.
   It probably does now - you may even be using it already...

NeilBrown



More information about the community mailing list