| www.delorie.com/archives/browse.cgi | search |
| From: | boylesgj AT lion DOT cs DOT latrobe DOT edu DOT au (Gregary J Boyles) |
| Newsgroups: | comp.lang.c++,comp.lang.c,comp.os.msdos.djgpp,comp.os.msdos.programmer,alt.msdos.programmer |
| Subject: | Detecting mouse double click. |
| Date: | 30 Sep 1996 09:58:59 GMT |
| Organization: | Comp.Sci & Comp.Eng, La Trobe Uni, Australia |
| Lines: | 35 |
| Distribution: | world |
| Message-ID: | <52o5l3$ft1@lion.cs.latrobe.edu.au> |
| NNTP-Posting-Host: | lion.cs.latrobe.edu.au |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Compiler : Borland C++
const int TimeOut=1000;
int Timer=0;
Poll mouse driver;
if button pressed
{
bool Done=false;
do
{
Poll mouse driver;
if same button pressed
{
double click;
Done=true;
}
else if (Timer==TimeOut)
Done=true;
else
{
Timer++;
}
}
while (!Done);
}
When a program containing the above loop is run and the mouse button is
double clicked the program sometimes hangs. I can easily show that it is
not stuck in any of my loops.
Does polling the mouse continually in quick succession cause any known
problems with mouse drivers?
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |