[Top][All Lists]

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

Re: `global-set-key' doesn't work in my console

From: Forrest Y. Yu
Subject: Re: `global-set-key' doesn't work in my console
Date: Fri, 11 Jan 2008 00:37:42 +0800

On Jan 10, 2008 8:51 PM, Peter Dyballa <> wrote:
> Am 09.01.2008 um 10:48 schrieb Forrest:
> > i tried to figure out why, then i googled much but got little
> > helpful, it
> > seems that `terminfo' is the point but i cannot understand what it
> > is, the
> > output of 'infocmp' is a mess for me :(
> It's not that. It's ASCII:
> C-@ -> \000 or NUL
> C-a -> \001
> C-b -> \002
> ...
> C-z -> \032
> C-[ -> \033
> C-\ -> \034
> C-] -> \035
> C-^ -> \036
> C-_ -> \037
> SPC -> \040
> This has nothing to do with terminfo. The latter is for drawing and
> moving the cursor on an alpha-numeric text screen.
> --
> Greetings
> Pete
> It isn't pollution that's harming the environment. It's the
> impurities in our air and water that are doing it.

Thank you very much Pete! I think I've got it.

1. It's the keyboard driver that ignores key-combinations like `C-,' (mentioned by Andreas). When I press `C-,', the keyboard driver received it and does nothing, so the terminal doesn't even know I've press keys. That's why emacs cannot accept `C-,' ---- emacs doesn't even know the key-press action!
2. The keyboard driver gives an ASCII code to any `Ctrl-' thing it thinks reasonable. The code is actually "stolen" from the ASCII table. Because the Char 0~32 will never be generated by a keyboard, they can be used for any purpose the driver wants. That's why Pete and Nick asked me to see `man ascii'.
3. When a key like F1~F12 or HOME, END are pressed, a key sequence begins with a ESC(27) will be passed to the terminal, and probably be passed on to emacs.
4. I guess that the keyboard driver used in an X is different with that used in a console. The former passed each key-press to a program, but not ignore combinations like `C-,'. Thus emacs in an X can receive every press of mine.

Again, a lot of thanks to Pete, and Nick, and Andreas, and everyone who helped me in this question. I just reviewed all the messages I received. I didn't understand what I've read because I took it for granted that the keyboard driver will pass everything to the terminal.

Best Regards,
Forrest Y. Yu

Stupid is as stupid does.
reply via email to

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