[Gambas-user] Global reading of events

Rolf-Werner Eilert eilert-sprachen at ...221...
Wed Apr 6 12:29:31 CEST 2011


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




More information about the User mailing list