-2

I'd like to capture press and separately release of button 2 of my mouse. I wanted to use xbindkeys but afaik it doesn't give me such functionality. (does it?)

This: http://developers-blog.org/blog/default/2010/08/10/XServer-Event-Handling-C-Example more or less explains how this stuff works when it comes to writing it on my own. However when I added ButtonPressMask I get:

func: attach_to_focuswin
func: handle_event
X Error of failed request:  BadAccess (attempt to access private resource denied)
  Major opcode of failed request:  2 (X_ChangeWindowAttributes)
  Serial number of failed request:  8
  Current serial number in output stream:  8
Mat
  • 202,337
  • 40
  • 393
  • 406
neo
  • 791
  • 5
  • 7
  • I really suggest using a higher-level GUI toolkit library like Qt or Gtk. – Basile Starynkevitch Dec 15 '12 at 09:42
  • I've tried KDE Gestures and also easystroke but neither provides such capabilities (I need to distinguish between mouse press and mouse release) – neo Dec 15 '12 at 17:31
  • Both Qt (QWidget) and GTK (GtkWidget) are able to distinguish mouse press and mouse release. – Basile Starynkevitch Dec 15 '12 at 21:30
  • http://doc.qt.digia.com/qt/qwidget.html#mousePressEvent & http://developer.gnome.org/gtk3/3.6/GtkWidget.html#GtkWidget-button-press-event – Basile Starynkevitch Dec 15 '12 at 21:38
  • It's nice to know, thanks. However as my problem is caused by (probably) a bug in trackpoint wheel emulation - when enabled middle mouse button does not send press/release events as expected. – neo Dec 16 '12 at 10:35

1 Answers1

0

I've found that xbindkeys has such capabilities (+Release) but mouse wheel emulation (click and hold middle mouse button then move mouse up/down; in fact Trackpoint Wheel Emulation) makes strange things to events emitted by middle mouse button. In particular when I test it using xev only one event is reported there and if I click and hold middle mouse button then it's never reported (even after release)

neo
  • 791
  • 5
  • 7