unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How do you use a number as an argument to global-set-key?
@ 2009-04-19 16:05 formido
  2009-04-19 17:31 ` thierry.volpiatto
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: formido @ 2009-04-19 16:05 UTC (permalink / raw)
  To: help-gnu-emacs

I want to use the numbers above the keyboard in 'global-set-key',
e.g., have a command trigger with C-2. "\C-2" doesn't work. What does?

Michael


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

* Re: How do you use a number as an argument to global-set-key?
  2009-04-19 16:05 How do you use a number as an argument to global-set-key? formido
@ 2009-04-19 17:31 ` thierry.volpiatto
  2009-04-19 17:34 ` Peter Dyballa
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: thierry.volpiatto @ 2009-04-19 17:31 UTC (permalink / raw)
  To: help-gnu-emacs

Hi, use kbd
formido <formido@gmail.com> writes:

> I want to use the numbers above the keyboard in 'global-set-key',
> e.g., have a command trigger with C-2. "\C-2" doesn't work. What does?

(global-set-key (kbd "C-2") 'your_command)

> Michael
>

-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France





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

* Re: How do you use a number as an argument to global-set-key?
  2009-04-19 16:05 How do you use a number as an argument to global-set-key? formido
  2009-04-19 17:31 ` thierry.volpiatto
@ 2009-04-19 17:34 ` Peter Dyballa
       [not found] ` <mailman.5694.1240162703.31690.help-gnu-emacs@gnu.org>
  2009-04-21  6:13 ` Miles Bader
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Dyballa @ 2009-04-19 17:34 UTC (permalink / raw)
  To: formido; +Cc: help-gnu-emacs


Am 19.04.2009 um 18:05 schrieb formido:

> I want to use the numbers above the keyboard in 'global-set-key',
> e.g., have a command trigger with C-2. "\C-2" doesn't work. What does?

Use a different X server, one that supports C-2!

--
Greetings

              ~  O
   Pete       ~~_\\_/%
              ~  O  o






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

* Re: How do you use a number as an argument to global-set-key?
       [not found] ` <mailman.5694.1240162703.31690.help-gnu-emacs@gnu.org>
@ 2009-04-19 17:58   ` formido
  0 siblings, 0 replies; 5+ messages in thread
From: formido @ 2009-04-19 17:58 UTC (permalink / raw)
  To: help-gnu-emacs

On Apr 19, 10:31 am, thierry.volpia...@gmail.com wrote:
> Hi, use kbd
>
> formido <form...@gmail.com> writes:
> > I want to use the numbers above the keyboard in 'global-set-key',
> > e.g., have a command trigger with C-2. "\C-2" doesn't work. What does?
>
> (global-set-key (kbd "C-2") 'your_command)
>
> > Michael
>
> --
> A + Thierry Volpiatto
> Location: Saint-Cyr-Sur-Mer - France

Ah ha! Thanks very much.


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

* Re: How do you use a number as an argument to global-set-key?
  2009-04-19 16:05 How do you use a number as an argument to global-set-key? formido
                   ` (2 preceding siblings ...)
       [not found] ` <mailman.5694.1240162703.31690.help-gnu-emacs@gnu.org>
@ 2009-04-21  6:13 ` Miles Bader
  3 siblings, 0 replies; 5+ messages in thread
From: Miles Bader @ 2009-04-21  6:13 UTC (permalink / raw)
  To: help-gnu-emacs

formido <formido@gmail.com> writes:
> I want to use the numbers above the keyboard in 'global-set-key',
> e.g., have a command trigger with C-2. "\C-2" doesn't work. What does?

Use a vector instead of a string (strings can only contain a limited
subset of keys).

E.g.: (global-set-key [?\C-2] 'foo)

-Miles

-- 
Quotation, n. The act of repeating erroneously the words of another. The words
erroneously repeated.


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

end of thread, other threads:[~2009-04-21  6:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-19 16:05 How do you use a number as an argument to global-set-key? formido
2009-04-19 17:31 ` thierry.volpiatto
2009-04-19 17:34 ` Peter Dyballa
     [not found] ` <mailman.5694.1240162703.31690.help-gnu-emacs@gnu.org>
2009-04-19 17:58   ` formido
2009-04-21  6:13 ` Miles Bader

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).