GNU bug report logs - #24456
25.1; [PATCH] Caps-lock doesn't affect interpretation of key chords

Previous Next

Package: emacs;

Reported by: Dima Kogan <dima <at> secretsauce.net>

Date: Sun, 18 Sep 2016 07:02:02 UTC

Severity: minor

Tags: patch

Merged with 4931, 7637, 17781

Found in versions 24.0.50, 24.3, 25.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #13 received at 24456 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dima Kogan <dima <at> secretsauce.net>
Cc: 24456 <at> debbugs.gnu.org
Subject: Re: bug#24456: 25.1;
 [PATCH] Caps-lock doesn't affect interpretation of key chords
Date: Sun, 18 Sep 2016 17:41:50 +0300
> From: Dima Kogan <dima <at> secretsauce.net>
> Date: Sun, 18 Sep 2016 00:01:23 -0700
> 
> diff --git a/src/keyboard.c b/src/keyboard.c
> index b8bc361..a977de5 100644
> --- a/src/keyboard.c
> +++ b/src/keyboard.c
> @@ -5415,6 +5415,32 @@ make_lispy_event (struct input_event *event)
>  	EMACS_INT c = event->code;
>  	if (event->kind == ASCII_KEYSTROKE_EVENT)
>  	  {
> +            /* Caps-lock shouldn't affect interpretation of key chords:
> +               Control+s should produce C-s whether caps-lock is on or
> +               not.  And Control+Shift+s should produce C-S-s whether
> +               caps-lock is on or not. */
> +            if (event->modifiers & ~shift_modifier)
> +              {
> +                /* this is a key chord: some non-shift modifier is
> +                   depressed */
> +
> +                if ('A' <= c && c <= 'Z' &&
> +                    !(event->modifiers & shift_modifier) )
> +                  {
> +                    /* Got a capital letter without a shift.  The caps
> +                       lock is on.   Un-capitalize the letter */
> +                    c |= (unsigned)('a' - 'A');
> +                  }
> +                else if (('a' <= c && c <= 'z') &&
> +                         (event->modifiers & shift_modifier) )
> +                  {
> +                    /* Got a lower-case letter even though shift is
> +                       depressed.  The caps lock is on.  Capitalize the
> +                       letter */
> +                    c &= ~(unsigned)('a' - 'A');
> +                  }
> +              }
> +

Doesn't this mean that ASCII keys will behave differently from
non-ASCII when Caps Lock is ON?




This bug report was last modified 8 years and 216 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.