[Top][All Lists]

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

Re: [PATCH] input: allow distinguishing shifted from unshifted Meta keys

From: Benno Schulenberg
Subject: Re: [PATCH] input: allow distinguishing shifted from unshifted Meta keystrokes
Date: Sun, 19 Jan 2020 20:21:08 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

Op 11-12-2019 om 01:36 schreef Brand Huntsman:
> The patch I've been using for a while adds an S modifier to bind shifted keys,
> M-S-A is shifted M-A.

Okay, I have overcome my dislike of the M-S-X format (or rather, of the
S-M-X format, because the Shift modifier should come first).  It is the
better solution because, as you said, it can be used without the user
having to set an option first, and without needing to edit any existing
custom M-<letter> binds.

So, I will accept a patch that implements the S-M-<letter> format, and
which also allows the Sh-M-<letter> format, because I find it clearer,
and the help text already shows Sh-Del, Sh-^Del, and Sh-Tab.

> +/* Parse key modifiers and the unmodified key. */
> +void key_modifiers_from_string(bool *meta, bool *shift, bool *ctrl,
> +     const char **keystring)
> +{
> +     const char *k = *keystring;

This local variable is not needed.

> +     if ((*meta = (k[0] != '\0' && k[1] == '-' && (k[0] | 32) == 'm')))
> +             k += 2;

Avoid assignment in an if statement.  Also, the first comparison is not
needed when the last is put first.


Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]