Solved

virtual key code for spanish special characters

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

734 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