unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: "Per Starbäck" <per.starback@gmail.com>, emacs-devel@gnu.org
Subject: Re: Modified keypad keys
Date: Sun, 30 Sep 2012 12:56:55 +0300	[thread overview]
Message-ID: <877grbkhwo.fsf@mail.jurta.org> (raw)
In-Reply-To: <jwvehlkpags.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sat, 29 Sep 2012 21:41:35 -0400")

>> Not sure about shift.  It's used to toggle the layout of the keypad
>> at the system level.  Also `shift-select-mode' comes into play.
>> So without adding `shift' to these remappings, when e.g.
>> `kp-7' self-inserts `7', `S-kp-7' selects the region
>> to the beginning of the line.
>
> I'm not sure I understand.  By `S-kp-7' do you mean "Emacs sees the
> event S-kp-7" or "I press the key 7 on the numeric keypad while pressing
> shift at the same time"?
> I can't see why Emacs would move to the beginning of line in response to
> the S-kp-7 event, unless you've added bindings on your own, but I can
> imagine that pressing that numeric-keypad-7 with shift might end up
> sending to Emacs some different event such as `S-home', which would
> behave like you describe.  If that's the case then adding shift among
> the modifiers in your code would simply not affect your case (but it
> would still be useful for other keyboards).

In the current trunk's `emacs -Q' when NumLock is off, `C-h k' for
pressing the key 7 on the numeric keypad displays:

  <home> (translated from <kp-home>) runs the command move-beginning-of-line

pressing the key 7 while pressing shift at the same time:

  7 (translated from <S-kp-7>) runs the command self-insert-command

When NumLock is on, pressing the key 7 on the numeric keypad:

  7 (translated from <kp-7>) runs the command self-insert-command

pressing the key 7 while pressing shift at the same time:

  <home> (translated from <S-kp-home>) runs the command move-beginning-of-line

and selects the region to the beginning of the line
when `shift-select-mode' is t.

`xev' displays for the key 7 when NumLock is off:

    state 0x0, keycode 79 (keysym 0xff95, KP_Home), same_screen YES,

and while pressing shift at the same time:

    state 0x1, keycode 79 (keysym 0xffb7, KP_7), same_screen YES,

When NumLock is on, `xev' displays for the key 7:

    state 0x110, keycode 79 (keysym 0xffb7, KP_7), same_screen YES,

and while pressing shift at the same time:

    state 0x11, keycode 79 (keysym 0xff95, KP_Home), same_screen YES,

In the trunk's bindings.el shift key bindings are commented out
with the following comment:

;; Don't bind shifted keypad numeric keys, they reportedly
;; interfere with the feature of some keyboards to produce
;; numbers when NumLock is off.
;(define-key function-key-map [S-kp-1] [S-end])
;(define-key function-key-map [S-kp-2] [S-down])
;(define-key function-key-map [S-kp-3] [S-next])
;(define-key function-key-map [S-kp-4] [S-left])
;(define-key function-key-map [S-kp-6] [S-right])
;(define-key function-key-map [S-kp-7] [S-home])
;(define-key function-key-map [S-kp-8] [S-up])
;(define-key function-key-map [S-kp-9] [S-prior])
(define-key function-key-map [C-S-kp-1] [C-S-end])
(define-key function-key-map [C-S-kp-2] [C-S-down])
(define-key function-key-map [C-S-kp-3] [C-S-next])
(define-key function-key-map [C-S-kp-4] [C-S-left])
(define-key function-key-map [C-S-kp-6] [C-S-right])
(define-key function-key-map [C-S-kp-7] [C-S-home])
(define-key function-key-map [C-S-kp-8] [C-S-up])
(define-key function-key-map [C-S-kp-9] [C-S-prior])

Perhaps the bottom part for C-S- should be commented out as well
for the same reason as explained in the comment above.

So the remaining controversial question is whether pressing
the key 7 while pressing shift at the same time when NumLock is on
should select the region or not.  There are equally good reasons
for both of these variants.



  reply	other threads:[~2012-09-30  9:56 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-28  6:40 Modified keypad keys Per Starbäck
2012-09-28  8:23 ` Stefan Monnier
2012-09-28 15:29   ` Juri Linkov
2012-09-28 20:16     ` Stefan Monnier
2012-09-29  2:14       ` Stefan Monnier
2012-09-29 19:19       ` Juri Linkov
2012-09-30  1:41         ` Stefan Monnier
2012-09-30  9:56           ` Juri Linkov [this message]
2012-09-30 19:45             ` Stefan Monnier
2012-10-01  9:29               ` Juri Linkov
2012-10-01 15:03                 ` Stefan Monnier
2012-10-04 18:41                   ` Juri Linkov
2012-10-04 23:26                     ` Andreas Schwab
2012-10-05 14:41                       ` Andreas Schwab
2012-10-05 16:43                         ` Juri Linkov
2012-10-05 16:55                           ` Andreas Schwab
2012-10-05 17:05                             ` Juri Linkov
2012-10-01  8:02         ` power set (Re: Modified keypad keys) Stephen Berman
2012-10-01  8:35           ` Christopher Monsanto
2012-10-01  9:07             ` Stephen Berman
2012-10-01 12:42               ` Lars Magne Ingebrigtsen
2012-10-01 13:06                 ` Stephen Berman
2012-10-01  9:27           ` Juri Linkov

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=877grbkhwo.fsf@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=per.starback@gmail.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).