Le 6 sept. 06 à 01:41 Matin, Aubrey Todd a écrit:
//These tell if a modifier key has been pressed
If Keyboard.AsyncControlKey then EditField3.Text="Control key"
If Keyboard.AsyncOSKey then EditField3.Text="Command key"
If Keyboard.AsyncAltKey then EditField3.Text="Option key"
If Keyboard.AsyncShiftKey then EditField3.Text="Shift key"
These tell if a modifier key IS pressed, right now, when the event
code
is firing -- not whether it was pressed when the event was generated.
Please use the non-Async versions instead for correct (reliable)
behavior.
Ok, never fully understood the difference in these commands.
Take an example: the user types shift-K while your app is temporarily
blocked (busy).
now, with that code in the KeyDown event:
if keyboard.asyncShiftKey then
msgbox "1"
end if
if keyboard.ShiftKey then
msgbox "2"
end if
you'll only see "2".
keyboard.ShiftKey checks if the shift key was down when the keystroke
occurred (in other words, this information is obtained from the data
of the key event, from the OS).
keyboard.AsyncShiftKey checks if the shift key is down when you call
it ("now").
Also, on a slow system, keyboard.AsyncShiftKey can return different
value than keyboard.ShiftKey even if the app is not busy. Therefore,
the difference is important.
Hope this helps._______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>