blob: c58f04218c83eaa36347b5cffc7e5deb920b4849 [file] [log] [blame]
diff -urN mozc-1.4.1033.102.orig/unix/ibus/ibus_extra_keysyms.h mozc-1.4.1033.102/unix/ibus/ibus_extra_keysyms.h
--- mozc-1.4.1033.102.orig/unix/ibus/ibus_extra_keysyms.h 1970-01-01 09:00:00.000000000 +0900
+++ mozc-1.4.1033.102/unix/ibus/ibus_extra_keysyms.h 2012-12-19 11:52:50.213523426 +0900
@@ -0,0 +1,51 @@
+// Copyright 2010-2012, Google Inc
+// All rights reserved
+//
+// Redistribution and use in source and binary forms, with or withou
+// modification, are permitted provided that the following conditions ar
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef MOZC_UNIX_IBUS_IBUS_EXTRA_KEYSYMS_H_
+#define MOZC_UNIX_IBUS_IBUS_EXTRA_KEYSYMS_H_
+
+// for guint
+#include <ibus.h>
+
+#ifdef OS_CHROMEOS
+// Defines key symbols which are not defined on ibuskeysyms.h to handle
+// some keys on ChromeOS.
+const guint IBUS_Back = 0x1008FF26;
+const guint IBUS_Forward = 0x1008FF27;
+const guint IBUS_Reload = 0x1008FF73;
+const guint IBUS_LaunchB = 0x1008FF4B;
+const guint IBUS_LaunchA = 0x1008FF4A;
+const guint IBUS_MonBrightnessDown = 0x1008FF03;
+const guint IBUS_MonBrightnessUp = 0x1008FF02;
+const guint IBUS_AudioMute = 0x1008FF12;
+const guint IBUS_AudioLowerVolume = 0x1008FF11;
+const guint IBUS_AudioRaiseVolume = 0x1008FF13;
+#endif // OS_CHROMEOS
+
+#endif // MOZC_UNIX_IBUS_IBUS_EXTRA_KEYSYMS_H_
diff -urN mozc-1.4.1033.102.orig/unix/ibus/key_translator.cc mozc-1.4.1033.102/unix/ibus/key_translator.cc
--- mozc-1.4.1033.102.orig/unix/ibus/key_translator.cc 2012-03-26 17:39:16.000000000 +0900
+++ mozc-1.4.1033.102/unix/ibus/key_translator.cc 2012-12-19 11:40:20.564275049 +0900
@@ -32,6 +32,7 @@
#include <ibus.h>
#include "base/logging.h"
+#include "unix/ibus/ibus_extra_keysyms.h"
namespace {
@@ -85,6 +86,19 @@
{IBUS_Page_Up, mozc::commands::KeyEvent::PAGE_UP},
{IBUS_Page_Down, mozc::commands::KeyEvent::PAGE_DOWN},
+#ifdef OS_CHROMEOS
+ {IBUS_Back, mozc::commands::KeyEvent::F1},
+ {IBUS_Forward, mozc::commands::KeyEvent::F2},
+ {IBUS_Reload, mozc::commands::KeyEvent::F3},
+ {IBUS_LaunchB, mozc::commands::KeyEvent::F4},
+ {IBUS_LaunchA, mozc::commands::KeyEvent::F5},
+ {IBUS_MonBrightnessDown, mozc::commands::KeyEvent::F6},
+ {IBUS_MonBrightnessUp, mozc::commands::KeyEvent::F7},
+ {IBUS_AudioMute, mozc::commands::KeyEvent::F8},
+ {IBUS_AudioLowerVolume, mozc::commands::KeyEvent::F9},
+ {IBUS_AudioRaiseVolume, mozc::commands::KeyEvent::F10},
+#endif // OS_CHROMEOS 83
+
// Keypad (10-key).
{IBUS_KP_0, mozc::commands::KeyEvent::NUMPAD0},
{IBUS_KP_1, mozc::commands::KeyEvent::NUMPAD1},