Unfortunately my middle mouse-button is broken. Is it possible to define a keyboard shortcut that'll do the same thing as the middle mouse-button (paste text from XA_PRIMARY)? (I'm using openbox for managing my windows.)

Thanks in advance!

1 Answer 1


You can use the "Shift + Insert" key bindings for most applications.
If you install the xdotool command, you can also send a click event on the command line.

$ xdotool click 2
  • 1
    Great, sending click events from the command line, now I can bind this to a keyboard shortcut. Thank you!
    – RazGo
    Commented Jun 11, 2015 at 19:37
  • Is there a way create the binding such that the mouse button is down while either shift or insert are pressed? I'm in a similar situation, and found that Blender can treat ALT presses this way, but I can't seem to figure out how to make that universal
    – J-Cake
    Commented Sep 8, 2022 at 9:33
  • @J-Cake Do you mean something like printf 'keydown shift\n click 1\n keyup shift\n' |xdotool - ?
    – mjy
    Commented Sep 8, 2022 at 11:48
  • actually almost. I'm looking for a solution which would let me drag with the middle mouse down. So, for the duration that the shortcut is active (all keys are down), the system treats the mouse wheel as depressed.
    – J-Cake
    Commented Sep 8, 2022 at 11:54
  • @J-Cake Perhaps xdotool mousedown 2 and xdotool mouseup 2 will help. In any case, I suggest posting it as a separate question.
    – mjy
    Commented Sep 8, 2022 at 12:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .