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
This commit is contained in:
parent
1f8047fa4e
commit
f955c92364
1 changed files with 16 additions and 12 deletions
|
@ -260,19 +260,14 @@ static void QZ_DoKey (_THIS, int state, NSEvent *event) {
|
||||||
contains multiple characters, we'll use 0 as
|
contains multiple characters, we'll use 0 as
|
||||||
the scancode/keysym.
|
the scancode/keysym.
|
||||||
*/
|
*/
|
||||||
|
if (SDL_TranslateUNICODE) {
|
||||||
chars = [ event characters ];
|
chars = [ event characters ];
|
||||||
numChars = [ chars length ];
|
numChars = [ chars length ];
|
||||||
|
} else {
|
||||||
if (numChars == 1) {
|
numChars = 0;
|
||||||
|
|
||||||
key.scancode = [ event keyCode ];
|
|
||||||
key.sym = keymap [ key.scancode ];
|
|
||||||
key.unicode = [ chars characterAtIndex:0 ];
|
|
||||||
key.mod = KMOD_NONE;
|
|
||||||
|
|
||||||
SDL_PrivateKeyboard (state, &key);
|
|
||||||
}
|
}
|
||||||
else if (numChars == 0) {
|
|
||||||
|
if (numChars == 0) {
|
||||||
|
|
||||||
key.scancode = [ event keyCode ];
|
key.scancode = [ event keyCode ];
|
||||||
key.sym = keymap [ key.scancode ];
|
key.sym = keymap [ key.scancode ];
|
||||||
|
@ -281,6 +276,15 @@ static void QZ_DoKey (_THIS, int state, NSEvent *event) {
|
||||||
|
|
||||||
SDL_PrivateKeyboard (state, &key);
|
SDL_PrivateKeyboard (state, &key);
|
||||||
}
|
}
|
||||||
|
else if (numChars == 1) {
|
||||||
|
|
||||||
|
key.scancode = [ event keyCode ];
|
||||||
|
key.sym = keymap [ key.scancode ];
|
||||||
|
key.unicode = [ chars characterAtIndex:0 ];
|
||||||
|
key.mod = KMOD_NONE;
|
||||||
|
|
||||||
|
SDL_PrivateKeyboard (state, &key);
|
||||||
|
}
|
||||||
else /* (numChars > 1) */ {
|
else /* (numChars > 1) */ {
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue