* shift+left/right arrow cannot be bound in Emacs
@ 2015-09-14 15:29 Uwe Brauer
2015-09-14 15:35 ` Kaushal Modi
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Uwe Brauer @ 2015-09-14 15:29 UTC (permalink / raw)
To: help-gnu-emacs
Hello
Using Kubuntu 10.04 on Linux, I am faced with the following problem:
I can bind in Emacs:
The left/right arrow keys, like
control+left, or left (alt/hyper/super)+left
but *not* shift+left.
Somebody has an idea what is the reason for this behaviour?
thanks
Uwe Brauer
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: shift+left/right arrow cannot be bound in Emacs
2015-09-14 15:29 shift+left/right arrow cannot be bound in Emacs Uwe Brauer
@ 2015-09-14 15:35 ` Kaushal Modi
2015-09-14 16:48 ` Óscar Fuentes
2015-09-15 23:40 ` Emanuel Berg
2 siblings, 0 replies; 8+ messages in thread
From: Kaushal Modi @ 2015-09-14 15:35 UTC (permalink / raw)
To: help-gnu-emacs
They can be bound if they can be detected.
IIRC S-arrows (shift+arrows) don't work in --no-window mode. Are you
running emacs in GUI mode or -nw (aka terminal) mode?
If you are running in GUI mode, try "C-h c" followed by pressing
Shift+left.
You should one of the below in the echo area:
- <S-left> is undefined
- <S-left> runs the command <COMMAND BOUND TO S-left>
If it is undefined, and if you are running emacs in GUI mode, you can bind
<S-left> using
(global-set-key (kbd "<S-left>") #'YOUR-COMMAND)
On Mon, Sep 14, 2015 at 11:29 AM Uwe Brauer <oub@mat.ucm.es> wrote:
>
> Hello
>
>
> Using Kubuntu 10.04 on Linux, I am faced with the following problem:
>
> I can bind in Emacs:
>
> The left/right arrow keys, like
>
> control+left, or left (alt/hyper/super)+left
> but *not* shift+left.
>
> Somebody has an idea what is the reason for this behaviour?
>
> thanks
>
> Uwe Brauer
>
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: shift+left/right arrow cannot be bound in Emacs
2015-09-14 15:29 shift+left/right arrow cannot be bound in Emacs Uwe Brauer
2015-09-14 15:35 ` Kaushal Modi
@ 2015-09-14 16:48 ` Óscar Fuentes
2015-09-14 17:26 ` Uwe Brauer
[not found] ` <mailman.1119.1442251609.19560.help-gnu-emacs@gnu.org>
2015-09-15 23:40 ` Emanuel Berg
2 siblings, 2 replies; 8+ messages in thread
From: Óscar Fuentes @ 2015-09-14 16:48 UTC (permalink / raw)
To: help-gnu-emacs
Uwe Brauer <oub@mat.ucm.es> writes:
> Using Kubuntu 10.04 on Linux, I am faced with the following problem:
>
> I can bind in Emacs:
>
> The left/right arrow keys, like
>
> control+left, or left (alt/hyper/super)+left
> but *not* shift+left.
>
> Somebody has an idea what is the reason for this behaviour?
How are you triying to bind shift+left ?
In my Emacs 25.0.50.1 on Kubuntu 15.04 asking for the current binding
with C-h k shift+left shows
<left> (translated from <S-left>) runs the command left-char (found in
...
What says on your system?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: shift+left/right arrow cannot be bound in Emacs
2015-09-14 16:48 ` Óscar Fuentes
@ 2015-09-14 17:26 ` Uwe Brauer
[not found] ` <mailman.1119.1442251609.19560.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 8+ messages in thread
From: Uwe Brauer @ 2015-09-14 17:26 UTC (permalink / raw)
To: help-gnu-emacs
> Uwe Brauer <oub@mat.ucm.es> writes:
> How are you triying to bind shift+left ?
> In my Emacs 25.0.50.1 on Kubuntu 15.04 asking for the current binding
> with C-h k shift+left shows
> <left> (translated from <S-left>) runs the command left-char (found in
> ...
> What says on your system?
The same, I think I begin to understand, the reason is that shift+arrows
is used for setting the mark (as in MS windows) so it might not be
possible to bind these key combination.
^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <mailman.1119.1442251609.19560.help-gnu-emacs@gnu.org>]
* Re: shift+left/right arrow cannot be bound in Emacs
[not found] ` <mailman.1119.1442251609.19560.help-gnu-emacs@gnu.org>
@ 2015-09-14 18:55 ` Dan Espen
2015-09-14 19:47 ` B. T. Raven
2015-09-14 21:52 ` Javier
2 siblings, 0 replies; 8+ messages in thread
From: Dan Espen @ 2015-09-14 18:55 UTC (permalink / raw)
To: help-gnu-emacs
Uwe Brauer <oub@mat.ucm.es> writes:
>> Uwe Brauer <oub@mat.ucm.es> writes:
>
>> How are you triying to bind shift+left ?
>
>> In my Emacs 25.0.50.1 on Kubuntu 15.04 asking for the current binding
>> with C-h k shift+left shows
>
>> <left> (translated from <S-left>) runs the command left-char (found in
>> ...
>
>> What says on your system?
>
> The same, I think I begin to understand, the reason is that shift+arrows
> is used for setting the mark (as in MS windows) so it might not be
> possible to bind these key combination.
Works for me:
(define-key global-map [(shift left)] 'xxxx)
(Linux)
--
Dan Espen
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: shift+left/right arrow cannot be bound in Emacs
[not found] ` <mailman.1119.1442251609.19560.help-gnu-emacs@gnu.org>
2015-09-14 18:55 ` Dan Espen
@ 2015-09-14 19:47 ` B. T. Raven
2015-09-14 21:52 ` Javier
2 siblings, 0 replies; 8+ messages in thread
From: B. T. Raven @ 2015-09-14 19:47 UTC (permalink / raw)
To: help-gnu-emacs
On 9/14/2015 12:26 PM, Uwe Brauer wrote:
>
>> Uwe Brauer <oub@mat.ucm.es> writes:
>
>> How are you triying to bind shift+left ?
>
>> In my Emacs 25.0.50.1 on Kubuntu 15.04 asking for the current binding
>> with C-h k shift+left shows
>
>> <left> (translated from <S-left>) runs the command left-char (found in
>> ...
>
>> What says on your system?
>
> The same, I think I begin to understand, the reason is that shift+arrows
> is used for setting the mark (as in MS windows) so it might not be
> possible to bind these key combination.
>
>
>
I get the same result as Dan: no problem. Try:
(global-set-key [(shift up)] (lambda () (interactive) (insert ?¶ )))
(global-set-key [(shift down)] (lambda () (interactive) (insert ?® )))
The reason shift left is translated to bare left arrow is that there is
no current binding for
(global-set-key [(shift up)] )))
(global-set-key [(shift down)] )))
Ed
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: shift+left/right arrow cannot be bound in Emacs
[not found] ` <mailman.1119.1442251609.19560.help-gnu-emacs@gnu.org>
2015-09-14 18:55 ` Dan Espen
2015-09-14 19:47 ` B. T. Raven
@ 2015-09-14 21:52 ` Javier
2 siblings, 0 replies; 8+ messages in thread
From: Javier @ 2015-09-14 21:52 UTC (permalink / raw)
To: help-gnu-emacs
>> In my Emacs 25.0.50.1 on Kubuntu 15.04 asking for the current binding
>> with C-h k shift+left shows
>
>> <left> (translated from <S-left>) runs the command left-char (found in
>> ...
>
> The same, I think I begin to understand, the reason is that shift+arrows
> is used for setting the mark (as in MS windows) so it might not be
> possible to bind these key combination.
I can bind them without problem
;;; Deactivate Shift+Arrow To Select Text
(setq shift-select-mode nil)
(global-set-key [S-left] 'my-function)
(global-set-key [S-right] 'my-function)
You can try to type S-left and use C-h l (view lossage) to check what key presses emacs detects.
Are you using emacs -nw in a terminal? For xterm I use
;; XTERM THROUGH SSH
(define-key function-key-map "\e[1;2A" '[S-up])
(define-key function-key-map "\e[1;2B" '[S-down])
(define-key function-key-map "\e[1;2C" '[S-right])
(define-key function-key-map "\e[1;2D" '[S-left])
Are you using org-mode? shift+arrow have a different meaning in
org-mode that clashes with emacs defaults.
;;; Avoid redefining of keys by org-mode
(defun org-mode-keys ()
"Keybindings for org-mode. To be used as a hook."
(local-set-key [S-left] 'my-function)
(local-set-key [S-right] 'my-function)
)
(add-hook 'org-mode-hook 'org-mode-keys)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: shift+left/right arrow cannot be bound in Emacs
2015-09-14 15:29 shift+left/right arrow cannot be bound in Emacs Uwe Brauer
2015-09-14 15:35 ` Kaushal Modi
2015-09-14 16:48 ` Óscar Fuentes
@ 2015-09-15 23:40 ` Emanuel Berg
2 siblings, 0 replies; 8+ messages in thread
From: Emanuel Berg @ 2015-09-15 23:40 UTC (permalink / raw)
To: help-gnu-emacs
Uwe Brauer <oub@mat.ucm.es> writes:
> I can bind in Emacs:
>
> The left/right arrow keys, like
>
> control+left, or left (alt/hyper/super)+left but *not*
> shift+left.
In the ttys, the shift isn't reported when I combine
it with the left or right arrow key. That shortcut
isn't to my liking (one must move the right hand from
typing position and then reset) but if you by any
chance use the ttys as well and this is the reason why
it doesn't work, here is a tutorial that shows how to
make it work:
http://user.it.uu.se/~embe8573/tty-emacs-keys.txt
And, the left arrow key is keycode 105; ditto
right: 106.
--
underground experts united
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-09-15 23:40 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-14 15:29 shift+left/right arrow cannot be bound in Emacs Uwe Brauer
2015-09-14 15:35 ` Kaushal Modi
2015-09-14 16:48 ` Óscar Fuentes
2015-09-14 17:26 ` Uwe Brauer
[not found] ` <mailman.1119.1442251609.19560.help-gnu-emacs@gnu.org>
2015-09-14 18:55 ` Dan Espen
2015-09-14 19:47 ` B. T. Raven
2015-09-14 21:52 ` Javier
2015-09-15 23:40 ` Emanuel Berg
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).