CoRD And Swapped Mouse Buttons: The Freedom To Be Particular

A few years ago I’ve swapped between my mouse’s right and left buttons n my XP laptop, this was due to a sports injury that I have long recovered from since, I however kept the mouse button swapped.
Even when setting up a new system much more recently I still set it up with the mouse buttons swapped.
partly because the mouse was already to the left of the keyboard, also known as sheer laziness but partly also because I enjoy the feeling of being able to get accustomed to a change,
and partly because I think it makes me use the mouse less and hence forces me to learn more keyboard shortcuts (not that my extensive and expending Emacs usage is not driving me in that direction anyway)

On the other hand at home my MacBook mouse buttons are not reversed.

It all nice and cozy until I try to use CoRD to remotely connect from my MacBook to my XP – then I have to remember to right click when I want to left click and vice versa and it’s very confusing,
I can operate a mouse with the buttons swapped (obviously: I do it every weekday) but it becomes natural to me only if it’s on the left of the keyboard.

So this brought me to a Stallman-esk moment where I had a piece of software that was generally functional but I had to extend it in a quirky way that is unique to me (and presumably of no interest to software owners),
luckily enough CoRD is an open source software and it took me under 30 minutes to hack it such that it will send a left button indication instead of right button and vice versa.

technically I just had to

1. get the source

svn co https://cord.svn.sourceforge.net/svnroot/cord/trunk CoRD

piece of cake.

2. find where the buttons are handled.

sort of piece of cake.
Now since this fix is so unique to me and my bizarre preferences that I don’t expect it to be useful enough to be worth even sending a patch back,
if anything it will clutter up the code or even worse the GUI (not that I expect anybody to actually accept such a fix let alone install it in the GUI),
since all of the above it became clear to me it’s not worthwhile looking for solutions that will fit elegantly in CoRD as a whole therefore I allowed myself to hack a solution: (in the preliminary meaning of the word ‘hacking’)
I just swapped the values of button 1 and button 2 in “constant.h” as follows:

/* mcradle hack: swap buttons to support reversed buttons on xp server

#define MOUSE_FLAG_BUTTON1 0x1000
#define MOUSE_FLAG_BUTTON2 0x2000
*/
#define MOUSE_FLAG_BUTTON1 0x2000
#define MOUSE_FLAG_BUTTON2 0x1000

3. compile and serve over a bed of lettuce

It took me longer to write this post to describe what I’ve done than it took me to actually modify the whole thing,
It made me think about our collective use of technology: as more and more software is involved we are able to tweak technology to
better fit our needs rather than to get used to how the technology was designed to begin with,
and for programmers it make sense to get out of their way to use open source software over proprietary one every time, because they *have the ability* to tweak stuff. (and even learn a trick or two along the way)
I’m still debating my (Philosophical, if you will) position on software and freedom but from pure practical stand point if I would to use a Microsoft close source client I just would have had to live with the way it works, like it or not.

Advertisements
This entry was posted in "software enginerring", CoRD, open source, OSX, productivity tools, remote and tagged , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s