Solved

virtual key code for spanish special characters

Posted on 2003-10-24
3
257 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now