Monday, November 26, 2018

Linux and mouse buttons, assigning functions, VNC cut and paste







In most distros you can assign menu functions to mouse buttons via system settings.

What I'm wanting to do is make the left mouse button select and the right button paste.  Here's how:

 xmodmap ~/.xmodmap

and in the .xmodmap we have:

!
! Swap Caps_Lock and Control_L
!
keycode 109 = Multi_key
remove Lock = Caps_Lock
remove Control = Control_L
keysym Control_L = Caps_Lock
keysym Caps_Lock = Control_L
add Lock = Caps_Lock
add Control = Control_L
!
! mouse control
!
pointer = 1 3 2 4 5

The above first swaps the control and caps lock key, I grew up with Sun keyboards and that's the way it should be, next the "pointer" statement swaps the right and middle buttons for paste.

VNC cut and paste fun.  Most forums advise running vncconfig to resolve you cut and paste issues, however if you're running a Linux KDE desktop and multiple VNC viewer windows like I do, having vncconfig running on anywhere screws cut and paste up.  I found killing off vncconfig makes cut and paste between all windows work just fine.

Or not!  Further investigation seems to indicate KDE Klipper is the problem.  Having KDE running inside a VNC session seems to cause issues with cut and paste, killing Klipper seems to have fixed the problem.