This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Copy and Paste actions with mouse hotkey

Tags: copy, paste, hotkey, xbindkeys copy, paste, hotkey, xbindkeys copy, paste, hotkey, xbindkeys
(comma "," separated)
User avatar
Vladimiroff
Registered Member
Posts
21
Karma
0
OS
Hello,
My mouse is Trust MI-2950R and instead of "default" buttons that have each mouse I have some extra-buttons. And there are two buttons for Zoom-in and Zoom-out, but I don't need this feature and wondering...is it possible, to make them for Copy and Paste?

I tried to assign them from the systemsettings, but it gets only keyboard shortcut. Is there a way to make these two buttons as Alternative hotkey?

KDE 4.3.0
Qt 4.4.2
Gentoo 2008.0
Kernel: 2.6.29

Thanks in advance o)


User avatar
Hans
Administrator
Posts
3304
Karma
24
OS
I don't think it's possible to configure in System Settings, but it should be possible using xbindkeys to bind the mouse button to a command and xte to emulate keyboard press. I use this trick to bind some mouse buttons (with left Super key pressed) to KWin effect, e.g.
Code: Select all
# Present windows
"xte 'keydown Super_L' 'key F10' 'keyup Super_L'"
    m:0x40 + c:133 + b:1

How familiar are you with these kind of tools?

By the way, in case you didn't know: text that you select are automatically copied to the clipboard, and you can paste it with the middle mouse button (usually scroll wheel).


Problem solved? Please click on "Accept this answer" below the post with the best answer to mark your topic as solved.

10 things you might want to do in KDE | Open menu with Super key | Mouse shortcuts
User avatar
Vladimiroff
Registered Member
Posts
21
Karma
0
OS
@Hans, I'm using xbindkeys and I'm kind of familiar with it, but I don't know how should I call the copy command, for example.

P.S: I know about this with select -> middleclick, but hate to use it...always mark something just while reading on some page... very useless :)


User avatar
Hans
Administrator
Posts
3304
Karma
24
OS
As said, you can use xte to do that, e.g.
Code: Select all
# Paste with ctrl-v
"xte 'keydown Control_L' 'key v' 'keyup Control_L'"
    b:6


I haven't tried it myself so I can't guarantee that it works. :p
If I remember correctly xte is part of xautomation (at least on Arch).


Problem solved? Please click on "Accept this answer" below the post with the best answer to mark your topic as solved.

10 things you might want to do in KDE | Open menu with Super key | Mouse shortcuts


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]