Commit 429722e1 authored by Dmitry Torokhov's avatar Dmitry Torokhov

Input: Mac button emulation - allow compiling as a module

Not all systems require Mac-style button emulation, however distributions
enable it by default so it is readily available. Allow compiling it as a
module so it can be loaded only on systems that actually require it.
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 99b089c3
...@@ -171,9 +171,8 @@ config INPUT_ADBHID ...@@ -171,9 +171,8 @@ config INPUT_ADBHID
If unsure, say Y. If unsure, say Y.
config MAC_EMUMOUSEBTN config MAC_EMUMOUSEBTN
bool "Support for mouse button 2+3 emulation" tristate "Support for mouse button 2+3 emulation"
depends on SYSCTL depends on SYSCTL && INPUT
select INPUT
help help
This provides generic support for emulating the 2nd and 3rd mouse This provides generic support for emulating the 2nd and 3rd mouse
button with keypresses. If you say Y here, the emulation is still button with keypresses. If you say Y here, the emulation is still
...@@ -185,6 +184,9 @@ config MAC_EMUMOUSEBTN ...@@ -185,6 +184,9 @@ config MAC_EMUMOUSEBTN
If you have an Apple machine with a 1-button mouse, say Y here. If you have an Apple machine with a 1-button mouse, say Y here.
To compile this driver as a module, choose M here: the
module will be called mac_hid.
config THERM_WINDTUNNEL config THERM_WINDTUNNEL
tristate "Support for thermal management on Windtunnel G4s" tristate "Support for thermal management on Windtunnel G4s"
depends on I2C && I2C_POWERMAC && PPC_PMAC && !PPC_PMAC64 depends on I2C && I2C_POWERMAC && PPC_PMAC && !PPC_PMAC64
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
#include <linux/input.h> #include <linux/input.h>
#include <linux/module.h> #include <linux/module.h>
MODULE_LICENSE("GPL");
static int mouse_emulate_buttons; static int mouse_emulate_buttons;
static int mouse_button2_keycode = KEY_RIGHTCTRL; /* right control key */ static int mouse_button2_keycode = KEY_RIGHTCTRL; /* right control key */
static int mouse_button3_keycode = KEY_RIGHTALT; /* right option key */ static int mouse_button3_keycode = KEY_RIGHTALT; /* right option key */
...@@ -252,7 +254,6 @@ static ctl_table mac_hid_root_dir[] = { ...@@ -252,7 +254,6 @@ static ctl_table mac_hid_root_dir[] = {
static struct ctl_table_header *mac_hid_sysctl_header; static struct ctl_table_header *mac_hid_sysctl_header;
static int __init mac_hid_init(void) static int __init mac_hid_init(void)
{ {
mac_hid_sysctl_header = register_sysctl_table(mac_hid_root_dir); mac_hid_sysctl_header = register_sysctl_table(mac_hid_root_dir);
...@@ -261,5 +262,13 @@ static int __init mac_hid_init(void) ...@@ -261,5 +262,13 @@ static int __init mac_hid_init(void)
return 0; return 0;
} }
module_init(mac_hid_init);
static void __exit mac_hid_exit(void)
{
unregister_sysctl_table(mac_hid_sysctl_header);
device_initcall(mac_hid_init); if (mouse_emulate_buttons)
mac_hid_stop_emulation();
}
module_exit(mac_hid_exit);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment