From de419bba04601b163def31308d63c51ed90b1458 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 7 Feb 2022 04:57:27 +0100 Subject: [PATCH] Fix the Scroll key binding on Windows * lisp/bindings.el (global-map): Fix the binding on Windows (bug#38007). * lisp/scroll-lock.el (scroll-lock-mode): The event is `scroll' on Windows, not `Scroll_Lock'. --- lisp/bindings.el | 4 +++- lisp/scroll-lock.el | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/bindings.el b/lisp/bindings.el index 26b17035ef9..8ae8c3d60ef 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -1160,7 +1160,9 @@ if `inhibit-field-text-motion' is non-nil." ;(define-key global-map [delete] 'backward-delete-char) ;; natural bindings for terminal keycaps --- defined in X keysym order -(define-key global-map [Scroll_Lock] 'scroll-lock-mode) +(define-key global-map + (if (eq system-type 'windows-nt) [scroll] [Scroll_Lock]) + #'scroll-lock-mode) (define-key global-map [C-S-backspace] 'kill-whole-line) (define-key global-map [home] 'move-beginning-of-line) (define-key global-map [C-home] 'beginning-of-buffer) diff --git a/lisp/scroll-lock.el b/lisp/scroll-lock.el index d41e3352332..3f5f777f53f 100644 --- a/lisp/scroll-lock.el +++ b/lisp/scroll-lock.el @@ -55,7 +55,7 @@ will scroll the buffer by the respective amount of lines instead and point will be kept vertically fixed relative to window boundaries during scrolling. -Note that the default key binding to Scroll_Lock will not work on +Note that the default key binding to `scroll' will not work on MS-Windows systems if `w32-scroll-lock-modifier' is non-nil." :lighter " ScrLck" :keymap scroll-lock-mode-map -- 2.39.5