tips
[Top] [All Lists]

REALbasic Tip: Is the user is pressing a command-arrow key combination?

To: "REALbasic Tips" <realbasic-tips at lists dot realsoftware dot com>
Subject: REALbasic Tip: Is the user is pressing a command-arrow key combination?
From: Geoff Perlman <geoff at realsoftware dot com>
Date: Wed, 22 May 2002 12:38:49 -0500
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>


<Prev in Thread] Current Thread [Next in Thread>
  • REALbasic Tip: Is the user is pressing a command-arrow key combination?, Geoff Perlman <=