Key-Down on Startup

Dear all,

code:
dim b1, b2 as boolean
b1 = Keyboard.ShiftKey
b2 = Keyboard.AltKey

If b1 and b2 Then

Aim:
On Startup, if shift or alt is pressed, the login-window should appear.
if not, it should login with saved password

Problem:
the code above works if the method is called on a open window, by klick on button or so.
But, if the same method is called on startup-event (Constructor), b1 and b2 are always true and it doesnt matter if the keys are pressed.

any ideas?

many thanks,
Christian

on Windows?
I think for those methods, you need to wait for first event loop run.

or use RemoteControlMBS module in MBS Plugins.

xojo.core.timer.calllater(0, ) will execute in the next event loop where ever it is called from.

Would the timer not need the first event loop itself?

yes. Timer runs in the first event loop run.