Commit f955c923 authored by Sam Lantinga's avatar Sam Lantinga

Fixed bug #147

Only enable Unicode key events if Unicode translation is enabled.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401881
parent 1f8047fa
......@@ -260,23 +260,27 @@ static void QZ_DoKey (_THIS, int state, NSEvent *event) {
contains multiple characters, we'll use 0 as
the scancode/keysym.
*/
chars = [ event characters ];
numChars = [ chars length ];
if (numChars == 1) {
if (SDL_TranslateUNICODE) {
chars = [ event characters ];
numChars = [ chars length ];
} else {
numChars = 0;
}
if (numChars == 0) {
key.scancode = [ event keyCode ];
key.sym = keymap [ key.scancode ];
key.unicode = [ chars characterAtIndex:0 ];
key.unicode = 0;
key.mod = KMOD_NONE;
SDL_PrivateKeyboard (state, &key);
}
else if (numChars == 0) {
else if (numChars == 1) {
key.scancode = [ event keyCode ];
key.sym = keymap [ key.scancode ];
key.unicode = 0;
key.unicode = [ chars characterAtIndex:0 ];
key.mod = KMOD_NONE;
SDL_PrivateKeyboard (state, &key);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment