2

I want to make use of a Thinkpad trackpoint's thumb buttons which I almost never use in Emacs anyway. I'd like to use them as additional Controls in Emacs, and in Emacs only. I've found this answer, where it is pointed out that it may be possible to do just so:

One obstacle for a full equivalent to Control is that it would need to know both when it was held down and when it was released. Emacs keyboard events (unlike mouse events) don't get split into 'down' and 'up' parts, which makes 'released' hard for us to detect there.

However there were no example given and being an absolute beginner in Emacs Lisp I'm not quite sure what to do with it.

  • Under what operating system? You'll need the OS's collaboration to distinguish the thumb buttons. – Gilles 'SO- stop being evil' Dec 29 '18 at 8:39
  • @Gilles, only Linux. Although I thought as emacs interprets mouse actions itself it would be a cross-platform solution. – contemplator Dec 29 '18 at 8:53
2

I cannot give you the full answer but maybe a start. First, you need to find out what your thumb button is called inside Emacs. Eg. press C and then click into the minibuffer. You will most likely receive a message in your minibuffer like this C <mouse-x> is undefined. This way, you will also know whether Emacs recognizes your thumb button or not.

Then you can take a look at the Emacs documentation regarding Rebinding Mouse Buttons.

Please tell me if you could make it work!

  • They are recognized as usual mouse buttons, left as mouse-1, right as mouse-3. – contemplator Dec 29 '18 at 8:02
  • Is that one of those laptops with 2 left and 2 right mouse buttons (2 above and 2 below the touchpad), did I understand that correctly? Because if that is so then you have a problem. Because left mouse button (aka leftclick) is defined as <mouse-1>. Meaning that if you redefine that key, you also redefine your "normal" left mouse button. – beginner Dec 29 '18 at 8:11
  • Yes, it is. I'm aware that I won't be able to use them as mouse buttons then, not a big loss in emacs for me. – contemplator Dec 29 '18 at 8:39
  • I guess there is a hack/workaround. If you do not want to use your C and but only as your mouse-1, you could just swap them. Take a look at this question, please! – beginner Dec 29 '18 at 8:53
  • I would like to have them as additional Controls, because I still would use those occasionally. And as I understand it key-translation-map wouldn't work with modifiers because they are kinda "special"? – contemplator Dec 29 '18 at 9:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.