[lkml]   [1999]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [patch] Re: "Internet Keyboard" support for Linux
> But you want to do that even on non-internet keybaords! For example
> mouse emulation on keyboard is easy that way.
> I called it keylink, but it never got to standart distribution. (There
> should be hooks to actually call it, add them yourself.)

Your code looks alot like the other side of my code (i.e. the module - I havn't
posted it because it is irrelivant)

The only thing I want is _that hook in the kernel_. Just a generic interface
to allow contributed modules to hook into the keyboard controller and get told
what all the keypresses are, deciding if they want to process them or if they
should go to the normal controller.

This interface would allow the implimentation of mouse emulation, "internet
keyboard" support, and even provide an interface for the SysRQ keys.

As for mouse keys, I like that idea. Assuming this hook was in the kernel, it
would be very easy to impliment mouse keys. You could even write your module
to emulate a common mouse protocol and simply attach gpm or X to it.

Furthermore, the hook is just a pointer, set to 0 by default. If no keyboard
addons are loaded, then the pointer remains 0 and doesn't get called by the
handle_scancode routine.

However, if an addon is present, it would set this hook to point to its own
scancode handling function (setting of the pointer would naturally be done in
init_module, and setting it back to 0 would be done in module_release). The
handler would then receive all scancodes and decide which ones it wanted to
process and which ones to allow the normal handler to handle.

(note, the following suggestions are against 2.2.13, not a 2.3.x)
At the top of keyboard.c, we add:
static int (* keyboard_addon)( unsigned char scancode, int down ) = 0;

and in the handle_scancode routine (near the very top, just after the variable
if( keyboard_addon )
if( keyboard_addon( scancode, down ) )

If the keyboard_addon symbol has been set to a non-0, then the handler is
called. If the handler returns non-zero, then it has handled the scancode and
handle_scancode can return. If the handler returns 0, then handle_scancode
proceeds normally.

This is a very generic interface that could be used for many things, several of
which I am personally interested in implimenting.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:55    [W:0.036 / U:21.116 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site