From: Karim Yaghmour <karym@opersys.com>
To: linux-kernel@vger.kernel.org, linuxppc-dev@lists.linuxppc.org
Subject: Re: Mac-buttons emulation broken in 2.4.0-test10
Date: Mon, 13 Nov 2000 10:26:12 -0500 [thread overview]
Message-ID: <3A100930.FEEB617B@opersys.com> (raw)
In-Reply-To: <3A0FC230.BF7E537B@opersys.com>
Well, it seems I found a solution to my own problem :)
Here are patches that fix the problem.
Doing this, I discovered there are 2 modes to button emulation (3 if you
include no emulation):
Mode 0:
No emulation whatsoever.
Mode 1:
echo "1" > /proc/sys/dev/mac_.../mouse_...
In this mode, when you press on fct-ctrl or fct-alt, then it's like if you
pressed on the corresponding mouse button.
Mode 2:
echo "2" > /proc/sys/dev/mac_.../mouse_...
In this mode, you have to hold down fct-ctrl or fct-alt __and__ click
the mouse to get the corresponding mouse button.
Cheers
Karim
---------------------------------------------------------------------------------------------------
--- linux/drivers/input/keybdev.c Thu Jul 27 21:36:54 2000
+++ linux-2.4.0-test10/drivers/input/keybdev.c Mon Nov 13 08:19:48 2000
@@ -90,7 +90,7 @@
return 0;
}
-#elif defined(CONFIG_ADB_KEYBOARD)
+#elif defined(CONFIG_ADB_KEYBOARD) || defined(CONFIG_MAC_HID)
static unsigned char mac_keycodes[128] =
{ 0, 53, 18, 19, 20, 21, 23, 22, 26, 28, 25, 29, 27, 24, 51, 48,
@@ -129,9 +129,19 @@
}
}
+#ifdef CONFIG_MAC_EMUMOUSEBTN
+extern int mac_hid_mouse_emulate_buttons(int caller, unsigned int keycode, int down);
+#endif
+
void keybdev_event(struct input_handle *handle, unsigned int type, unsigned int code, int down)
{
if (type != EV_KEY) return;
+
+#ifdef CONFIG_MAC_EMUMOUSEBTN
+ /* There should be an if() here to determine whether emulate_raw() is to be called or not.
+ If the key is caught, emulate_raw() should not be called. K.Y. */
+ mac_hid_mouse_emulate_buttons(1, code, down);
+#endif
if (emulate_raw(code, down))
printk(KERN_WARNING "keyboard.c: can't emulate rawmode for keycode %d\n", code);
--- linux/drivers/input/mousedev.c Tue Aug 22 12:06:31 2000
+++ linux-2.4.0-test10/drivers/input/mousedev.c Mon Nov 13 08:25:41 2000
@@ -79,6 +79,10 @@
static struct mousedev *mousedev_table[MOUSEDEV_MINORS];
static struct mousedev mousedev_mix;
+#ifdef CONFIG_MAC_EMUMOUSEBTN
+extern int mac_hid_mouse_emulate_buttons(int caller, unsigned int keycode, int down);
+#endif
+
static void mousedev_event(struct input_handle *handle, unsigned int type, unsigned int code, int value)
{
struct mousedev *mousedevs[3] = { handle->private, &mousedev_mix, NULL };
@@ -132,6 +136,9 @@
case BTN_MIDDLE: index = 2; break;
default: return;
}
+#ifdef CONFIG_MAC_EMUMOUSEBTN
+ index = mac_hid_mouse_emulate_buttons(2, index, 0);
+#endif
switch (value) {
case 0: clear_bit(index, &list->buttons); break;
case 1: set_bit(index, &list->buttons); break;
---------------------------------------------------------------------------------------------------
Karim Yaghmour wrote:
>
> The mac_hid_mouse_emulate_buttons() in drivers/macintosh/mac_hid.c
> which takes care of emulating multiple buttons on a mac doesn't
> seem to be used anywhere. In fact, by doing a "grep -r mac_hid... *"
> in the kernel's base directory yields only one result and it's
> the one in mac_hid.c. Shouldn't this be called upon from the
> keyboard and mouse handlers?
>
===================================================
Karim Yaghmour
karym@opersys.com
Operating System Consultant
(Linux kernel, real-time and distributed systems)
===================================================
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
prev parent reply other threads:[~2000-11-13 15:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-11-13 10:23 Mac-buttons emulation broken in 2.4.0-test10 Karim Yaghmour
2000-11-13 15:26 ` Karim Yaghmour [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3A100930.FEEB617B@opersys.com \
--to=karym@opersys.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.linuxppc.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox