Input: Mac button emulation - implement as an input filter

Current implementation of Mac mouse button emulation plugs into legacy
keyboard driver, converts certain keys into button events on a separate
device, and suppresses the real events from reaching tty. This worked
well enough until user space started using evdev which was completely
unaware of this arrangement and kept sending original key presses to
its users. Change the implementation to use newly added input filter
framework so that original key presses are not transmitted to any
handlers.

As a bonus remove SYSCTL dependencies from the code and use Kconfig
instead; also do not create the emulated mouse device until user
activates emulation.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
Dmitry Torokhov
2010-01-30 00:53:29 -08:00
parent ef7995f4e4
commit 99b089c3c3
4 changed files with 188 additions and 78 deletions

View File

@ -161,7 +161,4 @@ static inline void con_schedule_flip(struct tty_struct *t)
schedule_delayed_work(&t->buf.work, 0);
}
/* mac_hid.c */
extern int mac_hid_mouse_emulate_buttons(int, unsigned int, int);
#endif