[gtksourceview/wip/chergert/vim: 38/363] ignore some keyvals




commit 623e146b2609e220308debd37a62ff44535addba
Author: Christian Hergert <chergert redhat com>
Date:   Fri Oct 22 12:42:45 2021 -0700

    ignore some keyvals

 gtksourceview/vim/gtk-source-vim-normal.c | 33 +++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
---
diff --git a/gtksourceview/vim/gtk-source-vim-normal.c b/gtksourceview/vim/gtk-source-vim-normal.c
index e8fc3336..45a7174e 100644
--- a/gtksourceview/vim/gtk-source-vim-normal.c
+++ b/gtksourceview/vim/gtk-source-vim-normal.c
@@ -314,6 +314,39 @@ key_handler_initial (GtkSourceVimNormal *self,
 {
        g_assert (GTK_SOURCE_IS_VIM_NORMAL (self));
 
+       /* Ignore shift/control/etc keyvals */
+       switch (keyval)
+       {
+               case GDK_KEY_Shift_L:
+               case GDK_KEY_Shift_R:
+               case GDK_KEY_Shift_Lock:
+               case GDK_KEY_Caps_Lock:
+               case GDK_KEY_ISO_Lock:
+               case GDK_KEY_Control_L:
+               case GDK_KEY_Control_R:
+               case GDK_KEY_Meta_L:
+               case GDK_KEY_Meta_R:
+               case GDK_KEY_Alt_L:
+               case GDK_KEY_Alt_R:
+               case GDK_KEY_Super_L:
+               case GDK_KEY_Super_R:
+               case GDK_KEY_Hyper_L:
+               case GDK_KEY_Hyper_R:
+               case GDK_KEY_ISO_Level3_Shift:
+               case GDK_KEY_ISO_Next_Group:
+               case GDK_KEY_ISO_Prev_Group:
+               case GDK_KEY_ISO_First_Group:
+               case GDK_KEY_ISO_Last_Group:
+               case GDK_KEY_Mode_switch:
+               case GDK_KEY_Num_Lock:
+               case GDK_KEY_Multi_key:
+               case GDK_KEY_Scroll_Lock:
+                       return FALSE;
+
+               default:
+                       break;
+       }
+
        if ((mods & GDK_CONTROL_MASK) != 0)
        {
                switch (keyval)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]