[Gambas-user] Count the real time spent editing the data

Jussi Lahtinen jussi.lahtinen at gmail.com
Wed Mar 10 23:12:42 CET 2021


Wait... you need to restart the timer:

If fActivityStarted = -1 Then
fActivityStarted = Timer
ActivityTimer.Restart ''<-- here, not start, restart.
Endif

On Thu, Mar 11, 2021 at 12:09 AM Jussi Lahtinen <jussi.lahtinen at gmail.com>
wrote:

> Quickly thinking... Start timer in key event and stop it when x seconds
> have passed without activity.
> Something like this:
>
> This in some key event:
>
> If fActivityStarted = -1 Then
> fActivityStarted = Timer
> ActivityTimer.Start
> Endif
>
> And this for the started timer:
>
> Public Sub ActivityTimer_Timer() ''No activity for x seconds
> fTotalTime += Timer - fActivityStarted
> fActivityStarted = -1
> ActivityTimer.Enabled = False
> End
>
>
> Jussi
>
> On Wed, Mar 10, 2021 at 11:38 PM Martin <mbelmonte at belmotek.net> wrote:
>
>> Is there any way to know if a gambas program had keyboard activity from
>> when it was opened until it was closed?
>> It is to count the real time spent editing the data.
>>
>> Regards.
>>
>> Martín.
>>
>>
>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210311/92fcdb82/attachment-0001.htm>


More information about the User mailing list