The example below demonstrates how to determine if the user is pressing
command and an arrow key even if no windows are open.
Put this code in the EnableMenuItems event of the Application class or a
window to see it work.
If Keyboard.AsyncKeyDown(123) then
MsgBox "left"
end if
If Keyboard.AsyncKeyDown(124) then
MsgBox "right"
end if
If Keyboard.AsyncKeyDown(125) then
MsgBox "down"
end if
If Keyboard.AsyncKeyDown(126) then
MsgBox "up"
end if
This tip was suggested by David Grogono.
--
Geoff Perlman
President & CEO
REAL Software, Inc.
http://www.realsoftware.com
mailto:geoff at realsoftware dot com
Phone: 512-263-1233 x711
Fax: 512-263-1441
- - - - - - - - - -
Got a useful tip to share? Send it to us at:
REALbasic-tips at lists dot realsoftware dot com dot
To unsubscribe from the Tips list, send an email to
<mailto:realbasic-tips-off at lists dot realsoftware dot com>
|