From: Vojtech P. <vo...@su...> - 2000-06-08 07:38:35
|
On Wed, Jun 07, 2000 at 10:03:49PM -0400, James Simmons wrote: > > Now that I understand the way the keyboard <-> tty works like for ruby. > > ------------------------------------------------------------------------- > > Ruby way for AT keyboards: > > i8042.c -(raw)-> atkbd.c -(events)-> input.c --> > >--(events)-> keyboard.c -(chars)-> tty > > Ruby way for USB keyboards: > > usb.c -(usb)-> hid.c -(events)-> input.c --> > >--(events)-> keyboard.c -(chars)-> tty > > ----------------------------------------------------------------------- > > The next question is can we have > > i8042.c usb.c > | | > (raw) (usb) > | | > atkbd.c hid.c > | | > (events) (events) > | | > | | > input.c input.c > | | > --------(events)-----------> keyboard.c -(chars)-> tty > > I'm assuming only specific EV_KEY events get sent to keyboard.c. If > keyboard.c only sees events coming in and we want to support multiple > keyboards how are we going to tell the different keyboards apart? Wait I > think I see how. We have > > void kbd_event(struct input_handle *handle, unsigned int event_type, > unsigned int keycode, int down) > { > if (event_type != EV_KEY) return; > kbd_keycode(keycode, down); > tasklet_schedule(&keyboard_tasklet); > } > > In input_handle we have input_dev *dev which has a name string whcih I can > use compare which keyboard it came from. I think? Ideas Vojtech. Not just a name, you also have the idbus, idvendor, idproduct, idversion, *number* variables in struct input_dev. I hope to add tbus, tdev, tfunc or something like that to identify where the device is in the bus topology. When a keyboard (or other input device) is found, the kbd_connect function is called. The function then looks at the device, and if it likes it, it can open it and get events from it. In this (kbd_connect) function, we should decide which VTs to bind that keyboard to initially. The handle struct also has a 'private' pointer, which can be used to associate any private data with the handle struct, so we always know what keyboard is that. -- Vojtech Pavlik SuSE Labs |