[AD] Re: [AL] Allegro 4.2.0 beta1 released! |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: alleg-main@xxxxxxxxxx, alleg-developers@xxxxxxxxxx
- Subject: [AD] Re: [AL] Allegro 4.2.0 beta1 released!
- From: Elias Pschernig <allefant@xxxxxxxxxx>
- Date: Mon, 4 Apr 2005 19:39:49 +0200
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:references; b=A9JvVZrCwomb8o8cnbk1nsZi/o8OEKAgAc6EpqqWFicj0B92g+K0pmhQg9ZMj+mfCCWvi4bvqSVioCLAuLCNouczlbY2pm/3eprdcC1ziAuKe6vcM0vdggw8pdV4pIdktxliaGqJTgCNmCh5u5mryCBTh/FKXOauCoPZsqgbJw0=
Ok, attached is the patch. Cross-posting to [AD], so Evert and
possibly others see it. I can't test myself in win98, so need to wait
until someone tests this. In XP, the ToAscii version as well as the
ToUnicode version now report unicode characters, e.g. €.
HHDG: If you want to test the new version, tell me if you need the
complete file instead of just the patch, and I can send it to you.
--- C:\Dokumente und Einstellungen\root\Lokale Einstellungen\Temp\TCV61.tmp\wkeybd.1.29.c Mon Mar 28 23:25:09 2005
+++ C:\Dokumente und Einstellungen\root\Eigene Dateien\prog\allegro-cvs\src\win\wkeybd.c Mon Apr 04 19:33:13 2005
@@ -256,13 +256,23 @@
vkey = VK_RETURN;
}
- /* Nice, seems Windows has a function to just get the unicode character. */
- n = ToUnicode(vkey, scancode, keystate, chars, sizeof chars, 0);
- if (n == 1)
- {
+ if (os_type == OSTYPE_WIN95 || os_type == OSTYPE_WIN98) {
+ /* Seems, this actually works for 95 and 98. */
+ n = ToAscii(vkey, scancode, keystate, (WORD *)chars, 0);
+ if (n == 1)
+ {
+ WCHAR wstr[2];
+ MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, (LPCSTR)chars, n, wstr, sizeof wstr);
+ unicode = wstr[0];
+ }
+ }
+ else {
+ /* Nice, seems Windows XP has a function to just get the unicode character. */
+ n = ToUnicode(vkey, scancode, keystate, chars, sizeof chars, 0);
unicode = chars[0];
}
- else
+
+ if (n != 1)
{
/* Don't generate key presses for modifier keys. */
if (mycode >= KEY_MODIFIERS)