Hello community,
here is the log from the commit of package mouseemu
checked in at Fri Oct 5 00:37:38 CEST 2007.
--------
--- arch/ppc/mouseemu/mouseemu.changes 2007-02-20 22:43:00.000000000 +0100
+++ /mounts/work_src_done/STABLE/mouseemu/mouseemu.changes 2007-10-04 11:30:15.000000000 +0200
@@ -2 +2 @@
-Tue Feb 20 22:42:47 CET 2007 - olh@suse.de
+Thu Oct 4 11:29:41 CEST 2007 - olh@suse.de
@@ -4 +4 @@
-- fix file permissions, do not build as root
+- use a mousebutton daemon (147879) instead of kernel emulation
New:
----
get_release_number.sh
mouseemu_0.15.orig.tar.gz
mouseemu.bustype_virtual.patch
mouseemu.defaults.patch
mouseemu.dual_devices.patch
mouseemu.initialize_device.patch
mouseemu.makefile.patch
mouseemu.manpage.patch
mouseemu.mod-passthrough.patch
mouseemu.nofork.patch
mouseemu.pidfile.patch
mouseemu.rescan.patch
mouseemu.syslog.patch
mouseemu.uinput_error_msg.patch
mouseemu.unregister_inputhandler.patch
mouseemu.usage.patch
mouseemu.write_error.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ mouseemu.spec ++++++
--- /var/tmp/diff_new_pack.oi7844/_old 2007-10-05 00:37:25.000000000 +0200
+++ /var/tmp/diff_new_pack.oi7844/_new 2007-10-05 00:37:25.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package mouseemu (Version 0.2)
+# spec file for package mouseemu (Version 0.15)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -11,16 +11,32 @@
# norootforbuild
Name: mouseemu
-Version: 0.2
-Release: 406
+Version: 0.15
+Release: 200710042236
Summary: A Program to Activate Mouse Button Emulation on Macs with One-Button Mice
License: Artistic License
Group: System/Base
-Autoreqprov: on
+AutoReqProv: on
PreReq: %insserv_prereq %fillup_prereq
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+Source0: http://ftp.debian.org/debian/pool/main/m/mouseemu/mouseemu_%{version}.orig.tar.gz
Source1: rc.mouseemu
Source2: sysconfig.mouseemu
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
+Patch1: mouseemu.nofork.patch
+Patch2: mouseemu.mod-passthrough.patch
+Patch3: mouseemu.makefile.patch
+Patch4: mouseemu.usage.patch
+Patch5: mouseemu.defaults.patch
+Patch6: mouseemu.manpage.patch
+Patch7: mouseemu.rescan.patch
+Patch8: mouseemu.syslog.patch
+Patch9: mouseemu.pidfile.patch
+Patch10: mouseemu.bustype_virtual.patch
+Patch11: mouseemu.dual_devices.patch
+Patch12: mouseemu.initialize_device.patch
+Patch13: mouseemu.uinput_error_msg.patch
+Patch14: mouseemu.write_error.patch
+Patch15: mouseemu.unregister_inputhandler.patch
%description
With this package, you can emulate the second and third mouse buttons
@@ -38,14 +54,30 @@
Peter Poeml
%prep
-cp %{SOURCE1} %{SOURCE2} .
+%setup -q -n mouseemu
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+%patch10 -p1
+%patch11 -p1
+%patch12 -p1
+%patch13 -p1
+%patch14 -p1
+%patch15 -p1
%build
+cp %{SOURCE1} %{SOURCE2} .
+make CFLAGS="$RPM_OPT_FLAGS"
%install
-[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT;
+make DESTDIR="$RPM_BUILD_ROOT" install
mkdir -p $RPM_BUILD_ROOT/etc/init.d
-mkdir -p $RPM_BUILD_ROOT/%{_sbindir}
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
install -m 755 rc.mouseemu $RPM_BUILD_ROOT/etc/init.d/mouseemu
ln -sf ../../etc/init.d/mouseemu $RPM_BUILD_ROOT/usr/sbin/rcmouseemu
@@ -61,14 +93,14 @@
%insserv_cleanup
%files
-%defattr(-,root,root)
+%defattr (-,root,root)
%config /etc/init.d/mouseemu
-%{_sbindir}/rcmouseemu
+%{_sbindir}/*
/var/adm/fillup-templates/sysconfig.mouseemu
-
+%doc /usr/share/man/man*/*
%changelog
-* Tue Feb 20 2007 - olh@suse.de
-- fix file permissions, do not build as root
+* Thu Oct 04 2007 - olh@suse.de
+- use a mousebutton daemon (147879) instead of kernel emulation
* Wed Jan 25 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
* Tue Aug 02 2005 - olh@suse.de
++++++ mouseemu.bustype_virtual.patch ++++++
#! /bin/sh /usr/share/dpatch/dpatch-run
## bustype_virtual.dpatch by Colin Watson
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.
@DPATCH@
---
mouseemu.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
--- a/mouseemu.c
+++ b/mouseemu.c
@@ -30,6 +30,9 @@
#include
#include
#include
+#ifndef BUS_VIRTUAL /* new in Linux 2.6.19 */
+#define BUS_VIRTUAL 0x06
+#endif
#include
#include "mouseemu.h"
#include "defkeys.h"
@@ -433,7 +436,7 @@ int uinput_setup(void)
strcpy(device.name, "Mouseemu virtual keyboard");
- device.id.bustype = 0;
+ device.id.bustype = BUS_VIRTUAL;
device.id.vendor = 0x1F;
device.id.product = 0x1F;
device.id.version = 0;
@@ -475,7 +478,7 @@ int uinput_setup(void)
strcpy(device.name, "Mouseemu virtual mouse");
- device.id.bustype = 0;
+ device.id.bustype = BUS_VIRTUAL;
device.id.vendor = 0x1F;
device.id.product = 0x1E;
device.id.version = 0;
++++++ mouseemu.defaults.patch ++++++
#! /bin/sh /usr/share/dpatch/dpatch-run
## 41_defaults.dpatch by
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: change defaults to not emaulate mouse buttons for \!powerpc
@DPATCH@
---
mouseemu.c | 39 ++++++++++++++++++++++++++++++++++++---
1 file changed, 36 insertions(+), 3 deletions(-)
--- a/mouseemu.c
+++ b/mouseemu.c
@@ -24,11 +24,15 @@
#include
#include
#include
+#include
+#include
#include
#include
#include "mouseemu.h"
#include "defkeys.h"
+static int use_defaults = 0;
+
static int b2_mod = BUTTON2MOD;
static int b2_key = BUTTON2KEY;
@@ -534,10 +538,16 @@ void usage(FILE *stream, char *argv[]) {
"Use decimal values. BTN_LEFT(272) is usable as "
"B2_KEY or B3_KEY.\n\n");
fprintf(stream, "Default uinput device: " DEFAULT_UINPUT ".\n");
- fprintf(stream, "Default keys:\n"
+ fprintf(stream, "Default keys:\n");
+ if (use_defaults)
+ fprintf(stream,
"\tMiddle click : F10 (0 68)\n"
- "\tRight click : F11 (0 87)\n"
- "\tScroll mod. : Alt (56)\n"
+ "\tRight click : F11 (0 87)\n");
+ else
+ fprintf(stream,
+ "\tMiddle click : none (0 0)\n"
+ "\tRight click : none (0 0)\n");
+ fprintf(stream, "\tScroll mod. : Alt (56)\n"
"\tDefault blocking time while typing: 300ms\n");
exit(0);
@@ -556,6 +566,29 @@ int main(int argc, char *argv[])
install_sighandler();
+#ifdef __powerpc__
+ use_defaults = 1;
+#else
+#if defined(__i386__) || defined(__amd64__)
+ {
+ FILE *dmidecode;
+ char line[1024];
+ dmidecode = popen("dmidecode -s system-manufacturer 2>/dev/null", "r");
+ if (dmidecode) {
+ if (fgets(line, 1024, dmidecode) && !strncmp(line, "Apple", 5))
+ use_defaults = 1;
+ pclose(dmidecode);
+ }
+ }
+#endif
+#endif
+ if (!use_defaults) {
+ b2_mod = 0;
+ b2_key = 0;
+ b3_mod = 0;
+ b3_key = 0;
+ }
+
uinputdev = DEFAULT_UINPUT;
if (argc > 1) {
int i = 0;
++++++ mouseemu.dual_devices.patch ++++++
#! /bin/sh /usr/share/dpatch/dpatch-run
## dual_devices.dpatch by Colin Watson
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.
@DPATCH@
---
mouseemu.c | 115 +++++++++++++++++++++++++++++++++++--------------------------
mouseemu.h | 8 +++-
2 files changed, 72 insertions(+), 51 deletions(-)
--- a/mouseemu.c
+++ b/mouseemu.c
@@ -187,52 +187,66 @@ static int is_modifier(struct input_even
}
}
-void keyboard_handler (int fd)
+void keyboard_handler (struct input_event inp)
{
- struct input_event inp;
- if (read(fd, &inp, sizeof(inp)) == sizeof(inp)) {
- if (!event_parse(inp.code, inp.value) && !is_modifier(inp)) {
- last_key = (inp.time.tv_sec*1000000 + inp.time.tv_usec);
- }
+ if (inp.type != EV_KEY && inp.type != EV_REP)
+ return;
+ if (inp.type == EV_KEY && (inp.code == BTN_LEFT || inp.code == BTN_MIDDLE || inp.code == BTN_RIGHT))
+ return;
+
+ if (!event_parse(inp.code, inp.value) && !is_modifier(inp)) {
+ last_key = (inp.time.tv_sec*1000000 + inp.time.tv_usec);
+ }
/* I think its best not to pass scroll, or experiment with not passing the release if
* we actually used it for scrolling (but some apps may get stuck?)
*/
- if (inp.code != b2_key && inp.code != b3_key) {
- passthrough(ui_keyb_fd, inp);
- }
+ if (inp.code != b2_key && inp.code != b3_key) {
+ passthrough(ui_keyb_fd, inp);
+ }
+}
+
+static void mouse_handler (struct input_event inp)
+{
+ if (inp.type != EV_KEY && inp.type != EV_REL && inp.type != EV_SYN)
+ return;
+ if (inp.type == EV_KEY && inp.code != BTN_LEFT && inp.code != BTN_MIDDLE && inp.code != BTN_RIGHT)
+ return;
+
+ if (inp.type == EV_KEY && inp.code == BTN_LEFT) {
+ if (b2_key == BTN_LEFT && b2_mod_pressed)
+ report_click(BTN_MIDDLE, inp.value);
+ else if (b3_key == BTN_LEFT && b3_mod_pressed)
+ report_click(BTN_RIGHT, inp.value);
+ else
+ passthrough(ui_mouse_fd, inp);
+ }
+ else if (scroll_mod_pressed
+ && inp.type == EV_REL
+ && (inp.code == REL_Y || inp.code == REL_X)) {
+ report_scroll (inp.value);
+ //printf("inp.value %d\n", inp.value);
+ } else {
+ if ((inp.time.tv_sec*1000000+inp.time.tv_usec)-last_key > typing_block_delay*1000
+ || inp.type == EV_REL)
+ passthrough(ui_mouse_fd, inp);
}
}
-static void mouse_handler (int fd)
+static void event_handler (int mode, int fd)
{
- int count;
struct input_event inp;
- if ((count = read(fd, &inp, sizeof(inp))) == sizeof(inp)) {
- if (inp.type == EV_KEY && inp.code == BTN_LEFT) {
- if (b2_key == BTN_LEFT && b2_mod_pressed)
- report_click(BTN_MIDDLE, inp.value);
- else if (b3_key == BTN_LEFT && b3_mod_pressed)
- report_click(BTN_RIGHT, inp.value);
- else
- passthrough(ui_mouse_fd, inp);
- }
- else if (scroll_mod_pressed
- && inp.type == EV_REL
- && (inp.code == REL_Y || inp.code == REL_X)) {
- report_scroll (inp.value);
- //printf("inp.value %d\n", inp.value);
- } else {
- if ((inp.time.tv_sec*1000000+inp.time.tv_usec)-last_key > typing_block_delay*1000
- || inp.type == EV_REL)
- passthrough(ui_mouse_fd, inp);
- }
+ if (read(fd, &inp, sizeof(inp)) == sizeof(inp)) {
+ if (mode & HANDLER_KEYBOARD)
+ keyboard_handler(inp);
+ if (mode & HANDLER_MOUSE)
+ mouse_handler(inp);
}
}
void scan_for_devs()
{
- int n, m, fd;
+ int n, m, fd, mode;
char filename[20];
unsigned long bit[NBITS(EV_MAX)];
unsigned short id[EVENT_DEVS];
@@ -240,47 +254,47 @@ void scan_for_devs()
for (n = 0, m = 0; n < EVENT_DEVS; n++) {
sprintf(filename, "/dev/input/event%d", n);
if ((fd = open(filename, O_RDONLY)) >= 0) {
+ mode = 0;
ioctl(fd, EVIOCGBIT(0, EV_MAX), bit);
+ ioctl(fd, EVIOCGID, id);
if (test_bit(EV_KEY, bit) && test_bit(EV_REP, bit)) {
- ioctl(fd, EVIOCGID, id);
/* our own virtual keyboard (on rescans)*/
if (id[ID_PRODUCT] == 0x1F && id[ID_VENDOR] == 0x1F) {
close(fd);
continue;
}
+ mode |= HANDLER_KEYBOARD;
if (id[ID_PRODUCT] != eventdevs[m].product ||
id[ID_VENDOR] != eventdevs[m].vendor) {
- if (eventdevs[m].handle >= 0) {
- unregister_inputhandler(eventdevs[m].handle);
- close(eventdevs[m].handle);
- }
debugf("keyboard: fd %d event%d, vendor %4x product %4x\n", fd, n, id[ID_VENDOR], id[ID_PRODUCT]);
- eventdevs[m].handle= fd;
- eventdevs[m].product = id[ID_PRODUCT];
- eventdevs[m].vendor = id[ID_VENDOR];
- register_inputhandler(fd, keyboard_handler, 1);
}
- m++;
- } else if (test_bit(EV_REL, bit)) {
- ioctl(fd, EVIOCGID, id);
+ }
+ if (test_bit(EV_REL, bit)) {
/* our own virtual mouse (on rescans)*/
if (id[ID_PRODUCT] == 0x1E && id[ID_VENDOR] == 0x1F) {
close(fd);
continue;
}
+ mode |= HANDLER_MOUSE;
+ if (id[ID_PRODUCT] != eventdevs[m].product ||
+ id[ID_VENDOR] != eventdevs[m].vendor) {
+ debugf("mouse : fd %d event%d, vendor %4x product %4x\n", fd, n, id[ID_VENDOR], id[ID_PRODUCT]);
+ }
+ }
+ if (mode) {
if (id[ID_PRODUCT] != eventdevs[m].product ||
id[ID_VENDOR] != eventdevs[m].vendor) {
if (eventdevs[m].handle >= 0) {
unregister_inputhandler(eventdevs[m].handle);
close(eventdevs[m].handle);
}
- debugf("mouse : fd %d event%d, vendor %4x product %4x\n", fd, n, id[ID_VENDOR], id[ID_PRODUCT]);
eventdevs[m].handle= fd;
eventdevs[m].product = id[ID_PRODUCT];
eventdevs[m].vendor = id[ID_VENDOR];
- register_inputhandler(fd, mouse_handler, 1);
- }
- m++;
+ register_inputhandler(mode, fd, event_handler, 1);
+ } else
+ close(fd);
+ m++;
} else
close(fd);
}
@@ -313,12 +327,13 @@ void rescan_devs()
scan_for_devs();
}
-int register_inputhandler (int fd, void (*func)(int fd), int grab)
+int register_inputhandler (int mode, int fd, void (*func)(int mode, int fd), int grab)
{
int n;
for (n=0; n < EVENT_DEVS; n++)
if (ihandler[n].fd == -1) {
+ ihandler[n].mode = mode;
ihandler[n].fd = fd;
ihandler[n].handler = func;
ihandler[n].grab = grab;
@@ -335,6 +350,7 @@ void unregister_inputhandler (int fd)
for (n = 0; n < EVENT_DEVS; n++)
if (found) {
+ ihandler[n-1].mode = ihandler[n].mode;
ihandler[n-1].fd = ihandler[n].fd;
ihandler[n-1].handler = ihandler[n].handler;
} else if (ihandler[n].fd == fd) {
@@ -367,7 +383,7 @@ void call_inputhandler(fd_set *inset)
for (n=0; n < EVENT_DEVS; n++) {
if (ihandler[n].fd == -1) continue;
if (FD_ISSET(ihandler[n].fd, inset))
- ihandler[n].handler (ihandler[n].fd);
+ ihandler[n].handler (ihandler[n].mode, ihandler[n].fd);
}
}
@@ -815,6 +831,7 @@ startops:
eventdevs[i].product= 0;
ihandler[i].handler=0;
+ ihandler[i].mode=0;
ihandler[i].fd=-1;
}
--- a/mouseemu.h
+++ b/mouseemu.h
@@ -33,6 +33,9 @@
#define BTN2 0x04
#define BTN3 0x02
+#define HANDLER_KEYBOARD (1 << 0)
+#define HANDLER_MOUSE (1 << 1)
+
/* device structure */
typedef struct _kdev {
int handle;
@@ -42,11 +45,12 @@ typedef struct _kdev {
/* handler structure */
typedef struct _ihandler {
- void (*handler)(int fd);
+ void (*handler)(int mode, int fd);
+ int mode;
int fd;
int grab;
} input_handler;
void unregister_inputhandler (int fd);
-int register_inputhandler(int fd, void (*func)(int fd), int grab);
+int register_inputhandler(int mode, int fd, void (*func)(int mode, int fd), int grab);
#endif
++++++ mouseemu.initialize_device.patch ++++++
#! /bin/sh /usr/share/dpatch/dpatch-run
## write_error.dpatch by
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Intialize all fields in uinput_user_dev, otherwise strange things
## DP: like dead keyboard, etc. might happen
##
---
# mouseemu.c | 1 +
# 1 file changed, 1 insertion(+)
#
--- a/mouseemu.c
+++ b/mouseemu.c
@@ -437,6 +437,7 @@ int uinput_setup(void)
struct uinput_user_dev device;
int i;
+ memset(&device, 0, sizeof(struct uinput_user_dev));
/*setup keyboard device */
if(ui_keyb_fd > 0) {
++++++ mouseemu.makefile.patch ++++++
#! /bin/sh /usr/share/dpatch/dpatch-run
## 21_makefile.dpatch by
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: install manpage to /usr/share/man
@DPATCH@
---
Makefile | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,11 @@
+CFLAGS= -Wall -g
+
all:
- gcc -Wall -g -o mouseemu mouseemu.c
+ gcc $(CFLAGS) -o mouseemu mouseemu.c
clean:
rm -f *.o core* mouseemu
install:
- cp -f mouseemu $(DESTDIR)/usr/sbin/
- cp -f mouseemu.8 $(DESTDIR)/usr/man/man8
+ mkdir -p $(DESTDIR)/usr/sbin/
+ mkdir -p $(DESTDIR)/usr/share/man/man8
+ cp -fL mouseemu $(DESTDIR)/usr/sbin/
+ cp -fL mouseemu.8 $(DESTDIR)/usr/share/man/man8
++++++ mouseemu.manpage.patch ++++++
#! /bin/sh /usr/share/dpatch/dpatch-run
## 51_manpage.dpatch by
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: add default values and information about keycodes to manpage
@DPATCH@
---
mouseemu.8 | 31 +++++++++++++++++++++++++++----
1 file changed, 27 insertions(+), 4 deletions(-)
--- a/mouseemu.8
+++ b/mouseemu.8
@@ -30,22 +30,45 @@ it uses the new uinput interface to emul
.SH OPTIONS
.TP
.B -middle B2_MOD B2_KEY
-modifier and key for the middle (second) mouse button
+Modifier and key for the middle (second) mouse button. Defaults to F10 and no modifier
+on PowerPC and Intel Macs, and to none on all other architectures.
.TP
.B -right B3_MOD B3_KEY
-modifier and key for the right (third) mouse button
+Modifier and key for the right (third) mouse button. Defaults to F11 and no modifier
+on PowerPC and Intel Macs, and to none on all other architectures.
.TP
.B -scroll SCROLL_MOD
-modifier for the scrolling function
+Modifier for the scrolling function. Defaults to Alt.
.TP
.B -typing-block DELAY
Time in milliseconds for which the trackpad will be blocked while typing on the keyboard.
+Defaults to 300ms.
.TP
.B -device UINPUT
-device node for the uinput device
+Device node for the uinput device. Defaults to /dev/uinput. If this device is not read and
+writeable the following devices are also tried: /dev/uinput, /dev/input/uinput and
+/dev/misc/uinput.
.TP
.B -nofork
don't run in the background
+.TP
+.B -help
+show usage message
+.PP
+The key codes for the buttons and modifiers are key scancodes. They can be found in
+include/linux/input.h in the kernel headers or by using `showkey` in a console. The
+keycodes must be given as decimal values (`showkey` displays hex values!).
+
+.SH EXAMPLES
+.PP
+To have the same behaviour as in MacOS X (CTRL-click for right mouse button and no
+emulation for the middle button):
+.PP
+.RS 4
+.B mouseemu -middle 0 0 -right 29 272
+.RE
+.PP
+The code for the (left) mouse button is 272 (0x110 in hex). The code for CTRL is 29.
.SH AUTHOR
Mouseemu was written by Colin Leroy
++++++ mouseemu.mod-passthrough.patch ++++++
#! /bin/sh /usr/share/dpatch/dpatch-run
## 11_mod-passthrough.dpatch by
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Pass through key events of modifier keys
@DPATCH@
---
mouseemu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/mouseemu.c
+++ b/mouseemu.c
@@ -174,7 +174,7 @@ void keyboard_handler (int fd)
/* I think its best not to pass scroll, or experiment with not passing the release if
* we actually used it for scrolling (but some apps may get stuck?)
*/
- if (inp.code != b2_key && inp.code != b3_key && !b2_mod_pressed && !b3_mod_pressed) {
+ if (inp.code != b2_key && inp.code != b3_key) {
passthrough(ui_keyb_fd, inp);
}
}
++++++ mouseemu.nofork.patch ++++++
#! /bin/sh /usr/share/dpatch/dpatch-run
## 01_nofork.dpatch by
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Don't kill ourselves if not forking into the background
@DPATCH@
---
mouseemu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/mouseemu.c
+++ b/mouseemu.c
@@ -706,7 +706,7 @@ startops:
}
/* tell the parent we are running without problems */
/* What should we do if the parent is dead? */
- if (answer) {
+ if (answer && !nofork) {
answer=0;
kill(getppid(), SIGUSR1);
}
++++++ mouseemu.pidfile.patch ++++++
#! /bin/sh /usr/share/dpatch/dpatch-run
## 63_pidfile.dpatch.dpatch by Michael Schmitz
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: create pidfile in /var/run/mouseemu.pid
@DPATCH@
---
mouseemu.c | 10 ++++++++++
1 file changed, 10 insertions(+)
--- a/mouseemu.c
+++ b/mouseemu.c
@@ -755,6 +755,7 @@ int main(int argc, char *argv[])
struct sigaction sa;
sigset_t mask, oldmask;
+ FILE *pidfile;
/* SIGHUP and SIGALRM are only useful in the child */
memset(&sa, 0, sizeof(sa));
@@ -762,6 +763,15 @@ int main(int argc, char *argv[])
sigaction(SIGHUP, &sa, NULL);
sigaction(SIGALRM, &sa, NULL);
+ /* write PID file so the user can signal us for device rescans */
+ pidfile = fopen("/var/run/mouseemu.pid", "w");
+ if (!pidfile) {
+ perror("mouseemu: can't open /var/run/mouseemu.pid");
+ exit(1);
+ }
+ fprintf(pidfile, "%d\n", pid);
+ fclose(pidfile);
+
/*we start only after we received the first sigusr1 from child:*/
sigemptyset(&mask);
++++++ mouseemu.rescan.patch ++++++
#! /bin/sh /usr/share/dpatch/dpatch-run
## 61_rescan.dpatch.dpatch by Michael Schmitz
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: rescan event devices on disconnects
@DPATCH@
---
mouseemu.8 | 16 ++++++++-
mouseemu.c | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
2 files changed, 102 insertions(+), 12 deletions(-)
--- a/mouseemu.8
+++ b/mouseemu.8
@@ -52,13 +52,20 @@ writeable the following devices are also
.B -nofork
don't run in the background
.TP
+.B -autorescan
+Automatically scan every 5s for new devices. This is normally not need, as udev should
+inform mouseemu about new devices.
+.TP
.B -help
show usage message
.PP
The key codes for the buttons and modifiers are key scancodes. They can be found in
include/linux/input.h in the kernel headers or by using `showkey` in a console. The
keycodes must be given as decimal values (`showkey` displays hex values!).
-
+.PP
+Mouseemu does normally not automatically scan for new devices. An udev rule is used
+to trigger a rescan when new devices are connected. You can also trigger a rescan
+manually by sending a HUP signal to the mouseemu process.
.SH EXAMPLES
.PP
To have the same behaviour as in MacOS X (CTRL-click for right mouse button and no
@@ -69,7 +76,12 @@ emulation for the middle button):
.RE
.PP
The code for the (left) mouse button is 272 (0x110 in hex). The code for CTRL is 29.
-
+.PP
+Trigger a rescan for newly attached devices:
+.PP
+.RS 4
+.B kill -HUP `cat /var/run/mouseemu.pid`
+.RE
.SH AUTHOR
Mouseemu was written by Colin Leroy
.nh
--- a/mouseemu.c
+++ b/mouseemu.c
@@ -19,6 +19,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -51,12 +52,14 @@ static int ui_keyb_fd = -1;
static int running = -1;
volatile sig_atomic_t answer = 1;
+volatile sig_atomic_t rescan = 0;
pid_t pid = -1;
-#define EVENT_DEVS 6
+#define EVENT_DEVS 32
static kdev eventdevs[EVENT_DEVS];
static input_handler ihandler[EVENT_DEVS];
-
+static int debug = 0;
+static int autorescan = 0;
static void send_event(int fd, int type, int code, int value)
{
@@ -224,12 +227,18 @@ void scan_for_devs()
ioctl(fd, EVIOCGBIT(0, EV_MAX), bit);
if (test_bit(EV_KEY, bit) && test_bit(EV_REP, bit)) {
ioctl(fd, EVIOCGID, id);
+ /* our own virtual keyboard (on rescans)*/
+ if (id[ID_PRODUCT] == 0x1F && id[ID_VENDOR] == 0x1F) {
+ close(fd);
+ continue;
+ }
if (id[ID_PRODUCT] != eventdevs[m].product ||
id[ID_VENDOR] != eventdevs[m].vendor) {
if (eventdevs[m].handle >= 0) {
unregister_inputhandler(eventdevs[m].handle);
close(eventdevs[m].handle);
}
+ if (debug) fprintf(stderr, "keyboard: fd %d event%d, vendor %4x product %4x\n", fd, n, id[ID_VENDOR], id[ID_PRODUCT]);
eventdevs[m].handle= fd;
eventdevs[m].product = id[ID_PRODUCT];
eventdevs[m].vendor = id[ID_VENDOR];
@@ -238,12 +247,18 @@ void scan_for_devs()
m++;
} else if (test_bit(EV_REL, bit)) {
ioctl(fd, EVIOCGID, id);
+ /* our own virtual mouse (on rescans)*/
+ if (id[ID_PRODUCT] == 0x1E && id[ID_VENDOR] == 0x1F) {
+ close(fd);
+ continue;
+ }
if (id[ID_PRODUCT] != eventdevs[m].product ||
id[ID_VENDOR] != eventdevs[m].vendor) {
if (eventdevs[m].handle >= 0) {
unregister_inputhandler(eventdevs[m].handle);
close(eventdevs[m].handle);
}
+ if (debug) fprintf(stderr, "mouse : fd %d event%d, vendor %4x product %4x\n", fd, n, id[ID_VENDOR], id[ID_PRODUCT]);
eventdevs[m].handle= fd;
eventdevs[m].product = id[ID_PRODUCT];
eventdevs[m].vendor = id[ID_VENDOR];
@@ -261,6 +276,27 @@ void scan_for_devs()
}
}
+void rescan_devs()
+{
+ int i, cfd;
+
+ for (i=0; i maxfd)
maxfd = ihandler[n].fd;
@@ -313,7 +349,7 @@ void call_inputhandler(fd_set *inset)
int n;
for (n=0; n < EVENT_DEVS; n++) {
- if (ihandler[n].fd == -1) break;
+ if (ihandler[n].fd == -1) continue;
if (FD_ISSET(ihandler[n].fd, inset))
ihandler[n].handler (ihandler[n].fd);
}
@@ -461,7 +497,7 @@ int uinput_setup(void)
void uinput_cleanup()
{
- int i;
+ int i, cfd;
printf("mouseemu: cleaning...\n");
@@ -470,8 +506,9 @@ void uinput_cleanup()
for (i=0; i 0) {
tv.tv_sec = 1; tv.tv_usec = 0;
maxfd = create_fdset(&inset);
- if ((val = select (maxfd+1, &inset, NULL, NULL, &tv)) >= 0) {
+ val = select (maxfd+1, &inset, NULL, NULL, &tv);
+ /* signal received, so rescan for devices when idle*/
+ if (val == 0 && rescan) {
+ rescan = 0;
+ rescan_devs();
+ }
+ if (val >= 0) {
if (val == 0)
usleep(10);
- else
- call_inputhandler(&inset);
+ else {
+ if (errno == ENODEV) {
+ if (debug) fprintf(stderr, "select returned %d, errno %d, rescanning devices\n", val, errno);
+ errno = 0;
+ rescan_devs();
+ usleep(500);
+ } else {
+ call_inputhandler(&inset);
+ }
+ }
}
/* tell the parent we are running without problems */
/* What should we do if the parent is dead? */
++++++ mouseemu.syslog.patch ++++++
#! /bin/sh /usr/share/dpatch/dpatch-run
## syslog.dpatch by Michael Schmitz
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: log to syslog instead of stderr
@DPATCH@
---
mouseemu.8 | 3 ++
mouseemu.c | 70 +++++++++++++++++++++++++++++++++++++++----------------------
2 files changed, 48 insertions(+), 25 deletions(-)
--- a/mouseemu.8
+++ b/mouseemu.8
@@ -56,6 +56,9 @@ don't run in the background
Automatically scan every 5s for new devices. This is normally not need, as udev should
inform mouseemu about new devices.
.TP
+.B -debug
+print debugging messages about device scans
+.TP
.B -help
show usage message
.PP
--- a/mouseemu.c
+++ b/mouseemu.c
@@ -18,12 +18,14 @@
#include
#include
+#include
#include
#include
#include
#include
#include
#include
+#include
#include
#include
#include
@@ -61,6 +63,17 @@ static input_handler ihandler[EVENT_DEVS
static int debug = 0;
static int autorescan = 0;
+/* print debug messages to syslog or stderr */
+void debugf(const char *format, ...) {
+ va_list ap;
+
+ if (debug) {
+ va_start(ap, format);
+ vsyslog(LOG_DEBUG, format, ap);
+ va_end(ap);
+ }
+}
+
static void send_event(int fd, int type, int code, int value)
{
struct input_event event;
@@ -238,7 +251,7 @@ void scan_for_devs()
unregister_inputhandler(eventdevs[m].handle);
close(eventdevs[m].handle);
}
- if (debug) fprintf(stderr, "keyboard: fd %d event%d, vendor %4x product %4x\n", fd, n, id[ID_VENDOR], id[ID_PRODUCT]);
+ debugf("keyboard: fd %d event%d, vendor %4x product %4x\n", fd, n, id[ID_VENDOR], id[ID_PRODUCT]);
eventdevs[m].handle= fd;
eventdevs[m].product = id[ID_PRODUCT];
eventdevs[m].vendor = id[ID_VENDOR];
@@ -258,7 +271,7 @@ void scan_for_devs()
unregister_inputhandler(eventdevs[m].handle);
close(eventdevs[m].handle);
}
- if (debug) fprintf(stderr, "mouse : fd %d event%d, vendor %4x product %4x\n", fd, n, id[ID_VENDOR], id[ID_PRODUCT]);
+ debugf("mouse : fd %d event%d, vendor %4x product %4x\n", fd, n, id[ID_VENDOR], id[ID_PRODUCT]);
eventdevs[m].handle= fd;
eventdevs[m].product = id[ID_PRODUCT];
eventdevs[m].vendor = id[ID_VENDOR];
@@ -373,27 +386,27 @@ int uinput_open_device(void)
{
int fd = -1;
- printf("Trying to open %s...", uinputdev);
+ syslog(LOG_NOTICE, "Trying to open %s...", uinputdev);
fd = open (uinputdev, O_RDWR);
- printf(" %s.\n", (fd > 0)?"ok":"error");
+ syslog(LOG_NOTICE, " %s.\n", (fd > 0)?"ok":"error");
if (fd > 0)
return fd;
- printf("Trying to open /dev/uinput...");
+ syslog(LOG_NOTICE, "Trying to open /dev/uinput...");
fd = open("/dev/uinput", O_RDWR);
- printf(" %s.\n", (fd > 0)?"ok":"error");
+ syslog(LOG_NOTICE, " %s.\n", (fd > 0)?"ok":"error");
if (fd > 0)
return fd;
- printf("Trying to open /dev/input/uinput...");
+ syslog(LOG_NOTICE, "Trying to open /dev/input/uinput...");
fd = open("/dev/input/uinput", O_RDWR);
- printf(" %s.\n", (fd > 0)?"ok":"error");
+ syslog(LOG_NOTICE, " %s.\n", (fd > 0)?"ok":"error");
if (fd > 0)
return fd;
- printf("Trying to open /dev/misc/uinput...");
+ syslog(LOG_NOTICE, "Trying to open /dev/misc/uinput...");
fd = open("/dev/misc/uinput", O_RDWR);
- printf(" %s.\n", (fd > 0)?"ok":"error");
+ syslog(LOG_NOTICE, " %s.\n", (fd > 0)?"ok":"error");
if (fd > 0)
return fd;
@@ -499,7 +512,7 @@ void uinput_cleanup()
{
int i, cfd;
- printf("mouseemu: cleaning...\n");
+ syslog(LOG_NOTICE, "mouseemu: cleaning...\n");
uinput_close(ui_keyb_fd);
uinput_close(ui_mouse_fd);
@@ -575,7 +588,8 @@ void usage(FILE *stream, char *argv[]) {
"\t[-typing-block DELAY]\n"
"\t[-device UINPUT_DEVICE]\n"
"\t[-nofork]\n"
- "\t[-autorescan]\n",
+ "\t[-autorescan]\n"
+ "\t[-debug]\n",
argv[0]);
fprintf(stream, "All modifier and button key arguments are\n"
"key scancodes. They can be found in \n"
@@ -608,8 +622,6 @@ int main(int argc, char *argv[])
int nofork = 0;
//int argv0size = strlen(argv[0]);
- printf("mouseemu " VERSION " (C) Colin Leroy \n");
-
install_sighandler();
#ifdef __powerpc__
@@ -694,23 +706,33 @@ int main(int argc, char *argv[])
autorescan=1;
i += 1;
continue;
+ }
+ else if (!strcmp(argv[i], "-debug")) {
+ debug=1;
+ i += 1;
+ continue;
} else {
usage(stderr, argv);
}
}
}
}
- printf("using (%d+%d) as middle button, (%d+%d) as right button, (%d) as scroll.\n",
+
+ if (nofork)
+ openlog("mouseemu", LOG_NDELAY | LOG_PERROR | LOG_PID, LOG_DAEMON);
+ else
+ openlog("mouseemu", LOG_NDELAY | LOG_PID, LOG_DAEMON);
+
+ syslog(LOG_NOTICE, "mouseemu " VERSION " (C) Colin Leroy \n");
+ syslog(LOG_NOTICE, "using (%d+%d) as middle button, (%d+%d) as right button, (%d) as scroll.\n",
b2_mod, b2_key, b3_mod, b3_key, scroll_mod);
- printf("using %s.\n", uinputdev);
-
if (nofork)
goto startops;
fpid = fork();
if (fpid == -1) {
- printf("can't fork\n");
+ syslog(LOG_NOTICE, "can't fork\n");
goto startops;
}
if (fpid != 0) {
@@ -720,7 +742,7 @@ int main(int argc, char *argv[])
setsid();
pid = fork();
if (pid == -1) {
- printf("can't fork\n");
+ syslog(LOG_NOTICE, "can't fork\n");
goto startops;
}
@@ -761,7 +783,7 @@ int main(int argc, char *argv[])
}
}
- printf("terminating, %i\n",answer);
+ syslog(LOG_NOTICE, "terminating, %i\n",answer);
if (kill(pid, SIGTERM)<0)
perror("mouseemu: termination of uinput handlers failed\n");
@@ -773,8 +795,6 @@ int main(int argc, char *argv[])
//strncpy(argv[0],"mouseemu",argv0size);
startops:
- if (nofork)
- debug = 1;
for (i=0; i
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: send error message to stderr if no uinput device is found
@DPATCH@
---
mouseemu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/mouseemu.c
+++ b/mouseemu.c
@@ -842,8 +842,8 @@ startops:
running = uinput_setup();
if (running < 0) {
- syslog(LOG_NOTICE, "Make sure uinput module is loaded or available "
- "in the kernel.\n");
+ fprintf(stderr, "No uinput device found! Make sure the uinput module is loaded\n"
+ "or CONFIG_INPUT_UINPUT is compiled into the kernel.\n");
}
++++++ mouseemu.unregister_inputhandler.patch ++++++
---
mouseemu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/mouseemu.c
+++ b/mouseemu.c
@@ -358,7 +358,7 @@ void unregister_inputhandler (int fd)
if (ihandler[n].grab)
ioctl(fd, EVIOCGRAB, 0);
}
- if (found)
+ if (found && n < EVENT_DEVS)
ihandler[n].fd = -1;
}
@@ -789,7 +789,7 @@ int main(int argc, char *argv[])
perror("mouseemu: can't open /var/run/mouseemu.pid");
exit(1);
}
- fprintf(pidfile, "%d\n", pid);
+ fprintf(pidfile, "%d\n", getpid());
fclose(pidfile);
/*we start only after we received the first sigusr1 from child:*/
++++++ mouseemu.usage.patch ++++++
#! /bin/sh /usr/share/dpatch/dpatch-run
## 31_usage.dpatch by
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: print usage message to stderr for wrong arguments
@DPATCH@
---
mouseemu.c | 106 +++++++++++++++++++++++++++++++++----------------------------
1 file changed, 59 insertions(+), 47 deletions(-)
--- a/mouseemu.c
+++ b/mouseemu.c
@@ -517,6 +517,31 @@ void install_sighandler(void)
}
+/* print usage message to stdout/stderr */
+void usage(FILE *stream, char *argv[]) {
+ fprintf(stream, "usage: %s \n"
+ "\t[-middle B2_MOD B2_KEY]\n"
+ "\t[-right B3_MOD B3_KEY]\n"
+ "\t[-scroll SCROLL_MOD]\n"
+ "\t[-typing-block DELAY]\n"
+ "\t[-device UINPUT_DEVICE]\n"
+ "\t[-nofork]\n",
+ argv[0]);
+ fprintf(stream, "All modifier and button key arguments are\n"
+ "key scancodes. They can be found in \n"
+ "/usr/src/linux/include/linux/input.h,\n"
+ "or by using `showkey` in a console.\n"
+ "Use decimal values. BTN_LEFT(272) is usable as "
+ "B2_KEY or B3_KEY.\n\n");
+ fprintf(stream, "Default uinput device: " DEFAULT_UINPUT ".\n");
+ fprintf(stream, "Default keys:\n"
+ "\tMiddle click : F10 (0 68)\n"
+ "\tRight click : F11 (0 87)\n"
+ "\tScroll mod. : Alt (56)\n"
+ "\tDefault blocking time while typing: 300ms\n");
+
+ exit(0);
+}
int main(int argc, char *argv[])
{
@@ -535,72 +560,59 @@ int main(int argc, char *argv[])
if (argc > 1) {
int i = 0;
if (!strcmp(argv[1],"-help")) {
-err:
- printf("usage: %s \n"
- "\t[-middle B2_MOD B2_KEY]\n"
- "\t[-right B3_MOD B3_KEY]\n"
- "\t[-scroll SCROLL_MOD]\n"
- "\t[-typing-block DELAY]\n"
- "\t[-device UINPUT_DEVICE]\n"
- "\t[-nofork]\n",
- argv[0]);
- printf("Key codes can be found in "
- "/usr/src/linux/include/linux/input.h,\n"
- "or by using `showkey` in console.\n"
- "Use decimal values. BTN_LEFT(272) is usable as "
- "B2_KEY or B3_KEY.\n\n");
- printf("Default uinput device: " DEFAULT_UINPUT ".\n");
- printf("Default keys:\n"
- "\tMiddle click : F10 (0 68)\n"
- "\tRight click : F11 (0 87)\n"
- "\tScroll mod. : Alt (56)\n"
- "\tDefault blocking time while typing: 300ms\n");
-
- exit(0);
+ usage(stdout, argv);
} else {
- for (i = 1; i < argc; i++) {
- int j = i+1;
+ i = 1;
+ while (i < argc) {
if (!strcmp(argv[i], "-middle")) {
- if (argc > j+1) {
- b2_mod = atoi(argv[j]);
- b2_key = atoi(argv[j+1]);
+ if (argc > i+2) {
+ b2_mod = atoi(argv[i+1]);
+ b2_key = atoi(argv[i+2]);
+ i += 3;
} else
- goto err;
+ usage(stderr, argv);
continue;
}
- if (!strcmp(argv[i], "-right")) {
- if (argc > j+1) {
- b3_mod = atoi(argv[j]);
- b3_key = atoi(argv[j+1]);
+ else if (!strcmp(argv[i], "-right")) {
+ if (argc > i+2) {
+ b3_mod = atoi(argv[i+1]);
+ b3_key = atoi(argv[i+2]);
+ i += 3;
} else
- goto err;
+ usage(stderr, argv);
continue;
}
- if (!strcmp(argv[i], "-scroll")) {
- if (argc > j) {
- scroll_mod = atoi(argv[j]);
+ else if (!strcmp(argv[i], "-scroll")) {
+ if (argc > i+1) {
+ scroll_mod = atoi(argv[i+1]);
+ i += 2;
} else
- goto err;
+ usage(stderr, argv);
continue;
}
- if (!strcmp(argv[i], "-typing-block")) {
- if (argc > j) {
- typing_block_delay = atoi(argv[j]);
+ else if (!strcmp(argv[i], "-typing-block")) {
+ if (argc > i+1) {
+ typing_block_delay = atoi(argv[i+1]);
+ i += 2;
} else
- goto err;
+ usage(stderr, argv);
continue;
}
- if (!strcmp(argv[i], "-device")) {
- if (argc > j) {
- uinputdev = argv[j];
+ else if (!strcmp(argv[i], "-device")) {
+ if (argc > i+1) {
+ uinputdev = argv[i+1];
+ i += 2;
} else
- goto err;
+ usage(stderr, argv);
continue;
}
- if (!strcmp(argv[i], "-nofork")) {
+ else if (!strcmp(argv[i], "-nofork")) {
nofork=1;
+ i += 1;
continue;
- }
+ } else {
+ usage(stderr, argv);
+ }
}
}
}
++++++ mouseemu.write_error.patch ++++++
#! /bin/sh /usr/share/dpatch/dpatch-run
## write_error.dpatch by
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fix write error detection
##
@DPATCH@
---
mouseemu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/mouseemu.c
+++ b/mouseemu.c
@@ -95,7 +95,7 @@ static void send_event(int fd, int type,
static void passthrough(int fd, struct input_event event)
{
- if (write(fd, &event, sizeof(event)) < sizeof(event))
+ if (write(fd, &event, sizeof(event)) <= 0)
perror("passthrough error");
}
++++++ rc.mouseemu ++++++
--- arch/ppc/mouseemu/rc.mouseemu 2005-08-02 10:27:41.000000000 +0200
+++ /mounts/work_src_done/STABLE/mouseemu/rc.mouseemu 2007-09-26 15:18:22.000000000 +0200
@@ -12,25 +12,25 @@
### BEGIN INIT INFO
# Provides: mouseemu
# Required-Start:
+# Should-Start: $remote_fs
# Required-Stop:
# Default-Start: 2 3 5
# Default-Stop: 0 1 6
-# Description: Start mouse button emulation for Mac
+# Description: Start mouse button emulation for Macintosh keyboards
### END INIT INFO
-# do nothing if the kernel doesnt support it
-if ! test -d /proc/sys/dev/mac_hid ; then exit 0 ; fi
-
# Source config
. /etc/sysconfig/mouseemu
DAEMON="mouse button emulation"
-DAEMON_PIDFILE=
+DAEMON_BIN=/usr/sbin/mouseemu
+DAEMON_PIDFILE=/var/run/mouseemu.pid
+DAEMON_OPTIONS="$MOUSEEMU_MID_CLICK $MOUSEEMU_RIGHT_CLICK $MOUSEEMU_SCROLL $MOUSEEMU_TYPING_BLOCK"
STARTPROC_LOGFILE=
SUPPORTS_HUP="no"
-#test -x $DAEMON_BIN || exit 5
+test -x $DAEMON_BIN || exit 5
# Shell functions sourced from /etc/rc.status:
# rc_check check and set local and overall rc status
@@ -63,25 +63,21 @@
case "$1" in
start)
+ modprobe -v uinput
echo -n "Starting $DAEMON"
-
- : ${MOUSE_BUTTON2:=87}
- : ${MOUSE_BUTTON3:=88}
- test "$2" = f12 && MOUSE_BUTTON2=0
- test "$2" = f11 && MOUSE_BUTTON3=0
-
- echo 1 > /proc/sys/dev/mac_hid/mouse_button_emulation
- echo $MOUSE_BUTTON2 > /proc/sys/dev/mac_hid/mouse_button2_keycode
- echo $MOUSE_BUTTON3 > /proc/sys/dev/mac_hid/mouse_button3_keycode
-
+ if test -f /proc/sys/dev/mac_hid/mouse_button_emulation
+ then
+ echo 0 > /proc/sys/dev/mac_hid/mouse_button_emulation
+ fi
+ startproc -p $DAEMON_PIDFILE $DAEMON_BIN $DAEMON_OPTIONS
+
# Remember status and be verbose
rc_status -v
;;
stop)
echo -n "Shutting down $DAEMON"
-
- echo 0 > /proc/sys/dev/mac_hid/mouse_button_emulation
-
+ killproc -G $DAEMON_BIN
+ rm -f $DAEMON_PIDFILE
# Remember status and be verbose
rc_status -v
;;
@@ -147,7 +143,7 @@
# NOTE: checkproc returns LSB compliant status values.
- (test `cat /proc/sys/dev/mac_hid/mouse_button_emulation` -eq 1 && exit 0 || exit 3)
+ checkproc -p $DAEMON_PIDFILE $DAEMON_BIN
rc_status -v
;;
probe)
++++++ sysconfig.mouseemu ++++++
--- arch/ppc/mouseemu/sysconfig.mouseemu 2002-02-18 04:02:39.000000000 +0100
+++ /mounts/work_src_done/STABLE/mouseemu/sysconfig.mouseemu 2007-10-04 11:29:37.000000000 +0200
@@ -1,13 +1,22 @@
+# Defaults for mouseemu initscript (/etc/init.d/mouseemu)
+# These are the default values on PowerPC. On all other architectures
+# middle and right click are disabled by default.
+# Key codes can be found in include/linux/input.h in the kernel headers
+# or by using `showkey` in a console.
+
+# 0 68 == F10 with no modifier
+# 0 87 == F11 with no modifier
+# 0 88 == F12 with no modifier
+# 29 272 == Left Ctrl + click
+# 125 272 == Left Apple Key (LEFTMETA) + click
+# 56 == Alt key
#
-# Keycode to use in order to emulate the middle mouse button:
-# If empty, the default (87) is used.
-# You only need to change this if you want to use a different key.
-#
-MOUSE_BUTTON2=""
-#
-# Keycode to use in order to emulate the right mouse button:
-# If empty, the default (88) is used
-# You only need to change this if you want to use a different key.
-#
-MOUSE_BUTTON3=""
+# -midle x y
+MOUSEEMU_MID_CLICK="-middle 0 87"
+# -right x y
+MOUSEEMU_RIGHT_CLICK="-right 0 88"
+# -scroll x y
+MOUSEEMU_SCROLL=
+# -typing-block n
+MOUSEEMU_TYPING_BLOCK=
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org