Solved

virtual key code for spanish special characters

Posted on 2003-10-24
3
266 Views
Last Modified: 2010-04-05
the user of my program should be able to enter the Spanish *inverted* ? and ! (HTML code ¿ and ¡) from any keyboard. I would like to use the keys F11 and F12 for the inverted ? and ! respectively.

Could you give me a code snipped that does the trick?

Thanks in advance
jupe

0
Comment
Question by:jupe
  • 2
3 Comments
 
LVL 4

Expert Comment

by:nestorua
ID: 9613757
HI,
I need to get more exact question: to enter in your own program (for example some memo or memos), or to make any computer to do that job (F11, F12 for spanish ! and ?).
If the first then write in OnKeyDown Event procedure of your Edit or Memo component the following code:
if ((Key=VK_F12) and (Shift=[])
 then Key:=161;
In that case you have spanish ? instead of F12.
Sincerely,
Nestorua.
0
 

Author Comment

by:jupe
ID: 9614202
Nestorua

I tried (Delphi 4):

procedure TForm1.DBEdit1KeyPress(Sender: TObject; var Key: Char);
begin
  if Key=Char(VK_Escape) then key:='A';
  if Key=Char(VK_F11) then key:='B';
end;

once with Form1.KeyPreview:=True and once with Form1.KeyPreview:=False;

VK_Escape works in both cases, VK_F12 doesn't.

The same with TForm1.DBEdit1.KeyDown

jupe

0
 
LVL 4

Accepted Solution

by:
nestorua earned 500 total points
ID: 9619169
HI, jupe,
Use the following code:
procedure TForm1.DBEdit1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if Key=VK_F11
   then DBEdit1.Perform(WM_CHAR, 161, 0);
end;
Sincerely,
Nestorua.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question