Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Re: Windows KeyCodes (Real Studio getting started Mailinglist archive)

Back to the thread list
Previous thread: Re: Office
Next thread: workaround for stringshape print bug


Re: Windows KeyCodes   -   Mark Turner
   RE: Windows KeyCodes   -   Dixon, Tom
  Re: Windows KeyCodes   -   Emile Schwarz

Re: Windows KeyCodes
Date: 01.02.06 08:19 (Tue, 31 Jan 2006 23:19:09 -0800)
From: Mark Turner
I cannot get the key codes for the F1 key to work with code provided on
the mac key map.
I have found that if I use Keyboard.AsyncDown(200) or key(200) then it
responds to a press of the F1 key.
I found the (200) code from browsing the forums at realbasic.com, I was
wondering how the person knew that but they never responded.
Is there a key map available for the Windows keyboard? I was also hoping
to make this app cross platform on windows and Linux.
Are the key codes different on RedHat or Novell Desktop?
Dixon, Tom wrote:
> Arrrggghh... My error. It did not appear to work but it did work when I
> tried it again. Feels like a Monday ...not Tuesday!
>
>> I find that hard to believe, since &h7B and 123 are exactly
>> the same number, just written in hexadecimal or decimal form.
>>
> _______________________________________________
> 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>

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

RE: Windows KeyCodes
Date: 01.02.06 14:33 (Wed, 1 Feb 2006 07:33:14 -0600)
From: Dixon, Tom
The Keyboard Map in the Language Reference does work Cross Platform. It
indicates the F1 key is &h7A so if you want to use Keyboard.AsyncKeyDown
then the proper form in the KeyDown event would be:

If Keyboard.AsyncKeyDown(&h7A)Then // Do Something

or the Decimal equivalent:

Keyboard.AsyncKeyDown(122) // Do Something

If you are using the Key As String return form the KeyDown event use:

If Key = Chr(200) Then // Do Something

HTH

Tom

> I cannot get the key codes for the F1 key to work with code
> provided on the mac key map.
> I have found that if I use Keyboard.AsyncDown(200) or
> key(200) then it responds to a press of the F1 key.
> I found the (200) code from browsing the forums at
> realbasic.com, I was wondering how the person knew that but
> they never responded.
_______________________________________________
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>

Re: Windows KeyCodes
Date: 01.02.06 19:51 (Wed, 01 Feb 2006 19:51:43 +0100)
From: Emile Schwarz
Hi Mark,

while I was reading your message (see below) I was thinking that we are not
talking about the same thing. So I will make a definition and we will start back
the discussion after that.

What is a KeyCode ?

A KeyCode is the hardware location of a key (every key) on a key board. That
value - I repeat: the hardware location of a key - is the same / invariable (its
a constant if you prefer).

As an example, take a keyboard, connect it to a Macintosh and get some key
codes. Add code in your REALbasic project, run it and it works fine.

OK. Now, put that project on a Memory Stick and copy it on a Windows machine.
Load the project with REALbasic, run it and you see that it works fine. Now,
boot a Linux (the flavor you like), load the project, run it and you see that it
works fine. Now, do the same with RedHat / Novell Desktop / whatever (if
REALbasic runs there) and you certainly will get the same results.

Now, I think that you understand "what really is a key code".

At this stage, I am asking (myself) what is your trouble.

To take an example:

<quote>
The following example tests whether the key for the letter "A" was pressed:

If Keyboard.AsynckeyDown( &h00) then
//do somthing with this key here
end if
</quote>

If you put a beep in the if / end if part, it will beep when you press the 'A'
letter on your keyboard. [tested on a Windows laptop]

NOW, I understand what kind of troubles you can get... The above code produce a
different behavior under Mac OS X: when I press the 'Q' letter, I get the Beep
where on the Windows laptop I have to press the 'A' letter.

Note that I have an AZERTY keyboard on both platforms...

After taking a look on the keyboard drawing of the pdf Language Reference, I can
say that there is a bug somewhere in the Windows version because that is the
Macintosh who is correct: &h00 = 'Q' letter on a French AZERTY keyboard; to get
the 'A' key on a French AZERTY keyboard I have to use &h0C.

REALbasic 2005r4 Standard
Windows XP SP2 Home Edition - French
Fujitsu-Siemens Amilo D7850

REALbasic 2005r4 Pro
Mac OS X 10.3.9
PowerBook G4 15" Alu, 1.5 GHz.

If I was wrong (read the top of this messsage), I want to say that I am sorry.

RS People, what happens ?

Cheers,

Emile

PS: to test what I wrote above, just use the example (between <quote> / </quote>
above).

<email address removed> wrote:
> Subject: Re: Windows KeyCodes
> From: Mark Turner <<email address removed>>
> Date: Tue, 31 Jan 2006 23:19:09 -0800
>
> I cannot get the key codes for the F1 key to work with code provided on
> the mac key map.
> I have found that if I use Keyboard.AsyncDown(200) or key(200) then it
> responds to a press of the F1 key.
> I found the (200) code from browsing the forums at realbasic.com, I was
> wondering how the person knew that but they never responded.
> Is there a key map available for the Windows keyboard? I was also hoping
> to make this app cross platform on windows and Linux.
> Are the key codes different on RedHat or Novell Desktop?

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