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. > 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? Best, - Joe -- Joe Strout -- [EMAIL PROTECTED] Verified Express, LLC "Making the Internet a Better Place" http://www.verex.com/ _______________________________________________ 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>
