Allow ignoring repeat events for a keybind
[mikachu/openbox.git] / openbox / config.c
index 8fd2dc0..e732011 100644 (file)
@@ -450,12 +450,14 @@ static void parse_key(xmlNodePtr node, GList *keylist)
     xmlNodePtr n;
     gboolean is_chroot = FALSE;
     gboolean grab = TRUE;
+    gboolean repeat = FALSE;
 
     if (!obt_xml_attr_string(node, "key", &keystring))
         return;
 
     obt_xml_attr_bool(node, "chroot", &is_chroot);
     obt_xml_attr_bool(node, "grab", &grab);
+    obt_xml_attr_bool(node, "repeat", &repeat);
 
     keys = g_strsplit(keystring, " ", 0);
     for (key = keys; *key; ++key) {
@@ -473,7 +475,7 @@ static void parse_key(xmlNodePtr node, GList *keylist)
 
                 action = actions_parse(n);
                 if (action)
-                    keyboard_bind(keylist, action, grab);
+                    keyboard_bind(keylist, action, grab, !repeat);
                 n = obt_xml_find_node(n->next, "action");
             }
         }
@@ -1009,7 +1011,7 @@ static void bind_default_keyboard(void)
     };
     for (it = binds; it->key; ++it) {
         GList *l = g_list_append(NULL, g_strdup(it->key));
-        keyboard_bind(l, actions_parse_string(it->actname), TRUE);
+        keyboard_bind(l, actions_parse_string(it->actname), TRUE, TRUE);
     }
 }