[Pkg-sdl-commits] r63 - unstable/libsdl1.2/debian/patches
Samuel Hocevar
sho at costa.debian.org
Sun May 14 02:56:23 CEST 2006
Author: sho
Date: 2006-05-14 00:56:22 +0000 (Sun, 14 May 2006)
New Revision: 63
Modified:
unstable/libsdl1.2/debian/patches/016_x11_unicode_strings.diff
Log:
* Fixed the SDL Unicode key translation.
Modified: unstable/libsdl1.2/debian/patches/016_x11_unicode_strings.diff
===================================================================
--- unstable/libsdl1.2/debian/patches/016_x11_unicode_strings.diff 2006-05-13 23:36:25 UTC (rev 62)
+++ unstable/libsdl1.2/debian/patches/016_x11_unicode_strings.diff 2006-05-14 00:56:22 UTC (rev 63)
@@ -35,7 +35,7 @@
#define BROKEN_XFREE86_INTERNATIONAL_KBD
/* This appears to be a magical flag that is used with AltGr on
-@@ -710,15 +729,25 @@
+@@ -710,15 +729,26 @@
}
#endif
/* Look up the translated value for the key event */
@@ -55,14 +55,15 @@
+ else if ( chars > 1 ) {
+ /* UTF-8 */
+ int bytes = UTF8_trailing[(int)keybuf[0]];
++ char *s = keybuf;
+ Uint32 u = 0;
+
+ switch(bytes)
+ {
-+ case 3: u += (uint8_t)*s++; u <<= 6;
-+ case 2: u += (uint8_t)*s++; u <<= 6;
-+ case 1: u += (uint8_t)*s++; u <<= 6;
-+ case 0: u += (uint8_t)*s++;
++ case 3: u += (unsigned char)*s++; u <<= 6;
++ case 2: u += (unsigned char)*s++; u <<= 6;
++ case 1: u += (unsigned char)*s++; u <<= 6;
++ case 0: u += (unsigned char)*s++;
+ }
+
+ keysym->unicode = u - UTF8_offsets[bytes];
More information about the Pkg-sdl-commits
mailing list