mapping mouse clicks to keystrokes in X ?

Lowell Gilbert freebsd-questions-local at be-well.ilk.org
Tue May 24 06:27:48 PDT 2005


Joe Schmoe <non_secure at yahoo.com> writes:

> I want my two mouse buttons to create the letters z
> and x when I press them, instead of the normal actions
> that those mouse buttons send to X.  Don't ask.
> 
> It's as simple as it sounds:  if I click mouse button
> one, it is as if I press z on the keyboard, if I click
> mouse button 2, it is as if I press x on the keyboard.
> 
> Does anyone know how to do this ?  I am looking at
> xmodmap, but even though it swaps mouse buttons
> around, and maps keys to other keys, I can't see how
> to make it map mouse buttons to keys...

In general terms:
  Use xev(1) to find the keycode for the buttons,
  then xmodmap(1) to reassign those to the desired keysyms.


More information about the freebsd-questions mailing list