Message-ID: <33807861.775C@post.comstar.ru> Date: Mon, 19 May 1997 08:57:21 -0700 From: Dim Zegebart Reply-To: zager AT post DOT comstar DOT ru Organization: zager AT post DOT comstar DOT ru MIME-Version: 1.0 To: DJGPP Mail List Subject: Re: Double Click References: <01bc61a3$40e5d960$46c074cf AT ian> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk Ian Pitt wrote: > > I am writing a mouse routine using DJGPP but I am having trouble > implementing detection of a Double Click. Does anybody have any > suggestions? If you have timer handler with high resolution (like Allegro's one) declare global counter tick_counter and do tick_counter++ 'each' clock cicle, also declare variable last_left_click and set it to tick_counter value each left mouse click. Befor this assigment check last_left_click-tick_counter<=dbl_click_time : long tick_counter ... timer_handler () { tick_counter++; ... } ... mouse_handler () { static last_left_click=tick_counter; if ((last_left_click-tick_conter)<=dbl_click_time) { //dbl click last_left_click=tick_counter; return(); } last_left_click=tick_counter; } -- Regards, Dim Zegebart, Moscow Russia. Ghostly basement : http://www.geocities.com/siliconvalley/pines/7817