Re: how to disable keys?

clemens fischer <[email protected]> Mon, 22 Jun 2009 21:37:38 +0200
Newsgroups gmane.network.tin.user
Message-ID <[email protected]>
Urs Janßen wrote:

> logic prevents the same key (NULL) to be assigned to different
> functions. first match (function; the order in the keymap file is not
> important, but the order in which the functions are parsed in the
> code) counts. if the key is already assigned to a diffrent function
> the laster function gets it's default key added.
>
> the following untedted pathc may work - or break remapping in total.
>
> --- keymap.c.o  2009-06-22 20:10:14.000000000 +0200
> +++ keymap.c    2009-06-22 20:10:22.000000000 +0200
> @@ -155,7 +155,7 @@
>        struct keynode *entry = NULL;
>
>        /* is a function already associated with this key */
> -       for (i = 0; i < keys->used; i++) {
> +       for (i = 0; key != '\0' && i < keys->used; i++) {
>                if (keys->list[i].key == key)
>                        entry = &keys->list[i];
>        }

I thought as much, but wondered if testing for a keybinding to be '\0'
being so easy and obvious, why is it not present here?

Making "NULL" effectively a command by allowing only one function to be
bound by it renderes its meaning of "unset this key" useless!

Anyway, the patch works as expected, and I really appreciate to see it
in the next release!  The version I currently test is 1.9.4, but the
code in 1.9.5 is the same.

Thanks for the very quick turnaround!


clemens