OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/base/ime/input_method_ibus.h" | 5 #include "ui/base/ime/input_method_ibus.h" |
6 | 6 |
7 #include <ibus.h> | 7 #include <ibus.h> |
8 | 8 |
9 #include <X11/X.h> | 9 #include <X11/X.h> |
10 #include <X11/Xlib.h> | 10 #include <X11/Xlib.h> |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 return; | 646 return; |
647 } | 647 } |
648 | 648 |
649 // If a key event was not filtered by |context_| and |character_composer_|, | 649 // If a key event was not filtered by |context_| and |character_composer_|, |
650 // then it means the key event didn't generate any result text. So we need | 650 // then it means the key event didn't generate any result text. So we need |
651 // to send corresponding character to the focused text input client. | 651 // to send corresponding character to the focused text input client. |
652 client = GetTextInputClient(); | 652 client = GetTextInputClient(); |
653 | 653 |
654 const uint32 state = | 654 const uint32 state = |
655 EventFlagsFromXFlags(GetKeyEvent(native_event)->state); | 655 EventFlagsFromXFlags(GetKeyEvent(native_event)->state); |
656 uint16 ch = ui::DefaultSymbolFromXEvent(native_event); | 656 uint16 ch = ui::GetCharacterFromXEvent(native_event); |
657 if (!ch) { | 657 if (!ch) { |
658 ch = ui::GetCharacterFromKeyCode( | 658 ch = ui::GetCharacterFromKeyCode( |
659 ui::KeyboardCodeFromNative(native_event), state); | 659 ui::KeyboardCodeFromNative(native_event), state); |
660 } | 660 } |
661 | 661 |
662 if (client && ch) | 662 if (client && ch) |
663 client->InsertChar(ch, state); | 663 client->InsertChar(ch, state); |
664 } | 664 } |
665 | 665 |
666 void InputMethodIBus::ProcessUnfilteredFabricatedKeyPressEvent( | 666 void InputMethodIBus::ProcessUnfilteredFabricatedKeyPressEvent( |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 DCHECK_EQ(GetIBus(), bus); | 939 DCHECK_EQ(GetIBus(), bus); |
940 DCHECK(data); | 940 DCHECK(data); |
941 IBusInputContext* ic = | 941 IBusInputContext* ic = |
942 ibus_bus_create_input_context_async_finish(bus, res, NULL); | 942 ibus_bus_create_input_context_async_finish(bus, res, NULL); |
943 if (ic) | 943 if (ic) |
944 data->StoreOrAbandonInputContext(ic); | 944 data->StoreOrAbandonInputContext(ic); |
945 delete data; | 945 delete data; |
946 } | 946 } |
947 | 947 |
948 } // namespace ui | 948 } // namespace ui |
OLD | NEW |