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::GetCharacterFromXEvent(native_event); | 656 uint16 ch = 0; |
| 657 if (!(state & ui::EF_CONTROL_DOWN)) |
| 658 ch = ui::GetCharacterFromXEvent(native_event); |
657 if (!ch) { | 659 if (!ch) { |
658 ch = ui::GetCharacterFromKeyCode( | 660 ch = ui::GetCharacterFromKeyCode( |
659 ui::KeyboardCodeFromNative(native_event), state); | 661 ui::KeyboardCodeFromNative(native_event), state); |
660 } | 662 } |
661 | 663 |
662 if (client && ch) | 664 if (client && ch) |
663 client->InsertChar(ch, state); | 665 client->InsertChar(ch, state); |
664 } | 666 } |
665 | 667 |
666 void InputMethodIBus::ProcessUnfilteredFabricatedKeyPressEvent( | 668 void InputMethodIBus::ProcessUnfilteredFabricatedKeyPressEvent( |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 DCHECK_EQ(GetIBus(), bus); | 941 DCHECK_EQ(GetIBus(), bus); |
940 DCHECK(data); | 942 DCHECK(data); |
941 IBusInputContext* ic = | 943 IBusInputContext* ic = |
942 ibus_bus_create_input_context_async_finish(bus, res, NULL); | 944 ibus_bus_create_input_context_async_finish(bus, res, NULL); |
943 if (ic) | 945 if (ic) |
944 data->StoreOrAbandonInputContext(ic); | 946 data->StoreOrAbandonInputContext(ic); |
945 delete data; | 947 delete data; |
946 } | 948 } |
947 | 949 |
948 } // namespace ui | 950 } // namespace ui |
OLD | NEW |