Re: Text Editor
- From: "Alan Carre" <alan@xxxxxxxxxxxxxxxxx>
- Date: Sun, 14 Dec 2008 04:59:35 +0700
"Giovanni Dicanio" <giovanniDOTdicanio@xxxxxxxxxxxxxxxxx> wrote in message
news:u5ChPoWXJHA.5980@xxxxxxxxxxxxxxxxxxxxxxx
Alex Blekhman wrote:
Wow! I have just looked at Italian layout here:
http://www.microsoft.com/globaldev/reference/keyboards.mspx
I must say that you have quite loaded keyboard layout.
I've just spent the last couple weeks dealing with EU keyboards and their
input. And I discovered, btw, that similar to the old ALT-NUMKEYPAD for
producing characters from the old OEM-ANSI character set (incidentally
CP-437 : terminal, same as a US/English cmd.exe 's code page), you can
generate any character from Windows Code Page-1252 (Western European) by
simply preceeding the NUMPAD digits with a zero. So, if you wanted character
232 from CP-1252 you hold down the alt key and press 0232 then release the
alt key, as I will now demonstrate: --> è <-- see!. That might sound like
no-great-shakes but CP-1252 happens to contain pretty-much every important
EU character if you look below:
http://en.wikipedia.org/wiki/Windows-1252
Best of all, notice that from 00 -> 0x7F cp1252 it's in 1-1 correspondence
with UNICODE, then from 0x80->0x9F it's mixed up a bit with some special
punctuation and things like O etc..., but after that it resumes it's 1-1
matching with UNICODE. So that includes everything from À -> Ý, then lower
case à -> ý as well as some of those german chars like ß etc. Also for
spanish you have Ñ and ñ (the "ny" sound). So you can type pretty much
everything EU with ALT-0NUM with NUM [0->255].
So I just always assume this code page when dealing with EU keyboards and
characters. There's a simple sequence of calls to convert scan-code +
keyboard layout to UNICODE from the extended key data (on WM_KEYDOWN) which
I then map back to cp-1252 to see what the hell that character is supposed
to look like (this is not windows controls, no fonts or anything, it's just
straight image drawing with Direct3D). So... thankfully, at present I don't
have to resort to converting everything to UNICODE to cover most EU
languages. Just a small portion of it, namely cp1252, does the trick!
- Alan Carre
.
- References:
- Text Editor
- From: Antonio Calò
- Re: Text Editor
- From: Giovanni Dicanio
- Re: Text Editor
- From: Alex Blekhman
- Re: Text Editor
- From: Giovanni Dicanio
- Text Editor
- Prev by Date: Re: Text Editor
- Next by Date: Re: Text Editor
- Previous by thread: Re: Text Editor
- Next by thread: Re: Text Editor
- Index(es):
Relevant Pages
|