[Gambas-user] Global reading of events
Sprachschule Eilert
eilert-sprachen at ...221...
Wed Apr 6 15:49:35 CEST 2011
Don't know where you're stuck. Why control Timer2? It's there, it's
running... :-)
Whenever Timer2 ticks, it checks if there have been mouse or keyboard
events in the meantime (Timer2EventZlr means "event counter for
Timer2"). If yes, only the counter is resetted. If not, "tab" (a
TabStrip which contains the data) is made invisible.
In case there is something wrong (just debug phase), Timer2 will make
tab appear the next time it comes by and reset the counter. This, of
course, will be replaced by a password input as soon as it is ready.
But my question was: Why do Form_KeyPress(), Form_MouseDown() and
Form_MouseWheel() catch no event? Aren't they an instance BEFORE all
other mouse and keyboard events within the form? If there is no way to
catch these, the only way to achieve this would be to monitor each
single thing on the form - I would like to avoid that.
Regards
Rolf
Am 06.04.2011 14:40, schrieb Jussi Lahtinen:
> What is Timer2EventZlr?
> I can't see any code that controls timer itself.
> Please send whole project.
>
> Jussi
>
>
> On Wed, Apr 6, 2011 at 13:29, Rolf-Werner Eilert<
> eilert-sprachen at ...221...> wrote:
>
>> I'd like to build something that hides areas with personally sensitive
>> data in a program after a time when the user didn't do anything in the
>> program.
>>
>> The easiest way to achieve this would be to watch all mouse and key
>> events for the whole program and just count. A timer would look from
>> time to time and if it's> 0 just reset the counter or otherwise hide
>> the sensitive area.
>>
>> I tried to do it this way:
>>
>> PUBLIC SUB Timer2_Timer()
>>
>> IF tab.Visible = TRUE THEN
>> IF Timer2EventZlr> 0 THEN
>> Timer2EventZlr = 0
>> ELSE
>> tab.Visible = FALSE
>> END IF
>>
>> ELSE 'for debugging purposes, lets it pop up again
>> tab.Visible = TRUE
>> Timer2EventZlr = 0
>>
>> END IF
>>
>> END
>>
>> PUBLIC SUB Form_KeyPress()
>>
>> INC Timer2EventZlr
>>
>> END
>>
>> PUBLIC SUB Form_MouseDown()
>>
>> INC Timer2EventZlr
>>
>> END
>>
>>
>>
>> PUBLIC SUB Form_MouseWheel()
>>
>> INC Timer2EventZlr
>>
>> END
>>
>> But it doesn't react. What am I doing wrong?
>>
>> Regards
>>
>> Rolf
>>
>>
>> ------------------------------------------------------------------------------
>> Xperia(TM) PLAY
>> It's a major breakthrough. An authentic gaming
>> smartphone on the nation's most reliable network.
>> And it wants your games.
>> http://p.sf.net/sfu/verizon-sfdev
>> _______________________________________________
>> Gambas-user mailing list
>> Gambas-user at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
> ------------------------------------------------------------------------------
> Xperia(TM) PLAY
> It's a major breakthrough. An authentic gaming
> smartphone on the nation's most reliable network.
> And it wants your games.
> http://p.sf.net/sfu/verizon-sfdev
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
--
Rolf-Werner Eilert
SPRACHSCHULE EILERT
Kollegienwall 19 - 49074 Osnabrück
www.eilert-sprachen.de - 0541/22653
More information about the User
mailing list