Mapping a mouse click to a keystroke - Xwindows
This is a discussion on Mapping a mouse click to a keystroke - Xwindows ; Hello all,
I have a question. After repeated searches though Google I'm still looking
for a way to map a mouse click to a keyboard event. Many people claim that you
can use IMwheel to do this but I've had ...
-
Mapping a mouse click to a keystroke
Hello all,
I have a question. After repeated searches though Google I'm still looking
for a way to map a mouse click to a keyboard event. Many people claim that you
can use IMwheel to do this but I've had no luck with it. Anyone have any ideas.
I'm using a Microsoft Intellimouse mouse and and far as I can tell xev reports
all the buttons are working. Running Xfree86 4.4.0 on FreeBSD 4.10. Thanks for
any help.
Chris
ChrisS1642@aol.com
-
Re: Mapping a mouse click to a keystroke
ChrisS1642 wrote:
> Hello all,
> I have a question. After repeated searches though Google I'm still looking
> for a way to map a mouse click to a keyboard event. Many people claim that
> you can use IMwheel to do this but I've had no luck with it. Anyone have any
> ideas. I'm using a Microsoft Intellimouse mouse and and far as I can tell
> xev reports all the buttons are working. Running Xfree86 4.4.0 on FreeBSD
> 4.10. Thanks for any help.
xev reports the event name, but the application (such as xterm) can interpret
the event in different ways. For xterm, it interprets buttons 4/5 (which
correspond to what some wheel mice send) using the translations resource.
Other applications may/may not do anything with those events. I have an
optical wheel mouse, which indeed does send the given events.
But I'm running on Linux - it seems (from reading the description of mouse
support) that there are differences between platforms on how the mouse
driver works.
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
-
Re: Mapping a mouse click to a keystroke
on ChrisS1642 wrote:
> Hello all,
>
> I have a question. After repeated searches though Google I'm still looking
> for a way to map a mouse click to a keyboard event. Many people claim that you
> can use IMwheel to do this but I've had no luck with it. Anyone have any ideas.
> I'm using a Microsoft Intellimouse mouse and and far as I can tell xev reports
> all the buttons are working. Running Xfree86 4.4.0 on FreeBSD 4.10. Thanks for
> any help.
>
> Chris
> ChrisS1642@aol.com
Hello,
I wrote a keymapd (daemon) that uses XRecord and XTest to do the
reverse. The mouse buttons were giving me RSI, and I'm left handed, so
I decided to write keymapd so that I could use the numpad keys 7,8,9 for
mouse buttons 1,2,3, and + and Enter on the numpad for scrolling. It
has helped, and generally works well (I'm using it now) enough (with the
KeySyms set to nothing for those afformentioned keys) provided that apps
don't interpret raw keycodes.
You could take my code and modify it for your needs. I actually have
some code in that file that was to be for remapping pointer events to
keyboard events, but I haven't finished it yet.
The code is in this tarball (see csrc/keymapd.c)
http://www.xmission.com/~georgeps/im...tick-68.tar.gz
Enjoy 
George
-
Re: Mapping a mouse click to a keystroke
Thanks to all who answered. I seem to have found my own solution while
trying to write my own application and searching though Google for XSendEvent
examples I came across xvkbd and xbindkeys. Xbindkeys can map a program to a
mouse button and xvkbd can stuff keypress events into the current windows
message buffer (via XSendEvent if you use the command line switch) together
they allow you to map button clicks to keyboard events.
Chris
ChrisS1642@aol.com