Separate binding for keys with shift

0

I'm using GNU Emacs 23.1.1 on Ubuntu 10.04 and want to use something similar to the emacs clipboard settings described here, but I want to keep the default behavior and get the alternate one by pressing shift. I mean something like this

;;; these are the defaults anyway
(global-set-key "\C-w" 'kill-region)
(global-set-key "\M-w" 'yank-pop)
(global-set-key "\C-y" 'clipboard-yank)

;;; these should be the clipboard-aware versions
(global-set-key "\C-W" 'clipboard-kill-region)
(global-set-key "\S-\M-w" 'clipboard-kill-ring-save)
(global-set-key "\C-Y" 'clipboard-yank)

But only \S-\M-w works well, while using \C-W works exactly like C-w. I tried also \S-\C-w, but this ends up with "Invalid modifier in string".

How can I bind shiftcontroly separately from controly?

maaartinus

Posted 2012-07-03T17:33:59.333

Reputation: 3 054

Answers

1

(global-set-key (kbd "C-S-w") 'clipboard-kill-region)
(global-set-key (kbd "M-W")   'clipboard-kill-ring-save)
(global-set-key (kbd "C-S-y") 'clipboard-yank)

Peter.O

Posted 2012-07-03T17:33:59.333

Reputation: 2 743