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
Solved

virtual key code for spanish special characters

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Convert Jpg /PNG To GIF 5 150
Press three keys together and trigger a function 3 60
Multiple image collision 13 80
I want to use librsync in my Delphi backup application. 3 59
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

861 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