all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Bind CTRL-S (CTRL-shift-S) separately from CTRL-s?
@ 2011-05-22 19:10 keepplugging
  2011-05-23  1:51 ` Stefan Monnier
  2011-05-24 16:51 ` Deniz Dogan
  0 siblings, 2 replies; 4+ messages in thread
From: keepplugging @ 2011-05-22 19:10 UTC (permalink / raw)
  To: help-gnu-emacs

Using Windows XP.  Emacs  23.2.1 (i386-mingw-nt5.1.2600)  of
2010-05-08 on G41R2F1

How do I bind CTRL-S (CTRL-shift-S) to a function without affecting
CTRL-s?

I've tried
(global-set-key "\C-S" 'blabbafunc)
(global-set-key "\C-S-s" 'blabbafunc)
(global-set-key "S-\C-s" 'blabbafunc)
(define-key key-translation-map "\C-S" 'blabbafunc)
(define-key key-translation-map "S-\C-s" 'blabbafunc)

None of that is right.

Regards, Bob


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bind CTRL-S (CTRL-shift-S) separately from CTRL-s?
  2011-05-22 19:10 Bind CTRL-S (CTRL-shift-S) separately from CTRL-s? keepplugging
@ 2011-05-23  1:51 ` Stefan Monnier
  2011-05-24  1:36   ` Plugger
  2011-05-24 16:51 ` Deniz Dogan
  1 sibling, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2011-05-23  1:51 UTC (permalink / raw)
  To: help-gnu-emacs

> (global-set-key "\C-S" 'blabbafunc)
> (global-set-key "\C-S-s" 'blabbafunc)

You're missing a backslash in front of the second modifier.
I recommend you avoid the string syntax, so if you try

   (global-set-key [?\C-S-s] 'blabbafunc)

you'll get a useful error message whereas
   
   (global-set-key [?\C-\S-s] 'blabbafunc)

will be accepted.  For some reason it doesn't work for me (the key
seems never to reach Emacs, so it's presumably caught by the WM or
something), but it works for ?\C-\S-d, so the syntax is right.


        Stefan


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bind CTRL-S (CTRL-shift-S) separately from CTRL-s?
  2011-05-23  1:51 ` Stefan Monnier
@ 2011-05-24  1:36   ` Plugger
  0 siblings, 0 replies; 4+ messages in thread
From: Plugger @ 2011-05-24  1:36 UTC (permalink / raw)
  To: help-gnu-emacs

Thanks!
Your suggestion works for me.
I don't remember doing anything special to get keys past the WM and
into emacs, except for this:
(setq w32-pass-lwindow-to-system nil
      w32-pass-rwindow-to-system nil
      w32-pass-apps-to-system    nil
)
... but that has nothing to do with CTRL-S.
I don't see how, but could it be a keyboard issue?
I'm using the keyboard from my PS2  (IBM Personal System 2).

Regards, Bob


On May 22, 9:51 pm, Stefan Monnier <monn...@iro.umontreal.ca> wrote:
> > (global-set-key "\C-S" 'blabbafunc)
> > (global-set-key "\C-S-s" 'blabbafunc)
>
> You're missing a backslash in front of the second modifier.
> I recommend you avoid the string syntax, so if you try
>
>    (global-set-key [?\C-S-s] 'blabbafunc)
>
> you'll get a useful error message whereas
>
>    (global-set-key [?\C-\S-s] 'blabbafunc)
>
> will be accepted.  For some reason it doesn't work for me (the key
> seems never to reach Emacs, so it's presumably caught by the WM or
> something), but it works for ?\C-\S-d, so the syntax is right.
>
>         Stefan



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bind CTRL-S (CTRL-shift-S) separately from CTRL-s?
  2011-05-22 19:10 Bind CTRL-S (CTRL-shift-S) separately from CTRL-s? keepplugging
  2011-05-23  1:51 ` Stefan Monnier
@ 2011-05-24 16:51 ` Deniz Dogan
  1 sibling, 0 replies; 4+ messages in thread
From: Deniz Dogan @ 2011-05-24 16:51 UTC (permalink / raw)
  To: help-gnu-emacs

On 2011-05-22 21:10, keepplugging wrote:
> Using Windows XP.  Emacs  23.2.1 (i386-mingw-nt5.1.2600)  of
> 2010-05-08 on G41R2F1
>
> How do I bind CTRL-S (CTRL-shift-S) to a function without affecting
> CTRL-s?
>
> I've tried
> (global-set-key "\C-S" 'blabbafunc)
> (global-set-key "\C-S-s" 'blabbafunc)
> (global-set-key "S-\C-s" 'blabbafunc)
> (define-key key-translation-map "\C-S" 'blabbafunc)
> (define-key key-translation-map "S-\C-s" 'blabbafunc)
>
> None of that is right.
>
> Regards, Bob

(global-set-key (kbd "C-S-s") 'blabla) ought to work.

/Deniz


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-05-24 16:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-22 19:10 Bind CTRL-S (CTRL-shift-S) separately from CTRL-s? keepplugging
2011-05-23  1:51 ` Stefan Monnier
2011-05-24  1:36   ` Plugger
2011-05-24 16:51 ` Deniz Dogan

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.