[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Howto: Bind Windows key as a prefix?

From: Stefan Monnier
Subject: Re: Howto: Bind Windows key as a prefix?
Date: Tue, 05 Jul 2022 16:09:52 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

> s-<c> is undefined for any <c>.
> M-x global-set-key RET
> windows+<c> RET
> command RET
> binds windows-<c>
> and asking where is <command> shows it as being on s-<c>.
> However calling global-set-key with "s-<c>" bombs with key-sequence
> "s-<c>" starts with  non-prefix s"

`s-<c>` is the syntax generated by `key-description` and understood by
`kbd` (and the new set of functions like` key-valid-p` and
`define-keymap`) but it is not understood by `define-key`,
`global-set-key`, and friends, for which you need to use the lower-level
vector syntax:

    (global-set-key [?\s-c] 'my-command)
    (global-set-key [s-tab] 'my-other-command)

-- Stefan

reply via email to

[Prev in Thread] Current Thread [Next in Thread]