From 8ed554dbb80e12e824620c342d74ad595e89441a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 5 Feb 2008 07:30:50 +0000 Subject: [PATCH] Christian's comment: /* Actually returns a UInt32 containing two character codes (and two 'reserved' bytes), but we're only interested in the second (or only) one */ --- src/video/cocoa/SDL_cocoakeyboard.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/video/cocoa/SDL_cocoakeyboard.m b/src/video/cocoa/SDL_cocoakeyboard.m index 072d27413..2b51f0410 100644 --- a/src/video/cocoa/SDL_cocoakeyboard.m +++ b/src/video/cocoa/SDL_cocoakeyboard.m @@ -413,13 +413,13 @@ - (void) doCommandBySelector:(SEL) myselector {} continue; } - c = KeyTranslate (chr_data, i, &state); + c = KeyTranslate (chr_data, i, &state) & 255; if (state) { /* Dead key, process key up */ - c = KeyTranslate (chr_data, i | 128, &state); + c = KeyTranslate (chr_data, i | 128, &state) & 255; } - if (c != 0 && c != 0x10 && c < 256) { + if (c != 0 && c != 0x10) { /* MacRoman to Unicode table, taken from X.org sources */ static const unsigned short macroman_table[128] = { 0xc4, 0xc5, 0xc7, 0xc9, 0xd1, 0xd6, 0xdc, 0xe1,