From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus via "Emacs development discussions." Newsgroups: gmane.emacs.devel Subject: Re: xterm [menu] key definition Date: Tue, 24 Aug 2021 18:40:36 +0200 Message-ID: <20210824164036.caohbap24666ij35@Ergus> References: <20210819024728.kgnf6jmpakqdto4p.ref@Ergus> <20210819024728.kgnf6jmpakqdto4p@Ergus> <87mtp71i4s.fsf@mail.linkov.net> Reply-To: Ergus Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="bht4bjccnal7rb4m" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36518"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Monnier , emacs-devel To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Aug 24 18:44:16 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mIZX4-0009Gt-DS for ged-emacs-devel@m.gmane-mx.org; Tue, 24 Aug 2021 18:44:14 +0200 Original-Received: from localhost ([::1]:45704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIZX3-0000OG-9o for ged-emacs-devel@m.gmane-mx.org; Tue, 24 Aug 2021 12:44:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57286) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIZU6-0001Eq-UM for emacs-devel@gnu.org; Tue, 24 Aug 2021 12:41:10 -0400 Original-Received: from sonic307-2.consmr.mail.bf2.yahoo.com ([74.6.134.41]:43298) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mIZU2-0006Vf-Th for emacs-devel@gnu.org; Tue, 24 Aug 2021 12:41:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1629823264; bh=93S7YK0YpTSTBwws9qG5c8Cs9WqYXYmg/BLPKUMGcf8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject:Reply-To; b=oEsQHsH5bR7OSrAeu268odqpj9WGAsEjVNcYhIFF4Bn5Wmman3shwK/6+4govCCIN+5MX43MIgA5ZHF7DHq4A8AmH+R5lPzEGWuMWmAFYIjP/8iuM5hcIMq8YVLtWHwMVcPbJgo12/MBh8BRr6FHki16pw4vG59ToGlP0vQKkm6IH8NmhKfPCfxlowZjAZNG3GCJ+OSEkh8c3ZEn5bRyj27643sphT7y1X3H2w+4qhx+q8myB5mnP7Fpjg5HVwskDOHdrBrmK3iCLOcfOccgWT4424bV5A/1QkfkF16u6n8ldMwWC8/Xm/gHuTaXxw4wIGro0CaqnUkM85R+AomvSQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1629823264; bh=mt5Fha8G603cQVCY2JDBshs8QRqznd0aIqEa1oupnBI=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=KSJunuFTMDD5V9ODRpQ27ZwfNjvg9k8q3tAXUSdzx+t4ElQIxFOvL50BbIImwUxcpkMzbHmwRSYNQJ/VOMPpRyLrjxQ858ojVX/yJAkrqzlau+ioKm9AOZExrgozzpyVFG7BTinV7vDx2TgZguFkr6/S5BvkNBvSYzInKlnpThbcqbnYpnT2rcgPL4yqg9BSQ9eWctvkQmKw+7snydXLJGPCW6w+/aMg8wG8qr9ngcP6Hl/ItBM1yM5xb2a2lDDqKjjUxMSUWdx5NJafBiDGbzqMX2A46zdW16xhIRZ/mJEJ4PFDTBBLwxKiwMTvAsNAl5FvxfwF138UC65fOB50ig== X-YMail-OSG: sahIuN0VM1kWkFBS1jDMFIYo.ab2ub8IxHvMXycK2jCJ6fC0ahgHxr0matGF_5_ oAlIEKJLxOB4xOxknebo1mLvC804XdZ2niNS5oum4tSCkKkkKhIzvBQvsv1taXPzkd6.C_O.y.Dy Kzl.28uDEjS5wQNiONpvJZ2Ni05m9dcEh.ueFAYe32LvEflrMPYBVWcP1R1VdEKd9OkfrGN1qU_y QQ_BoOTK9a6GwqyMOHWwroDwnE5grzG3s2NPxvF77.cCoJPVo_UHVDrMQxg2SLHSICA8lJufx3cm wUPaTpmuzoWx8KrmX16MAKAuH_nuJpNdziiaOO9TTkRYLZb2nJYwS1bEtTheDqRwFSU8MWI.1SPN zB1H8GCHeLE_zbudWIxHk6yiXTNHQTVSDb_Rj8UtFVn5Km8aJ_1NbPJuHjwln4OwMvC9lWVroou9 EJQRCOfjdTufZYExOn4konyr_ix1QTdlwmKK3M_.md_umlV6IrNuhIgXp4d8dtyKH31oKCewnLrT u5yzOL1Ccxf_Lv1pYqYsSapV6SayoB1DZX1Cs7ST4awrClKv34QKMZZYuERoZAiPwnA5e._74Umv efiR0R73dijxK2xqH5MOAQVEznKgj._Ru2YFaX2xLxPpLjkvm.0x2DsDS0Ompts3XxNdH0d6VsEJ 3z04QnWfspSwjhNTBdZsJn5bZGg4DuYfDGQ8_5W37gTnscEa6AbZ4q38oj.HViWfwKTkK2X4lCPp 7rqlhCR7C5eTlaUYEx62ECfkbki5iK1YUtofopqo6yo.fVMgGYLp2K0NKDxhUdpnh8v5n6EUk0fc vc5I_lClJGqx_29E27MqrU5EiUanTmg.kNvnAONrR7 X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.bf2.yahoo.com with HTTP; Tue, 24 Aug 2021 16:41:04 +0000 Original-Received: by kubenode527.mail-prod1.omega.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 8dee727d2af885fc4515d9a3cb55930c; Tue, 24 Aug 2021 16:41:00 +0000 (UTC) Content-Disposition: inline In-Reply-To: <87mtp71i4s.fsf@mail.linkov.net> X-Mailer: WebService/1.1.18906 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol Received-SPF: pass client-ip=74.6.134.41; envelope-from=spacibba@aol.com; helo=sonic307-2.consmr.mail.bf2.yahoo.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:272913 Archived-At: --bht4bjccnal7rb4m Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline On Tue, Aug 24, 2021 at 09:37:23AM +0300, Juri Linkov wrote: >* Gregor Zattler [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- 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. --bht4bjccnal7rb4m Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="menu.patch" 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) - ;; 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]) --bht4bjccnal7rb4m--