keybind->keyval = keyval;
keybind->command = g_strdup(command);
- keys = g_slist_append(keys, keybind);
+ keys = g_slist_prepend(keys, keybind);
/* save the modkey also in the modkey string */
if (modkey) {
for (link = keys; link != NULL; link = link->next) {
Keybind* keybind = (Keybind*)link->data;
- if (keybind->mode == mode
+ if (keybind->keyval == keyval
&& keybind->modmask == modmask
&& keybind->modkey == modkey
- && keybind->keyval == keyval) {
+ && keybind->mode == mode) {
return link;
}
}