On 2012-09-01, Thorsten Jolitz wrote:
> I have the following in my .emacs (since the C-M-v keybinding does not
> work on the console in my case):
>
To debug key sequence translation in console use Expect script:
https://sourceforge.net/u/gavenkoa/utils/ci/tip/tree/misc/keyseq.exp?format=raw
or such C program:
#include <stdlib.h>
#include <stdio.h>
int main()
{
int ch;
while ((ch = getchar()) != EOF) {
if (ch == 27) {
puts("key: \\e");
} else if (ch <= 26) {
printf("hex: ox%02x, key: \\C-%c\n", ch, ch+64);
} else {
printf("hex: ox%02x, key: %c\n", ch, ch);
}
}
return EXIT_SUCCESS;
}
You can switch terminal in raw mode before run C program:
$ stty raw
or press RET after.
--
Best regards!