unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ergus via "Emacs development discussions." <emacs-devel@gnu.org>
To: Juri Linkov <juri@linkov.net>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>,
	emacs-devel <emacs-devel@gnu.org>
Subject: Re: xterm [menu] key definition
Date: Tue, 24 Aug 2021 18:40:36 +0200	[thread overview]
Message-ID: <20210824164036.caohbap24666ij35@Ergus> (raw)
In-Reply-To: <87mtp71i4s.fsf@mail.linkov.net>

[-- Attachment #1: Type: text/plain, Size: 1263 bytes --]

On Tue, Aug 24, 2021 at 09:37:23AM +0300, Juri Linkov wrote:
>* Gregor Zattler <telegraph@gmx.net> [2021-08-23; 20:35]:
>>> I don't actually know about any keyboard with a print
>>> button...
>>
>> wouldn't that be the PrtSc key which is on every standard PC
>> keyboard right of F12 and above of Insert?
>>
>>> But I suppose there should be some. If someone has it;
>>> please could you check with xev and cat+xterm what it
>>> sends?
>>
>> Said key gives via cat on xterm:
>>
>> ^[[2~
>>
>> and xev says the same.
>>
>> on debian buster, that is.
>
>I have the PrtSc key that prints the screen,
>but no Menu key, so can't confirm, sorry.
>
Just to clarify.

What I am proposing is as simple as the attached patch.

I won't expect any complain about the change, but if so we then may
decide to do something like an alias between [menu] and [print]:

BTW: Juri, may we add a binding that toggles the menu when we repeat the
S-<f6> or the [menu] key (or whatever key the user pressed to activate
it)? Because a single ESC hides the menu only on gui not in term.

We can do that with C-g or ESC ESC ESC; but repeating to toggle is a
very common behavior right? and now it is free, it is better to take it
before some more fancy behavior comes for it in a while ;p.

[-- Attachment #2: menu.patch --]
[-- Type: text/plain, Size: 1858 bytes --]

diff --git a/lisp/mouse.el b/lisp/mouse.el
index 9d86681384..9e37527e70 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -452,10 +452,20 @@ context-menu-entry
   `(menu-item ,(purecopy "Context Menu") ignore
               :filter (lambda (_) (context-menu-map))))
 
+(defun context-menu-open ()
+  "Start key navigation of the context menu.
+This is the keyboard interface to \\[context-menu-map]."
+  (interactive)
+  (let ((inhibit-mouse-event-check t))
+    (popup-menu (context-menu-map) (point))))
+
+(global-set-key [S-f6] #'context-menu-open)
+
 (defvar context-menu-mode-map
   (let ((map (make-sparse-keymap)))
     (define-key map [mouse-3] nil)
     (define-key map [down-mouse-3] context-menu-entry)
+    (define-key map [menu] #'context-menu-open)
     (when (featurep 'ns)
       (define-key map [C-mouse-1] nil)
       (define-key map [C-down-mouse-1] context-menu-entry))
@@ -468,16 +478,6 @@ context-menu-mode
 When Context Menu mode is enabled, clicking the mouse button down-mouse-3
 activates the menu whose contents depends on its surrounding context."
   :global t :group 'mouse)
-
-(defun context-menu-open ()
-  "Start key navigation of the context menu.
-This is the keyboard interface to \\[context-menu-map]."
-  (interactive)
-  (let ((inhibit-mouse-event-check t))
-    (popup-menu (context-menu-map) (point))))
-
-(global-set-key [S-f10] 'context-menu-open)
-
 \f
 ;; Commands that operate on windows.
 
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index e63bf36cc3..d37206e018 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -350,7 +350,7 @@ xterm-function-map
     (define-key map "\e[5;3~" [M-prior])
     (define-key map "\e[6;3~" [M-next])
 
-    (define-key map "\e[29~" [print])
+    (define-key map "\e[29~" [menu])
 
     (define-key map "\eOj" [kp-multiply])
     (define-key map "\eOk" [kp-add])

  parent reply	other threads:[~2021-08-24 16:40 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210819024728.kgnf6jmpakqdto4p.ref@Ergus>
2021-08-19  2:47 ` xterm [menu] key definition Ergus
2021-08-23 17:53   ` Ergus
2021-08-24  6:37   ` Juri Linkov
2021-08-24  8:19     ` Ergus
2021-08-24  8:34       ` tomas
2021-08-24  9:17         ` Ergus
2021-08-24 10:03           ` Andreas Schwab
2021-08-24 11:00           ` tomas
2021-08-24 15:30             ` Ergus
2021-08-25  7:06               ` tomas
2021-08-25  9:32                 ` Ergus
2021-08-25 10:47                   ` tomas
2021-08-25 11:31                     ` Ergus
2021-08-26  5:47                     ` chad
2021-08-26  7:14                       ` tomas
2021-08-26  8:16                       ` Andreas Schwab
2021-08-24  8:34       ` Andreas Schwab
2021-08-24  9:07         ` Ergus
2021-08-24 22:05       ` Stefan Monnier
2021-08-25  6:38         ` tomas
2021-08-25  9:04           ` Ergus
2021-08-24 16:40     ` Ergus via Emacs development discussions. [this message]
2021-08-24 17:28       ` Eli Zaretskii
2021-08-24 18:09         ` Juri Linkov
2021-08-24 20:23         ` Ergus
2021-08-25 11:27           ` Eli Zaretskii
2021-08-25 11:53             ` Ergus
2021-08-24 22:16       ` Stefan Monnier
2021-08-24 23:20         ` Ergus
2021-08-25  2:53           ` Stefan Monnier
2021-08-25  8:58             ` Ergus
2021-08-25 14:13               ` Stefan Monnier
2021-08-25 11:34             ` Eli Zaretskii
2021-08-25 22:41               ` Stefan Monnier
2021-08-26  6:55                 ` Eli Zaretskii
2021-08-26  7:17                   ` Ergus
2021-08-26  7:23                     ` Eli Zaretskii
2021-08-26 12:52                   ` Ergus
2021-08-26 13:48                     ` Eli Zaretskii
2021-08-26 13:59                   ` Stefan Monnier
2021-08-26 14:51                     ` Andreas Schwab
2021-08-26 15:52                     ` Eli Zaretskii
2021-08-25  7:10           ` tomas
2021-08-25  8:02           ` Andreas Schwab
2021-08-25  6:36         ` Yuri Khan
2021-08-25  7:17           ` tomas
2021-08-25  9:00           ` Ergus
2021-08-25 14:01         ` Olaf Rogalsky
     [not found]   ` <87k0kcovp4.fsf@no.workgroup>
2021-08-25 12:09     ` Gregor Zattler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210824164036.caohbap24666ij35@Ergus \
    --to=emacs-devel@gnu.org \
    --cc=juri@linkov.net \
    --cc=monnier@iro.umontreal.ca \
    --cc=spacibba@aol.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).