[gnome-builder] python indenter: fix triggering keys with modifer
- From: Sébastien Lafargue <slafargue src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] python indenter: fix triggering keys with modifer
- Date: Fri, 4 Aug 2017 21:45:45 +0000 (UTC)
commit 742a7009e3bff67307737149be64e20d66618e12
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]