Example in Timer does not works…

The example (extract below) set in Timer1.Action produce Beep(s) only.

[If](http://documentation.xojo.com/api/code_execution/if.html...Then...Else) Keyboard.AsyncKeyDown(123) [Then](http://documentation.xojo.com/api/code_execution/if.html...Then...Else)
Label1.Value = "left arrow key"
[End If](http://documentation.xojo.com/api/code_execution/if.html...Then...Else)

How do I Exit (Esc/27) / Stop (Space/32) / Resume (Space/32) a Timer ?

Make sure that the current focus is not on some control that also reacts to those keystrokes (or doesn’t and just plays a beep to tell you it doesn’t understand the keystroke).

1 Like

Actually, now that I think about it, a beep usually means that there is no control that has focus that can respond to the keystroke.

You are right… I think the only control on that window is a Canvas and I can remove it.

I added it when I do not saw my image(s) in the Window backdrop…

The comment for the Sample Code does not say anything useful if I recall correctly. Let me verify this…
I use Period = 5000 (5 seconds to watch each image).

Sample Code

A Timer can be used to monitor keydown events. The following code in the Action event of a Timer (Timer.RunModes.Multiple, Period = 100) detects whether the Up, Down, Left, or Right arrow keys are pressed.