Thread View: comp.lang.c++.leda
1 messages
1 total messages
Started by Sherif Ghali
Tue, 17 Oct 1995 22:48
get_button() not functioning (alternative ways to poll the mouse?)
Author: Sherif Ghali
Date: Tue, 17 Oct 1995 22:48
Date: Tue, 17 Oct 1995 22:48
33 lines
1343 bytes
1343 bytes
The code below should poll the mouse and return the coordinates of its
location. (get_button should return the coordinates of the cursor even
when no mouse button was pressed). LEDA-R 3.2.3 compiled with g++ 2.6.3
under solaris 2.3 on a sparc10 gives instead (0,0) for the coordinates:
button: 1 coords: 0 0
button: 2 coords: 0 0
button: 3 coords: 0 0
#include <iostream.h>
#include <LEDA/window.h>
main() {
window W;
int button;
double x, y;
while(1)
if( button = W.get_button( x,y ) )
cout << "button: " << button << " coords: " << x << " " << y << "\n";
}
If you have either encountered this problem and solved it or not
encountered it and are using a different configuration, I would be
glad to hear any suggestions you may have.
Note that read_mouse, the wait-for-a-mouse-button-press version, works fine.
Thanks in advance,
--
Sherif Ghali <ghali@dgp.toronto.edu>
Dynamic Graphics Project
University of Toronto
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads