You are not logged in.
Pages: 1
Topic closed
im trying to make mouseemu (http://geekounet.org/powerbook/files/mo … .16.tar.gz) work for arch. the mouseemu package supplies gentoo and debian daemon scripts.
how should they be modified so mouseemu can be used on arch?
these are the scripts:
debian:
#! /bin/sh
#
# init.d script for mouseemu
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/mouseemu
NAME=mouseemu
DESC="mouse emulation daemon"
test -x $DAEMON || exit 0
# Include mouseemu defaults if available
if [ -f /etc/default/mouseemu ] ; then
. /etc/default/mouseemu
MOUSEEMU_OPTS="$MID_CLICK $RIGHT_CLICK $SCROLL $TYPING_BLOCK"
fi
set -e
case "$1" in
start)
echo -n "Starting $DESC: "
modprobe -q uinput
# Give udev some time to create the device node
sleep 1
start-stop-daemon --start --quiet --exec $DAEMON -- $MOUSEEMU_OPTS >/dev/null
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --oknodo --retry 3 --quiet --exec $DAEMON >/dev/null
echo "$NAME."
;;
restart|force-reload)
echo -n "Restarting $DESC: "
start-stop-daemon --stop --oknodo --retry 3 --quiet --exec $DAEMON >/dev/null
start-stop-daemon --start --quiet --exec $DAEMON -- $MOUSEEMU_OPTS >/dev/null
echo "$NAME."
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0gentoo:
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
#MID_CLICK="-middle 0 68" #F10 with no modifier
#RIGHT_CLICK="-right 0 125" #Command with no modifier
#SCROLL="-scroll 56" #Option
#TYPING_BLOCK="-typing-block 300" #block mouse for 300ms after a keypress
depend() {
use logger
}
start() {
ebegin "Starting mouseemu"
# Source configuration file /etc/mouseemu.conf
if [ -f /etc/mouseemu.conf ] ; then
. /etc/mouseemu.conf
fi
start-stop-daemon --start --quiet
--exec /usr/sbin/mouseemu --
$MID_CLICK $RIGHT_CLICK $SCROLL $TYPING_BLOCK > /var/log/mouseemu.log
eend $?
}
stop() {
ebegin "Stopping mouseemu"
start-stop-daemon --stop --quiet --exec /usr/sbin/mouseemu
eend $?
}Offline
Take any standard Arch init script - let's say /etc/rc.d/portmap. Copy/rename it, and substitute /usr/sbin/mouseemu for /sbin/portmap, and mouseemu for portmap.
If you intend to use the $MID_CLICK, $RIGHT_CLICK, $SCROLL, and $TYPING_BLOCK variables, create /etc/conf.d/mouseemu, set them there (in the same format as the commented lines in the gentoo script), and add
. /etc/conf.d/mouseemuat the top of the init script, just after
. /etc/rc.d/functionsThat's it - one freshly-baked init script, to go. ![]()
Offline
Thanks! ok, I used the portmap script as a skeleton and replaced every instance of portmap with mouseemu, and /sbin/portmap with /usr/sbin/mouseemu.
But I am getting a message upon running "/etc/rc.d/mouseemu start", same message that I get if I run the mouseemu exec directly (both as root or as regular user):
open: No such file or directoryI also already have a /etc/conf.d/mouseemu file:
MID_CLICK="-middle 0 68" #F10 with no modifier
RIGHT_CLICK="-right 0 125" #Command with no modifier
SCROLL="-scroll 56" #Option
TYPING_BLOCK="-typing-block 300" #block mouse for 300ms after a keypressand this is the daemon script:
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
. /etc/conf.d/mouseemu
PID=`pidof -o %PPID /usr/sbin/mouseemu`
case "$1" in
start)
stat_busy "Starting mouseemu"
[ -z "$PID" ] && /usr/sbin/mouseemu
if [ $? -gt 0 ]; then
stat_fail
else
echo $PID > /var/run/mouseemu.pid
add_daemon mouseemu
stat_done
fi
;;
stop)
stat_busy "Stopping mouseemu"
[ ! -z "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm /var/run/mouseemu.pid
rm_daemon mouseemu
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0(I guess this might already be a program-specific problem?)
PS I changed the thread title.
Offline
by just glancing over this i think you have to compile mouseemu to use /etc/conf.d that arch uses. If that isn't possible make a symbolic link to the place it wants to open.
or grep the code for that place & change it & recompile(you could also sed it to change it permanently from a PKGBUILD for example)
if you were to run strace on this i suspect it would look like it's trying to open a place that doens't exist.
but then again i could be completely offguard ![]()
KISS = "It can scarcely be denied that the supreme goal of all theory is to make the irreducible basic elements as simple and as few as possible without having to surrender the adequate representation of a single datum of experience." - Albert Einstein
Offline
hmmm.
this is what mouseemu -h gives:
# mouseemu -h
usage: mouseemu
[-middle B2_MOD B2_KEY]
[-right B3_MOD B3_KEY]
[-scroll SCROLL_MOD]
[-typing-block DELAY]
[-device UINPUT_DEVICE]
[-nofork]
[-autorescan]
[-debug]
All modifier and button key arguments are
key scancodes. They can be found in
/usr/src/linux/include/linux/input.h,
or by using `showkey` in a console.
Use decimal values. BTN_LEFT(272) is usable as B2_KEY or B3_KEY.
Default uinput device: /dev/uinput.
Default keys:
Middle click : none (0 0)
Right click : none (0 0)
Scroll mod. : Alt (56)
Default blocking time while typing: 300msi tried some things (event1/mouse0 is the mouse)
please look at the last one:
# mouseemu -device /dev/input/event1
# ioctl UI_SET_KEYBIT: Invalid argument
# mouseemu -device /dev/input/mouse0
# ioctl UI_SET_KEYBIT: Inappropriate ioctl for device
# mouseemu -device /dev/input/mouse1
# ioctl UI_SET_KEYBIT: Inappropriate ioctl for device
# mouseemu -device /dev/input/event1 -nofork
mouseemu[1430]: mouseemu 0.15 (C) Colin Leroy <colin>
mouseemu[1430]: using (0+0) as middle button, (0+0) as right button, (56) as scroll.
mouseemu[1430]: Trying to open /dev/input/event1...
mouseemu[1430]: ok.
ioctl UI_SET_KEYBIT: Invalid argument
mouseemu[1430]: Make sure uinput module is loaded or available in the kernel.
mouseemu[1430]: mouseemu: cleaning...
#um, what does it mean? should I be using /dev/input/event1 in the first place?
Offline
The critical error message is
Make sure uinput module is loaded or available in the kernel.Modprobe uinput and try again. Assuming it works, add it to your MODULES array in /etc/rc.conf.
by just glancing over this i think you have to compile mouseemu to use /etc/conf.d that arch uses.
/etc/conf.d is the location Arch uses for settings like this - other distros put them elsewhere. There is no need to recompile - you just have to actually use the variables you have set. You have included them in the script
. /etc/conf.d/mouseemubut you need to add them to the start-up command, as in the gentoo script
/usr/sbin/mouseemu $MID_CLICK $RIGHT_CLICK $SCROLL $TYPING_BLOCKOffline
Thanks it works now!
Offline
This is an old thread, I know, but mouseemu still seems like the most straightforward way to map keys to virtual mouse buttons. However, running X Server 1.10.2 and Linux 2.6.38-ARCH x86_64, I could not get it to work. It did complain on open, which I think is missing config files, but according to threads elsewhere this can be safely ignored. I tried modprobeing uinput and various configurations without any luck. Here is how I wanted to assign AltGr+Click to middle click and menu+click to right click:
$ mouseemu -middle 100 272 -right 127 272
open: No such file or directoryOffline
got the same error when runing as normal user. mouseemu opens /dev/input/* as well as writes file to /var/run/ so it has to be run as a privileged user. After running it as a root it works fine.. tho it caused pommed demon to stop reating to F* keys.
Offline
Necro-bump of a necro-bump of a necro-bump. Time to start a new thread.
Closing.
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
Pages: 1
Topic closed