Solved

virtual key code for spanish special characters

Posted on 2003-10-24
3
268 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month9 days, 3 hours left to enroll

617 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