From f91bbc04cd0ac0651575c8964e8ed6fc585eafe2 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Tue, 30 Jan 2024 17:37:51 +0800 Subject: [PATCH] Fix processKeyEvent methods again --- src/PYEditor.cc | 3 +++ src/PYEnglishEditor.cc | 3 +++ src/PYExtEditor.cc | 3 +++ src/PYFallbackEditor.cc | 3 +++ src/PYPDoublePinyinEditor.cc | 3 +++ src/PYPFullPinyinEditor.cc | 3 +++ src/PYPPhoneticEditor.cc | 3 +++ src/PYPPinyinEditor.cc | 3 +++ src/PYPSuggestionEditor.cc | 3 +++ src/PYPunctEditor.cc | 3 +++ src/PYTableEditor.cc | 3 +++ 11 files changed, 33 insertions(+) diff --git a/src/PYEditor.cc b/src/PYEditor.cc index 2b2f003b..a0b1d3a7 100644 --- a/src/PYEditor.cc +++ b/src/PYEditor.cc @@ -36,6 +36,9 @@ Editor::~Editor (void) gboolean Editor::processKeyEvent (guint keyval, guint keycode, guint modifiers) { + if (modifiers & IBUS_MOD4_MASK) + return FALSE; + modifiers &= (IBUS_CONTROL_MASK | IBUS_MOD1_MASK | IBUS_SUPER_MASK | diff --git a/src/PYEnglishEditor.cc b/src/PYEnglishEditor.cc index 408d2e35..7e6e52b3 100644 --- a/src/PYEnglishEditor.cc +++ b/src/PYEnglishEditor.cc @@ -44,6 +44,9 @@ EnglishEditor::~EnglishEditor () gboolean EnglishEditor::processKeyEvent (guint keyval, guint keycode, guint modifiers) { + if (modifiers & IBUS_MOD4_MASK) + return FALSE; + //IBUS_SHIFT_MASK is removed. modifiers &= (IBUS_CONTROL_MASK | IBUS_MOD1_MASK | diff --git a/src/PYExtEditor.cc b/src/PYExtEditor.cc index 4ff21739..44aecf0e 100644 --- a/src/PYExtEditor.cc +++ b/src/PYExtEditor.cc @@ -165,6 +165,9 @@ ExtEditor::setLuaPlugin (IBusEnginePlugin *plugin) gboolean ExtEditor::processKeyEvent (guint keyval, guint keycode, guint modifiers) { + if (modifiers & IBUS_MOD4_MASK) + return FALSE; + //IBUS_SHIFT_MASK is removed. modifiers &= (IBUS_CONTROL_MASK | IBUS_MOD1_MASK | diff --git a/src/PYFallbackEditor.cc b/src/PYFallbackEditor.cc index ec014e7c..b4b3a714 100644 --- a/src/PYFallbackEditor.cc +++ b/src/PYFallbackEditor.cc @@ -216,6 +216,9 @@ FallbackEditor::processPunct (guint keyval, guint keycode, guint modifiers) gboolean FallbackEditor::processKeyEvent (guint keyval, guint keycode, guint modifiers) { + if (modifiers & IBUS_MOD4_MASK) + return FALSE; + gboolean retval = FALSE; modifiers &= (IBUS_CONTROL_MASK | diff --git a/src/PYPDoublePinyinEditor.cc b/src/PYPDoublePinyinEditor.cc index cfe7531c..22aa401a 100644 --- a/src/PYPDoublePinyinEditor.cc +++ b/src/PYPDoublePinyinEditor.cc @@ -88,6 +88,9 @@ gboolean DoublePinyinEditor::processKeyEvent (guint keyval, guint keycode, guint modifiers) { + if (modifiers & IBUS_MOD4_MASK) + return FALSE; + /* handle ';' key */ if (G_UNLIKELY (keyval == IBUS_semicolon)) { if (cmshm_filter (modifiers) == 0) { diff --git a/src/PYPFullPinyinEditor.cc b/src/PYPFullPinyinEditor.cc index 0c6bf3e9..bd415720 100644 --- a/src/PYPFullPinyinEditor.cc +++ b/src/PYPFullPinyinEditor.cc @@ -70,6 +70,9 @@ FullPinyinEditor::processKeyEvent (guint keyval, guint keycode, guint modifiers) { + if (modifiers & IBUS_MOD4_MASK) + return FALSE; + /* handle 'A' - 'Z' key */ if (G_UNLIKELY (IBUS_A <= keyval && keyval <= IBUS_Z)) { if (cmshm_filter (modifiers) == 0) { diff --git a/src/PYPPhoneticEditor.cc b/src/PYPPhoneticEditor.cc index 9aacb434..00fa6105 100644 --- a/src/PYPPhoneticEditor.cc +++ b/src/PYPPhoneticEditor.cc @@ -201,6 +201,9 @@ PhoneticEditor::processFunctionKey (guint keyval, guint keycode, guint modifiers gboolean PhoneticEditor::processKeyEvent (guint keyval, guint keycode, guint modifiers) { + if (modifiers & IBUS_MOD4_MASK) + return FALSE; + return FALSE; } diff --git a/src/PYPPinyinEditor.cc b/src/PYPPinyinEditor.cc index 65f00f84..99efbe37 100644 --- a/src/PYPPinyinEditor.cc +++ b/src/PYPPinyinEditor.cc @@ -172,6 +172,9 @@ gboolean PinyinEditor::processKeyEvent (guint keyval, guint keycode, guint modifiers) { + if (modifiers & IBUS_MOD4_MASK) + return FALSE; + modifiers &= (IBUS_SHIFT_MASK | IBUS_CONTROL_MASK | IBUS_MOD1_MASK | diff --git a/src/PYPSuggestionEditor.cc b/src/PYPSuggestionEditor.cc index 402c5841..85c35ec9 100644 --- a/src/PYPSuggestionEditor.cc +++ b/src/PYPSuggestionEditor.cc @@ -62,6 +62,9 @@ SuggestionEditor::setLuaPlugin (IBusEnginePlugin *plugin) gboolean SuggestionEditor::processKeyEvent (guint keyval, guint keycode, guint modifiers) { + if (modifiers & IBUS_MOD4_MASK) + return FALSE; + //IBUS_SHIFT_MASK is removed. modifiers &= (IBUS_CONTROL_MASK | IBUS_MOD1_MASK | diff --git a/src/PYPunctEditor.cc b/src/PYPunctEditor.cc index 6babe13b..238ae72f 100644 --- a/src/PYPunctEditor.cc +++ b/src/PYPunctEditor.cc @@ -145,6 +145,9 @@ PunctEditor::processPunct (guint keyval, guint keycode, guint modifiers) gboolean PunctEditor::processKeyEvent (guint keyval, guint keycode, guint modifiers) { + if (modifiers & IBUS_MOD4_MASK) + return FALSE; + modifiers &= (IBUS_SHIFT_MASK | IBUS_CONTROL_MASK | IBUS_MOD1_MASK | diff --git a/src/PYTableEditor.cc b/src/PYTableEditor.cc index 1e461549..ddaab57b 100644 --- a/src/PYTableEditor.cc +++ b/src/PYTableEditor.cc @@ -47,6 +47,9 @@ TableEditor::~TableEditor () gboolean TableEditor::processKeyEvent (guint keyval, guint keycode, guint modifiers) { + if (modifiers & IBUS_MOD4_MASK) + return FALSE; + //IBUS_SHIFT_MASK is removed. modifiers &= (IBUS_CONTROL_MASK | IBUS_MOD1_MASK |