
Mouse click events in Linux
Posted Friday, 1 February, 2008 - 16:14 by Stevo14 inIt seems as though mouse events are not being triggered in my application although I don't know why this would be. I hook the events at the beginning of the application like this:
Mouse.ButtonDown += OnMouseDown;
Mouse.ButtonUp += OnMouseUp;
Am I missing something? Do I need to call ProcessEvents() inside OnUpdateFrame() ?
| Attachment | Size |
|---|---|
| debug.log | 3.41 KB |


Comments
There shouldn't be a need to
There shouldn't be a need to call ProcessEvents manually. Sounds like a bug.
A couple of questions:
a) which version are you using?
b) if it is 0.9.0 or higher, can you try the following?
Run Examples.exe, and press Ctrl+F1. Some new samples should show up, including one that reads "Test: Input Logger". Execute that, and select the "Mouse" tab from in the window that appears. Move your mouse over the small window - does it report its position? Click. Is the event reported?
a) I'm using 9.0 b)I
a) I'm using 9.0
b)I couldn't get Ctrl+F1 to work in the regular Examples.exe but I ran the input logger test from a day-old subversion copy and the mouse behaves just like in my application, the position gets reported but click events and delta times for the scroll wheel are missing.
If you need me to I can boot into windows and test things there.
I just tested on Windows,
I just tested on Windows, and it works.
Ok, I'll need some more information on your system:
a) build a debug version of OpenTK SVN, run a few examples from Example.exe (make sure to press some mouse buttons!) and attach the debug.log file here.
b) Do Examples.exe report any error information to the console? We are looking for X errors, which look like BadMatch, BadWindow etc.
c) which Linux distribution/version and which Mono version is this?
a/b) I built a debug version
a/b) I built a debug version from svn and tried a few examples.
The Input Logger would not run. Error:
Simple Window ran fine but when I closed the window I got this error:
c) Ubuntu 7.10; "mono --version" reports "Mono JIT compiler version 1.2.6 (tarball)"
Thanks, fixed the first
Thanks, fixed the first issue.
Can you please update from SVN and try Input Logger again? A debug.log file should be generated in the same folder - can you please attach that to the opening post (just edit it), after you run the Input Logger? It should contain information useful for debugging.
Edit: Ok, confirmed the issue. The strange thing it that a button event is reported if you press two keys at once. The stranger thing is that (I'm sure!) it worked just prior to the 0.9.0 release.
In any case I'll work on a fix during the weekend, the issue probably lies at the event handling code in Source/OpenTK/Platform/X11/X11Input.cs or X11Mouse.cs
Log attached. I also figured
Log attached.
I also figured something out while doing some test clicks for the log file. Click events are raised if (and only if) two mouse buttons are pressed. For example, if I click the left mouse button, nothing happens. If I then leave the left button down and press, say, the right mouse button, the click event is raised for the first button that was pressed (left in this case). The same goes if the middle button is pressed first and then the left mouse button. (The click event is raised for the middle button only after pressing the left button.) The behavior is rather strange, but it is atleast consistent. :)
EDIT: You beat me to the post.
Alright, fixed as of
Alright, fixed as of revision 1100 :)
Thanks for the bug-report!
No problem. Thanks for the
No problem. Thanks for the fix!