|
From: Charles D. <cd...@mv...> - 2001-06-20 05:49:39
|
On Tue, Jun 19, 2001 at 11:39:55PM +0200, Franz Sirl wrote:
> Last time I asked Vojtech wasn't very pleased of that idea, eg. it
> doesn't make much sense to mix in EV_ABS devices.
True... at least, not unless there's a means of distinguishing between
them. How about something similar to the following, applied on top of
my earlier patch? (Changing the type of event to unsigned char and
adding an extra field for the purpose would be cleaner, or having an
entirely different data type emitted by the mixer... this is intended
as more of a conceptual demonstration than anything else).
One advantage of using a modified evdev rather than an entirely
separate module, btw, is the ability to pass out a device number which
can be used by the userland program to open the appropriate
device-specific interface as desired. Separating the mixer from evdev
itself leaves no easy way to do that.
--- evdev.c.simplemix Tue Jun 19 16:49:48 2001
+++ evdev.c Tue Jun 19 20:58:15 2001
@@ -75,7 +75,12 @@
while(list) {
get_fast_time(&list->buffer[list->head].time);
- list->buffer[list->head].type = type;
+ if(*evdev == &evdev_mix) {
+ list->buffer[list->head].type = type |
+ (((struct evdev*)handle->private)->minor << 8);
+ } else {
+ list->buffer[list->head].type = type;
+ }
list->buffer[list->head].code = code;
list->buffer[list->head].value = value;
list->head = (list->head + 1) & (EVDEV_BUFFER_SIZE - 1);
|