From keypress to character - how?

  • Thread starter Ciarán Ó Duibhín
  • Start date
C

Ciarán Ó Duibhín

I'm trying to understand the process by which a keypress results in a
character (in XP).

I guess, first of all, the keypress gets converted to a Unicode value. This
part of the process can be influenced by using the Microsoft Keyboard Layout
Creator. So far so good.

Next, I guess, the Unicode value gets looked up in the current font. This
is where I'd like to monitor and then influence what happens, at least when
there is no character in the font at the Unicode value. Presently, what
happens on my machine is that the font is changed to Arial. I'd like to
keep the font but change the Unicode value.

I don't suppose there is a nice utility which will help me to do this? :)
If not, where can I read up about what happens at this point and what I need
to do to change it, eg. is there a message I need to intercept, and how do I
go about writing something to do that?

Many thanks,
Ciarán Ó Duibhín.
 
C

Ciarán Ó Duibhín

Thanks for all responses, but I still need advice about how to intervene in
the lookup of a character in a font by an application. Is there an API that
applications use for this? If so, is it GetGlyphOutline? If so, how can I
intercept calls to it? Or am I going at this all wrong?
 
S

Steve N.

Ciarán Ó Duibhín said:
Thanks for all responses, but I still need advice about how to intervene in
the lookup of a character in a font by an application. Is there an API that
applications use for this? If so, is it GetGlyphOutline? If so, how can I
intercept calls to it? Or am I going at this all wrong?

You'd have better luck asking in a programmer or developer newsgroup.

Steve
 
A

Alex Nichol

Ciarán Ó Duibhín said:
I'm trying to understand the process by which a keypress results in a
character (in XP).

I guess, first of all, the keypress gets converted to a Unicode value. This
part of the process can be influenced by using the Microsoft Keyboard Layout
Creator. So far so good.

No. For each keypress the hardware generates a 'scan code', which is
modified by the state of other keys - eg Shift or Ctrl. This is then
passed to the Windows keyboard driver you have selected, for example
'English UK' or 'United States International' which I suspect you use
to provide dead key effects for the accented characters in your name.
That then generates a single byte code in the character set you are
using - Western European (Windows) most probably. That can be seen if
you use the Character map utility.

It is only when you are using an application and save from that into a
font that uses Unicode that the characters get translated to the
Unicode set. Only if you are using the support for asian and similar
languages that cannot be represented without Unicode that Unicode comes
in any earlier; that would be with special keyboards to generate say the
Chinese characters
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top