[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Does code exist to check if a key sequence is valid for Emacs runnin
From: |
Robert Pluim |
Subject: |
Re: Does code exist to check if a key sequence is valid for Emacs running in terminal mode? |
Date: |
Fri, 12 Jul 2024 14:53:36 +0200 |
>>>>> On Fri, 12 Jul 2024 08:14:52 -0400, Pierre Rouleau
>>>>> <prouleau001@gmail.com> said:
Pierre> Hi all,
Pierre> Does Emacs already have a predicate function that can be used to
check if
Pierre> the specified key sequence is valid for Emacs running in terminal
mode?
Not that I know of, but Emacs always has functionality I donʼt know of
:-)
Pierre> For example, "C-;" is not accessible on Emacs running in terminal
mode
Pierre> because this is not an ASCII control character. It's available for
Emacs
Pierre> running in graphical environment, but not in terminal mode.
Pierre> Is there something similar already available or one would simply
wrap
Pierre> describe-key and catch the error to check?
Iʼm in a terminal frame:
(describe-key (kbd "C-;")) =>
#("C-; is undefined" 0 3 (face help-key-binding font-lock-face
help-key-binding))
which is exactly what you get in a GUI frame.
I think the best you can do is bind the key. If itʼs available, it will work.
Robert
--