You are not logged in.

#1 2010-10-26 01:15:23

male1
Member
Registered: 2010-10-26
Posts: 3

Map middle-click to keyboard shortcut?

I have an ASUS netbook, which like all netbooks, has a really funky mouse.

I'd love to be able to map [the middle button] to a hotkey, say the "Windows Key", so I could more easily cut and paste from applications like xterm.  I've looked through the documentation of xmodmap, but you only seem to be able to re-assign mouse keys to themselves, i.e. pointer = 3 2 1

Is there anyway to assign pointer click to a keypress, or more importantly, the other way around?

Thanks!

Last edited by male1 (2010-10-26 05:01:05)

Offline

#2 2010-10-26 01:18:34

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: Map middle-click to keyboard shortcut?

What window manager/desktop environment are you using? smile

Offline

#3 2010-10-26 02:29:29

Stebalien
Member
Registered: 2010-04-27
Posts: 1,239
Website

Re: Map middle-click to keyboard shortcut?

I don't have time to write a tutorial but I can point you in the right direction.
You will first need to remove Super (the windows key) from the Mod4 list (by default, it is a modifier like Control/Alt and can not be used by itself).
Next you will need to use something like gnome's built in keybinder or xbindkeys to execute a program to emulate a mouse button when you hit the Super key.
To emulate the mouse button, use something like xdotool (read it's manual).


Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C

Offline

#4 2010-10-26 05:01:54

male1
Member
Registered: 2010-10-26
Posts: 3

Re: Map middle-click to keyboard shortcut?

itsbrad212 wrote:

What window manager/desktop environment are you using? smile

Right now, I'm just plain ol' OpenBox v3.

Last edited by male1 (2010-10-26 05:02:17)

Offline

#5 2010-10-26 08:55:55

ferda
Member
Registered: 2010-02-05
Posts: 67

Re: Map middle-click to keyboard shortcut?

i know it's not what you asked for, but you could as well map the middle click to a corner of your touchpad:

synclient RTCornerButton = 2

would map the middle click to the right top corner of your touchpad.
if you want to make it permanent, you can add it as an option to your xorg.conf

Offline

#6 2010-10-26 13:31:39

Damnshock
Member
From: Barcelona
Registered: 2006-09-13
Posts: 414

Re: Map middle-click to keyboard shortcut?

Does "shift+insert" work for you? smile


My blog: blog.marcdeop.com
Jabber ID: damnshock@jabber.org

Offline

#7 2010-10-26 13:36:11

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: Map middle-click to keyboard shortcut?

You could do it using xdotool, I think.

Alternatively, using a tool like parcellite, annamnesis, etc.  (there are a few) you could sync. the CLIPBOARD and PRIMARY so that when you copy from xterm, CTRL+V will then work to paste in X. There are some usability issues with that (selecting text in a text box will overwrite the clipboard preventing pasting in on top) but most people are able to get a reasonable system sorted with a little tweaking.

EDIT: see here for some details http://standards.freedesktop.org/clipbo … ds-0.1.txt

Last edited by skanky (2010-10-26 13:37:04)


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#8 2010-10-27 01:26:11

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: Map middle-click to keyboard shortcut?

Damnshock wrote:

Does "shift+insert" work for you? smile

If it does, couldn't the middle button potentially be mapped (in rc.xml or something) to simulate a "Shift+Insert" key press?

Offline

#9 2010-10-27 04:19:28

male1
Member
Registered: 2010-10-26
Posts: 3

Re: Map middle-click to keyboard shortcut?

This is embaressing, but I had no idea about Shift + Insert. 

Problem solved!

Offline

#10 2010-10-27 18:03:46

reed9
Member
Registered: 2008-06-12
Posts: 77

Re: Map middle-click to keyboard shortcut?

If you still want to map it, this is how I did it.
http://linuxaleph.blogspot.com/2008/11/ … d-key.html

Offline

Board footer

Powered by FluxBB