Hi Joe,

Subject: Re: Keyboard command
From: [EMAIL PROTECTED]
Date: Mon, 4 Sep 2006 19:36:25 -0600

On Sep 04, 2006, at 23:26 UTC, Aubrey Todd wrote:

Ok, Editfield1 is the input field for any key press, the following
code is in it's KeyDown event:

Function KeyDown(Key As String) As Boolean

//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.
   EditField2.Text=Str(Asc(Key)) //Gives the ASCII code for the key
pressed

  Keycode=?????(Key) //This is where I need help!
   EditField4.Text = Keyboard.Keyname( Keycode ) //Gives the names of
special keys

What is it you're trying to do here?  Get the name of the special key
that was pressed?  You can't do that; many special keys generate the
same character, if they generate any character at all.  You can test
for them using Keyboard.AsyncKeyDown, but it wouldn't be proper to do
this in a KeyDown event; do it in a Timer or some such instead.  For
the list of key codes, see the printed language reference (under
Keyboard).

If that's not what you're trying to do, then please explain what it is
you want.  Which key do you intend to display the name of, and
therefore need the code for?

This is just a utility program to address my being lazy and trying to learn at the same time. Sometimes I need to know the ASCII code for 'Right Arrow' or some other key so I run this program, press right arrow and there is my answer without having to look it up in a table. While I was going through the LR looking at the Keyboard commands, I saw the Keyname one and the list of keys it would give and I thought WOW, I can include that and get a lot more information, but, from your response, it does not sound like that will work

Thanks for your help,


Aubrey
PB G4 OS 10.4.7
RB 2006 Release 3


_______________________________________________
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>

Reply via email to