I would look into SDL_EnableUNICODE(int enable);
With SDL_EnableUNICODE(true) and probably SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL), you can test your SDL_Event keypress (assuming you already know how that works) with something like (event.key.keysym.unicode > minJapCharValue && event.key.keysym.unicode < maxJapCharValue) and then take the value with char input = (char)event.key.keysym.unicode;
You’ll probably want to use SDL_EnableUNICODE(false) when you’re done getting keyboard input.
This is fully cross-platform, but your user of course needs to be using a Japanese keyboard layout. An example for the value min and max for english/roman characters is 0 - 0x80. Japanese characters are probably up there in the mid-range of the unicode set. Google for a unicode map/table.
I would look into SDL_EnableUNICODE(int enable);
With SDL_EnableUNICODE(true) and probably
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY,
SDL_DEFAULT_REPEAT_INTERVAL), you can test your SDL_Event keypress
(assuming you already know how that works) with something
like (event.key.keysym.unicode > minJapCharValue &&
event.key.keysym.unicode < maxJapCharValue) and then take the value with
char input = (char)event.key.keysym.unicode;
You’ll probably want to use SDL_EnableUNICODE(false) when you’re done
getting keyboard input.
This is fully cross-platform, but your user of course needs to be using
a Japanese keyboard layout. An example for the value min and max for
english/roman characters is 0 - 0x80. Japanese characters are probably
up there in the mid-range of the unicode set. Google for a unicode
map/table.
Jonny D
Hello,
This is not what I want, I want a japanese input method where use type
into roman char and use the arrow keys or space bar or whatever to
choose the correct hiragana, katagana or kanji for the word.
Hi,On Mon, 20 Nov 2006 10:32:17 +0100 kuon - Nicolas Goy - ??? wrote:
This is not what I want, I want a japanese input method where use type
into roman char and use the arrow keys or space bar or whatever to
choose the correct hiragana, katagana or kanji for the word.
This is not what I want, I want a japanese input method where use type
into roman char and use the arrow keys or space bar or whatever to
choose the correct hiragana, katagana or kanji for the word.