[gnome-builder/gnome-builder-3-24] python indenter: fix triggering keys with modifer
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-3-24] python indenter: fix triggering keys with modifer
- Date: Tue, 29 Aug 2017 20:01:42 +0000 (UTC)
commit 393ec94adb69ee704863a5cc3330810c85e6f39b
Author: Sebastien Lafargue <slafargue gnome org>
Date: Fri Aug 4 23:42:04 2017 +0200
python indenter: fix triggering keys with modifer
The previous commit 75943d2 was wrong but we need
to add modifiers filtering so that e or f with
shift, control or alt are not grabbed by the indenter
plugins/python-pack/ide-python-indenter.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/plugins/python-pack/ide-python-indenter.c b/plugins/python-pack/ide-python-indenter.c
index 7c13dac..9272957 100644
--- a/plugins/python-pack/ide-python-indenter.c
+++ b/plugins/python-pack/ide-python-indenter.c
@@ -762,10 +762,18 @@ static gboolean
ide_python_indenter_is_trigger (IdeIndenter *indenter,
GdkEventKey *event)
{
+ guint modifier_state;
+
+ modifier_state = gdk_keymap_get_modifier_state (gdk_keymap_get_default ());
+ if (modifier_state & GDK_SHIFT_MASK ||
+ modifier_state & GDK_CONTROL_MASK ||
+ modifier_state & GDK_MOD1_MASK)
+ return FALSE;
+
switch (event->keyval)
{
- case GDK_KEY_colon:
- case GDK_KEY_space:
+ case GDK_KEY_e:
+ case GDK_KEY_f:
case GDK_KEY_KP_Enter:
case GDK_KEY_Return:
return TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]