Recent

Author Topic: KOLPanel & OnClick  (Read 4377 times)

JohnvdWaeter

  • Full Member
  • ***
  • Posts: 171
    • http://www.jvdw.nl
KOLPanel & OnClick
« 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

JohnvdWaeter

  • Full Member
  • ***
  • Posts: 171
    • http://www.jvdw.nl
Re: KOLPanel & OnClick
« Reply #1 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