From 5f01a858b2a5e8030d68f782f5ba4a35659bc7af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 7 Jun 2008 12:50:37 +0000 Subject: [PATCH] * Check return code. * Make check slightly more readable. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25846 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/input/InputServer.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/servers/input/InputServer.cpp b/src/servers/input/InputServer.cpp index b5c8e3a678..8494caa658 100644 --- a/src/servers/input/InputServer.cpp +++ b/src/servers/input/InputServer.cpp @@ -1526,11 +1526,13 @@ InputServer::_SanitizeEvents(EventList& events) PRINT(("SanitizeEvents: %lx, %lx\n", fKeyInfo.modifiers, fKeyInfo.key_states[KEY_Spacebar >> 3])); - int8 byte = 0; - event->FindInt8("byte", &byte); + uint8 byte; + if (event->FindInt8("byte", (int8*)&byte) < B_OK) + byte = 0; + if (((fKeyInfo.modifiers & B_COMMAND_KEY) != 0 && byte == ' ') - || static_cast(byte) == B_ZENKAKU_HANKAKU) { - SetNextMethod(!fKeyInfo.modifiers & B_SHIFT_KEY); + || byte == B_KATAKANA_HIRAGANA) { + SetNextMethod(!(fKeyInfo.modifiers & B_SHIFT_KEY)); // this event isn't sent to the user events.RemoveItemAt(index);