The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.
SDL
Simple Directmedia Layer Forums
Patch: Implements ToUnicode() on 9x/ME/2K/XP for windib and
John Popplewell
Guest
Posted: Sat Jan 14, 2006 12:34 am
Hi,
I've been working on the Windows port for Tux Paint.
It was pointed out recently that simple keyboard composition doesn't
work properly using SDL on the Windows or X11 back-ends.
Simple composition is where a 'dead' key like an acute/grave accent is
followed by an e,a,o etc. resulting in a single character.
This means that users of languages other than English have problems with
general text entry in applications that use SDL e.g. Tux Paint and
probably most of the GUIs.
Rather than trying to implement a complete solution using IM/IME (which
would allow support of Chinese, Korean, Japanese and other languages), I
thought it would be useful to fix what are effectively bugs in the
current 'windib' and 'directx' back-ends.
Many of you will be familiar with the SDL_keysym 'unicode' field which
is supposed to contain a 16-bit Unicode character, but on the current
Windows back-ends is actually a code-page relative 8-bit number.
This patch fixes that and shouldn't affect existing applications too
much as they mostly use values < 128, which are unchanged.
The patch also fixes a couple of 'windib' problems: identifying the left
and right shift keys on Windows 9x/ME, and a problem with a missing
less-than/greater-than key found on international keyboards.
The patch is against current CVS, but would be easy to apply to the
current SDL-1.2.9.
I've tested it on a couple of Win98 systems (I don't have 95 or ME), 2K
and XP. I've tried with UK, US, Spanish, German, and Polish keyboard
layouts.
I'm hoping that it's possible for this to be applied to CVS,
best regards,
John Popplewell.
P.S. I'm looking at a patch for X11 and have something that nearly works :-)
-------------- next part --------------
Index: wincommon/SDL_lowvideo.h