GNU bug report logs - #38007
scroll-lock binding on Windows

Previous Next

Package: emacs;

Reported by: Juanma Barranquero <lekktu <at> gmail.com>

Date: Thu, 31 Oct 2019 17:48:01 UTC

Severity: normal

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 38007 in the body.
You can then email your comments to 38007 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#38007; Package emacs. (Thu, 31 Oct 2019 17:48:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juanma Barranquero <lekktu <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 31 Oct 2019 17:48:03 GMT) Full text and rfc822 format available.

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

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Bug-Gnu-Emacs <bug-gnu-emacs <at> gnu.org>
Subject: scroll-lock binding on Windows
Date: Thu, 31 Oct 2019 18:46:43 +0100
[Message part 1 (text/plain, inline)]
This is with 27.0.50, on Windows 10.

The binding of scroll-lock-mode on binding.el is:

  (define-key global-map [Scroll_Lock]    'scroll-lock-mode)

and the docstring of scroll-lock-mode says:

  Note that the default key binding to Scroll_Lock will not work on
  MS-Windows systems if ‘w32-scroll-lock-modifier’ is non-nil.

And the default value of w32-scroll-lock-modifier is nil:

  w32-scroll-lock-modifier is a variable defined in ‘C source code’.
  Its value is nil

But the Scroll Lock key does not generate a Scroll_Lock event, but scroll:

  <scroll> is undefined

Shouldn't the binding be to [scroll] on Windows?
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38007; Package emacs. (Thu, 31 Oct 2019 18:08:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 38007 <at> debbugs.gnu.org
Subject: Re: bug#38007: scroll-lock binding on Windows
Date: Thu, 31 Oct 2019 20:07:09 +0200
> From: Juanma Barranquero <lekktu <at> gmail.com>
> Date: Thu, 31 Oct 2019 18:46:43 +0100
> 
> Shouldn't the binding be to [scroll] on Windows?

Yes, I think so.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38007; Package emacs. (Thu, 31 Oct 2019 23:01:01 GMT) Full text and rfc822 format available.

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

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 38007 <at> debbugs.gnu.org
Subject: Re: bug#38007: scroll-lock binding on Windows
Date: Thu, 31 Oct 2019 23:59:45 +0100
[Message part 1 (text/plain, inline)]
On Thu, Oct 31, 2019 at 7:07 PM Eli Zaretskii <eliz <at> gnu.org> wrote:

> > Shouldn't the binding be to [scroll] on Windows?
>
> Yes, I think so.

OK. I see three ways:

- Something like this in bindings.el:

(define-key global-map (if (eq system-type 'windows-nt) [scroll]
[Scroll_Lock]) 'scroll-lock-mode)

- Leave bindings.el as is and rebind the command to [scroll] in
lisp/term/w32-win.el,

- Or use some of the translation keymaps to translate [scroll] into
[Scroll_Lock].

Which one makes more sense?
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38007; Package emacs. (Fri, 01 Nov 2019 06:18:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 38007 <at> debbugs.gnu.org
Subject: Re: bug#38007: scroll-lock binding on Windows
Date: Fri, 01 Nov 2019 08:17:24 +0200
> From: Juanma Barranquero <lekktu <at> gmail.com>
> Date: Thu, 31 Oct 2019 23:59:45 +0100
> Cc: 38007 <at> debbugs.gnu.org
> 
> OK. I see three ways:
> 
> - Something like this in bindings.el:
> 
> (define-key global-map (if (eq system-type 'windows-nt) [scroll] [Scroll_Lock]) 'scroll-lock-mode)
> 
> - Leave bindings.el as is and rebind the command to [scroll] in lisp/term/w32-win.el,
> 
> - Or use some of the translation keymaps to translate [scroll] into [Scroll_Lock].
> 
> Which one makes more sense?

I don't know yet, because I don't see where does Scroll_Lock come on
Posix platforms.  Can someone tell what did I miss?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38007; Package emacs. (Wed, 13 Nov 2019 16:51:02 GMT) Full text and rfc822 format available.

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

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 38007 <at> debbugs.gnu.org
Subject: Re: bug#38007: scroll-lock binding on Windows
Date: Wed, 13 Nov 2019 17:50:00 +0100
[Message part 1 (text/plain, inline)]
On Fri, Nov 1, 2019 at 7:17 AM Eli Zaretskii <eliz <at> gnu.org> wrote:

> I don't know yet, because I don't see where does Scroll_Lock come on
> Posix platforms.  Can someone tell what did I miss?

No answer after almost two weeks. Perhaps we should bring it to emacs-devel?
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38007; Package emacs. (Wed, 13 Nov 2019 19:47:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 38007 <at> debbugs.gnu.org
Subject: Re: bug#38007: scroll-lock binding on Windows
Date: Wed, 13 Nov 2019 19:46:00 +0000
On November 13, 2019 4:50:00 PM GMT, Juanma Barranquero <lekktu <at> gmail.com> wrote:
> On Fri, Nov 1, 2019 at 7:17 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
> > I don't know yet, because I don't see where does Scroll_Lock come on
> > Posix platforms.  Can someone tell what did I miss?
> 
> No answer after almost two weeks. Perhaps we should bring it to
> emacs-devel?

Please do, and thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38007; Package emacs. (Fri, 22 Nov 2019 09:07:02 GMT) Full text and rfc822 format available.

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

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 38007 <at> debbugs.gnu.org
Subject: Re: bug#38007: scroll-lock binding on Windows
Date: Fri, 22 Nov 2019 10:06:11 +0100
[Message part 1 (text/plain, inline)]
No answer in Emacs devel after nine days.

So I'l fix it for Windows somehow.

Which alternative do you prefer:

- conditionally binding it to [scroll] in bindings.el according to
system-type

- rebinding it in term/w32-win.el,

- or remapping [scroll] to [Scroll_Lock] in some special keymap (perhaps
function-key-map?)
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38007; Package emacs. (Fri, 22 Nov 2019 09:17:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 38007 <at> debbugs.gnu.org
Subject: Re: bug#38007: scroll-lock binding on Windows
Date: Fri, 22 Nov 2019 11:16:56 +0200
> From: Juanma Barranquero <lekktu <at> gmail.com>
> Date: Fri, 22 Nov 2019 10:06:11 +0100
> Cc: 38007 <at> debbugs.gnu.org
> 
> - conditionally binding it to [scroll] in bindings.el according to system-type
> 
> - rebinding it in term/w32-win.el,
> 
> - or remapping [scroll] to [Scroll_Lock] in some special keymap (perhaps function-key-map?)

The former, with a comment about the (evidently unknown) source of the
Scroll_Lock "function key".

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38007; Package emacs. (Fri, 22 Nov 2019 09:46:01 GMT) Full text and rfc822 format available.

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

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 38007 <at> debbugs.gnu.org
Subject: Re: bug#38007: scroll-lock binding on Windows
Date: Fri, 22 Nov 2019 10:44:55 +0100
[Message part 1 (text/plain, inline)]
On Fri, Nov 22, 2019 at 10:16 AM Eli Zaretskii <eliz <at> gnu.org> wrote:

> The former, with a comment about the (evidently unknown) source of the
> Scroll_Lock "function key".

AFAICS, the X Window System Protocol (
https://www.x.org/releases/X11R7.6/doc/xproto/x11protocol.html) defines the
keysyms as numeric codes with a conventional name, in this case

#xFF14   SCROLL LOCK

which is represented in /usr/include/X11/keysymdef.h as

#define XK_Scroll_Lock                   0xff14

but I don't know how that is converted into a keyboard event.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38007; Package emacs. (Fri, 22 Nov 2019 10:01:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 38007 <at> debbugs.gnu.org
Subject: Re: bug#38007: scroll-lock binding on Windows
Date: Fri, 22 Nov 2019 12:00:28 +0200
> From: Juanma Barranquero <lekktu <at> gmail.com>
> Date: Fri, 22 Nov 2019 10:44:55 +0100
> Cc: 38007 <at> debbugs.gnu.org
> 
> AFAICS, the X Window System Protocol (https://www.x.org/releases/X11R7.6/doc/xproto/x11protocol.html)
> defines the keysyms as numeric codes with a conventional name, in this case 
> 
> #xFF14   SCROLL LOCK
> 
> which is represented in /usr/include/X11/keysymdef.h as
> 
> #define XK_Scroll_Lock                   0xff14
> 
> but I don't know how that is converted into a keyboard event.

Yes, the latter is the missing piece.  Maybe put all of the above into
that comment.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38007; Package emacs. (Mon, 07 Feb 2022 03:59:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Juanma Barranquero <lekktu <at> gmail.com>, 38007 <at> debbugs.gnu.org
Subject: Re: bug#38007: scroll-lock binding on Windows
Date: Mon, 07 Feb 2022 04:58:27 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> - conditionally binding it to [scroll] in bindings.el according to system-type
>> 
>> - rebinding it in term/w32-win.el,
>> 
>> - or remapping [scroll] to [Scroll_Lock] in some special keymap
>> (perhaps function-key-map?)
>
> The former, with a comment about the (evidently unknown) source of the
> Scroll_Lock "function key".

I've now done the former in Emacs 29, but I don't quite understand why
the Scroll_Lock event needs a comment -- it's just a normal X keyboard
event, I think?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 29.1, send any further explanations to 38007 <at> debbugs.gnu.org and Juanma Barranquero <lekktu <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 07 Feb 2022 03:59:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38007; Package emacs. (Mon, 07 Feb 2022 12:46:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: lekktu <at> gmail.com, 38007 <at> debbugs.gnu.org
Subject: Re: bug#38007: scroll-lock binding on Windows
Date: Mon, 07 Feb 2022 14:44:26 +0200
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: Juanma Barranquero <lekktu <at> gmail.com>,  38007 <at> debbugs.gnu.org
> Date: Mon, 07 Feb 2022 04:58:27 +0100
> 
> > The former, with a comment about the (evidently unknown) source of the
> > Scroll_Lock "function key".
> 
> I've now done the former in Emacs 29, but I don't quite understand why
> the Scroll_Lock event needs a comment -- it's just a normal X keyboard
> event, I think?

Did you succeed in figuring out where does the "Scroll_Lock" text come
from?  It isn't in lispy_function_keys[] array.  On MS-Windows,
"scroll" does come from that array.  That's what I meant by that
remark.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38007; Package emacs. (Tue, 08 Feb 2022 06:07:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: lekktu <at> gmail.com, 38007 <at> debbugs.gnu.org
Subject: Re: bug#38007: scroll-lock binding on Windows
Date: Tue, 08 Feb 2022 07:06:45 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

> Did you succeed in figuring out where does the "Scroll_Lock" text come
> from?  It isn't in lispy_function_keys[] array.  On MS-Windows,
> "scroll" does come from that array.  That's what I meant by that
> remark.

Oh, I see.  No, I don't know where it's coming from.  I thought that we
(under X) got the key symbols for (some) keys from X, and didn't
maintain the database ourselves?  So we can basically get any symbol
that the X people dream up.

I thought that was the conclusion the last time keyboard events was
discussed, but my memory may well be faulty.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38007; Package emacs. (Tue, 08 Feb 2022 09:08:02 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: lekktu <at> gmail.com, Eli Zaretskii <eliz <at> gnu.org>, 38007 <at> debbugs.gnu.org
Subject: Re: bug#38007: scroll-lock binding on Windows
Date: Tue, 08 Feb 2022 10:07:09 +0100
On Feb 08 2022, Lars Ingebrigtsen wrote:

> Oh, I see.  No, I don't know where it's coming from.  I thought that we
> (under X) got the key symbols for (some) keys from X, and didn't
> maintain the database ourselves?  So we can basically get any symbol
> that the X people dream up.

See get_keysym_name.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38007; Package emacs. (Tue, 08 Feb 2022 12:27:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: lekktu <at> gmail.com, 38007 <at> debbugs.gnu.org
Subject: Re: bug#38007: scroll-lock binding on Windows
Date: Tue, 08 Feb 2022 14:25:28 +0200
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: lekktu <at> gmail.com,  38007 <at> debbugs.gnu.org
> Date: Tue, 08 Feb 2022 07:06:45 +0100
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > Did you succeed in figuring out where does the "Scroll_Lock" text come
> > from?  It isn't in lispy_function_keys[] array.  On MS-Windows,
> > "scroll" does come from that array.  That's what I meant by that
> > remark.
> 
> Oh, I see.  No, I don't know where it's coming from.  I thought that we
> (under X) got the key symbols for (some) keys from X, and didn't
> maintain the database ourselves?  So we can basically get any symbol
> that the X people dream up.
> 
> I thought that was the conclusion the last time keyboard events was
> discussed, but my memory may well be faulty.

Maybe.  I simply don't know, and was quite bewildered at the time.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38007; Package emacs. (Tue, 08 Feb 2022 12:48:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: lekktu <at> gmail.com, larsi <at> gnus.org, 38007 <at> debbugs.gnu.org
Subject: Re: bug#38007: scroll-lock binding on Windows
Date: Tue, 08 Feb 2022 14:45:04 +0200
> From: Andreas Schwab <schwab <at> linux-m68k.org>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  lekktu <at> gmail.com,  38007 <at> debbugs.gnu.org
> Date: Tue, 08 Feb 2022 10:07:09 +0100
> 
> On Feb 08 2022, Lars Ingebrigtsen wrote:
> 
> > Oh, I see.  No, I don't know where it's coming from.  I thought that we
> > (under X) got the key symbols for (some) keys from X, and didn't
> > maintain the database ourselves?  So we can basically get any symbol
> > that the X people dream up.
> 
> See get_keysym_name.

Thanks!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#38007; Package emacs. (Tue, 08 Feb 2022 14:10:01 GMT) Full text and rfc822 format available.

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

From: Po Lu <luangruo <at> yahoo.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: lekktu <at> gmail.com, Eli Zaretskii <eliz <at> gnu.org>, 38007 <at> debbugs.gnu.org
Subject: Re: bug#38007: scroll-lock binding on Windows
Date: Tue, 08 Feb 2022 22:09:25 +0800
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>> Did you succeed in figuring out where does the "Scroll_Lock" text come
>> from?  It isn't in lispy_function_keys[] array.  On MS-Windows,
>> "scroll" does come from that array.  That's what I meant by that
>> remark.
>
> Oh, I see.  No, I don't know where it's coming from.

It's from get_keysym_name in xterm.c.

> I thought that we (under X) got the key symbols for (some) keys from
> X, and didn't maintain the database ourselves?  So we can basically
> get any symbol that the X people dream up.

Yes, and that database is huge.  "Some" of those symbols have to be
treated specially; see the big block of code under KeyPress and
XI_KeyPress in handle_one_xevent that tries to handle the most common
ones might run across.  It starts with:

 	  /* Random non-modifier sorts of keysyms.  */
 	  if (((keysym >= XK_BackSpace && keysym <= XK_Escape)
                        || keysym == XK_Delete


That list is hardly exhaustive, and a few new keysyms were added
recently that I haven't gotten around to looking at yet.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 09 Mar 2022 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 43 days ago.

Previous Next


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