From ba64d8928a8d7232cbea08357cf6d18d2bd1cf53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Sat, 10 May 2008 12:38:57 +0000 Subject: [PATCH] * added B_KATAKANA_HIRAGANA and B_ZENKAKU_HANKAKU (used in Japanese keymap) * Patch by Shinta: switch between input methods are now not only done with Alt+Space but Alt+Zenkaku/Hankaku. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25416 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/interface/InterfaceDefs.h | 5 ++++- src/servers/input/InputServer.cpp | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/headers/os/interface/InterfaceDefs.h b/headers/os/interface/InterfaceDefs.h index 4c4158ea39..637e848778 100644 --- a/headers/os/interface/InterfaceDefs.h +++ b/headers/os/interface/InterfaceDefs.h @@ -62,7 +62,10 @@ enum { B_PAGE_UP = 0x0b, B_PAGE_DOWN = 0x0c, - B_FUNCTION_KEY = 0x10 + B_FUNCTION_KEY = 0x10, + + B_KATAKANA_HIRAGANA = 0xf2, + B_ZENKAKU_HANKAKU = 0xf3 }; enum { diff --git a/src/servers/input/InputServer.cpp b/src/servers/input/InputServer.cpp index f6dc551ff3..b92c2f6742 100644 --- a/src/servers/input/InputServer.cpp +++ b/src/servers/input/InputServer.cpp @@ -1525,9 +1525,10 @@ InputServer::_SanitizeEvents(EventList& events) PRINT(("SanitizeEvents: %lx, %lx\n", fKeyInfo.modifiers, fKeyInfo.key_states[KEY_Spacebar >> 3])); - int8 byte; - if ((fKeyInfo.modifiers & B_COMMAND_KEY) != 0 - && event->FindInt8("byte", &byte) == B_OK && byte == ' ') { + int8 byte = 0; + event->FindInt8("byte", &byte); + if ((fKeyInfo.modifiers & B_COMMAND_KEY) != 0 + && (byte == ' ' || static_cast(byte) == B_ZENKAKU_HANKAKU)) { SetNextMethod(!fKeyInfo.modifiers & B_SHIFT_KEY); // this event isn't sent to the user