🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c++.leda
Article #138

get_button() not functioning (alternative ways to poll the mouse?)

#138
From: Sherif Ghali
Date: Tue, 17 Oct 1995 22:48
33 lines
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
Technical Details
Message-ID: <1995Oct17.184835.26738@jarvis.cs.toronto.edu>
Path: arc1-ca.pugleaf.net!dgp.toronto.edu!ghali

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!dgp.toronto.edu!ghali
Newsgroups: comp.lang.c++.leda
From: ghali@dgp.toronto.edu (Sherif Ghali)
Subject: get_button() not functioning (alternative ways to poll the mouse?)
X-Nntp-Posting-Host: titanic.dgp.toronto.edu
Message-ID: <1995Oct17.184835.26738@jarvis.cs.toronto.edu>
X-Newsreader: NN version 6.5.0 #8 (NOV)
Date: 17 Oct 95 22:48:35 GMT