Need the name of a Key on the keyboard

I've searched, I'ved looked, I'ved asked, no one knows.. please someone, could u tell me what they key is called above the TAB and left of 1 and tell me the keybd_event name of it as well, VK_ something?

I don't know the name, its nuts I know its on my tip of my tonge and I just can't think of the name of that key, the one above TAB and left of 1 the one right in the left corner.

could someone please tell me the name and the keybd_event

Sal.
LVL 2
SaLzAsked:
Who is Participating?
 
Wim ten BrinkSelf-employed developerCommented:
On my system it's normally ` but ¬ if I press Shift too. With Alt Gr it becomes ¦ which is different from | since it has a small gap in the middle. (And | is above the \ on the left of the Z.)
In Dutch the ' is called the "Accent Aigu" and the ` the "Accent Grave" and since these words are from french origine, I assume they're called the same in English. But they're only called accents if they're combined with some other letter, preferably a vowel.

The ' and ` are also accessible through their ANSI codes... #39 for ' and #96 for `. There are no special VK_ names for them. However, depending on your keyboard settings it could happen that they're silent, to be merged with the next character that's going to be typed. In that case, they are dead keys. Dead keys generate a WM_KEYDOWN event that is translated to a WM_DEADCHAR message. The next keystroke will generate a WM_CHAR message that will contain the last-pressed character combined with the accent or other diacretic. If no combination is possible, two WM_CHAR messages are generated. One for the dead key that gets resurrected and one for the other key.
In general, let Windows handle these dead keys for you. It's easier. :-)

If you want to check for this key, the ASCII code is 96, so you could define this:

const
  VK_ACCENTGRAVE = 96;
  VK_ACCENTAIGU = 39;

and use above constants. But I think these codes conflict with the virtual keys defined by Windows. Virtual keys are, in general, special function keys while what you want are either dead keys or non-virtual keys.
0
 
EvarestCommented:
It seems that that specific key doesn't have a virtual key code. These virtual key codes are essentially constants which hide the ordinal of the character. In the case of your character it's 178.

For example:

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
 if key = chr(VK_RETURN) then ShowMessage('done');
end;


will show a message dialog if the Return key is being pressed.

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
 if key = chr(13) then ShowMessage('done');
end;

would do the same.

Thus in your case:

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
 if key = chr(178) then ShowMessage('done');
end;

will do the trick :-)

Cheers!
Evarest
0
 
sftwengCommented:
On my keyboard, the uppercase character is the "tilda" ~ and the lowercase is the opening single quote ` (distinct from the closing single quote ').
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
SaLzAuthor Commented:
on mine its ¬`¬¬¬¬```
0
 
robert_marquardtCommented:
Have a look at the functions MapVirtualKey and GetKeyNameText.
The key above Tab is '^' for a german keyboard and the letter is diacritic meaning it is a dead key.
0
 
Ivanov_GCommented:
Blah ... KeyDown shows 192 as a code and KeyPress - 96. The VK_ codes are from KeyDown (as I remember)...
0
 
Sergio_HdezCommented:
In spanish keyb it is  "º ª \" key... but just write a prog that, on keypress shows you the code of the key pressed, then you get your integer magic number!
0
 
snehanshuCommented:
Sal,
  If I understand correctly, you want to know what the character "~" is called.
  Well, ~ is tilda.
  And... there's an easy way to know the pronunciation of each character, here's what you can do:
  1. Start On Screen Keyboard:
  Start->All Programs->Accessories-> Accessibilities->On Screen Keyboard.

  2. Start Narator:
  Start->All Programs->Accessories-> Accessibilities->Narrator.

  Now, narrator will pronounce for you whatever character you click on or place your mouse cursor on.

  As others have pointed out, there is no VK_ equivalent of ~ in delphi, but the virtual key code is 192.

Cheers!
...Shu
0
 
SaLzAuthor Commented:
lol, guess everyones keyboard layout is diffrent :P am sorry 2 asume it would be the same lol
0
 
Delphi-LoverCommented:
Hello,

The word you looking for is "Tilde".
In many languages this sign is called this way.

Greets,

Delphi Lover.

The lines of the form alias <AE00> = <TLDE>; allow alternate names to be associated with the same key. In the example given, the tilde key, associated with the key code 49 in this keyboard can also be referred to as <AE00> as well as <TLDE>. This facility is useful if you want to refer, sometimes, to ``the leftmost key of the top row'' rather than ``the tilde key''.
0
 
SaLzAuthor Commented:
ok I got it 2 work, the code for ` is 96 in the ascii table, but whats the name of the ` marker, the ~ is the tilda, thats with my hash key, but if everybodys key layouts is diffrent, I'm guessing it doesn't matter anymore and its a real bummer, cos that key up in the top left is the key I want 2 use lol, will have 2 use the standard keys instead, or the numpads.

well, I thank u all for helpin me, u've showed me that the none standard keys are diffrent on all peoples keyboards, will have 2 make the program so the user can select there own key instead, it would make things easier as well, but more work on my part lol, u got any code 2 be able 2 do that, I may have 2 post another question for that later on :oD

Sal.
0
 
Wim ten BrinkSelf-employed developerCommented:
Yeah, keyboard layouts can be a real pain sometimes. Ever used a french AZERTY keyboard? :-) Yep, you guessed it, it even has the letter keys in a different order.
Besides, the number of keyboard layouts are quite huge. The country for which the keyboard is made also makes a big difference. E.g. the german keyboard is different from the Dutch keyboard, even though the languages use mostly the same characters. The ß for example is used often in the German language. Yet it's one of the characters with no fixed ASCII code. (It differs per font.) But the ß is located on the German keyboard. Norway and Sweden also have lots of diacretics in their languages but fortunately they don't need any real adjustments. Japanese and Chinese keyboards however are completely different though. The same is true for Arabic and Hebrew keyboards. If you have to keep track of the keyboard that is used then your development life becomes a real nightmare.

Add a THotkey component on your form. It's in the Win32 component palette. It's made especially to allow users to provide a valid hotkey.
0
 
robert_marquardtCommented:
To add to Workshop_Alex:
GetKeyNameText is also a PITA. It gives the localized names of the keys.
The tables to handle the names have been reimplemented for Windows 2000.
There are Bugs/differences in the tables like 'ü' instead of the correct 'Ü' for example.
Also many key names are in all uppercase.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.