Pages - Menu

Sunday, March 11, 2012

mapping middle-click to a keyboard key under fedora

By far the most popular post on this blog was my old mapping middle-click to a keyboard key trick, which worked well under Ubuntu at the time.

Since then I've switched to Fedora which doesn't package old X11 tools like xkbset. However, this is such a useful thing to have on a laptop I've found a way.

We'll need the xdotool package, so yum install xdotool.

Then under the settings of your Window Manager, simply create a shortcut to xdotool click 2.

Under the default Gnome 3 desktop, this is in the Keyboard page of gnome-control-center.

Under Openbox, we'd add an entry to rc.xml like this
<keybind key="Menu">
  <action name="Execute">
    <command>xdotool click 2</command>
  </action>
</keybind>
And we're done!

xdotool can actually do a whole heap more than just emulate keyboard and mouse events, check out the author's webpage for more info!