Lazarus

Programming => Packages and Libraries => KOL => Topic started by: JohnvdWaeter on January 15, 2009, 06:38:02 pm

Title: KOLPanel & OnClick
Post by: JohnvdWaeter on January 15, 2009, 06:38:02 pm
Hi all,

My app runs on a mobile device.
After some minutes, WinCE dims the screenlite to preserve battery.

Touching the screen restores screenlite.

However, I  use the KOLPanels OnClick event to perform some actions.

This action is now also triggered when the user just wants to restore lite to his screen.

How to detect if the lite is/was dimmed?

Using KOL-CE....

tia!
John
Title: Re: KOLPanel & OnClick
Post by: JohnvdWaeter on January 16, 2009, 08:49:55 am
Ok, found a workaround that seems to work, using a global var named TapMoment  in the onclick-event. User must double-tap the screen.

If tapped a second time between 0.1 and 0.5 seconds later, Dowork will execute;

if (TapMoment=0) or ((Gettickcount-TapMoment)>500) or ((Gettickcount-TapMoment)<100)
  then TapMoment := Gettickcount
  else
   begin
    TapMoment:=0;   
    .....
   DoWork;
    .....
   end;


John
TinyPortal © 2005-2018