[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: making mouse event with keys

On Mon, Apr 18, 2005 at 11:04:39AM +0200, Bernhard Reiter wrote:
> On Sun, Apr 17, 2005 at 01:03:46PM -0600, Mauro wrote:
> > On Sun, 2005-04-17 at 14:54 -0400, Tamas K Papp wrote:
> > > Hi,
> > > 
> > > In I11, I would like certain keys (F11, F12) to behave as if I pressed
> > > the mouse buttons 2 or 3.  Is it possible?
> Yes,
> the "showkey" or "xev" commands are your friends to find out 
> what numbers those keys produce.
> Next put them into the files in
> 	/proc/sys/dev/mac_hid# ls
> mouse_button2_keycode  mouse_button3_keycode  mouse_button_emulation
> echo 1 >mouse_button_emulation

Thanks for Mauro, Bernhard Reiter and Joerg Sommer for their help.
For the archives (if somebody has a similar problem), I chose to go
with the sysctl method, now my /etc/sysctl.conf has

# 3-button mouse emulation
# turn on emulation
/dev/mac_hid/mouse_button_emulation = 1
# Send middle mouse button signal with the F11 key
/dev/mac_hid/mouse_button2_keycode = 87
# Send right mouse button signal with the F12 key
/dev/mac_hid/mouse_button3_keycode = 88

which works nicely, assigning F11 and F12 to buttons 2 and 3.  The
keycodes produced by xev are different from the ones given by showkey,
and I had use the latter.  For some reason I thought this would require
gpm working, but apparently it does not because it is done by the



Reply to: