My basic problem is this: I want to map the "Print" and "Pause" keys to emacs' save-buffer and save-buffer-kill-emacs commands, respectively, within xterm windows. I want to do this by providing the following "portable" entries in my .emacs file, which look like
(global-set-key [Print] 'save-buffer)
(global-set-key [Pause] 'save-buffer-kill-emacs)
I installed Fedora 14 a couple of months ago and have been fighting with it to do this ever since (sporadically, admittedly).
Under F14 with gnome, the "Print" key (Print Scr) takes a screen shot, which is a reasonable mapping. However, I never take screen shots. I was able to disable this key association by setting /etc/inittab to run state 3 (thereby disabling the gnome window manager altogether -- which I also disabled because I prefer fvwm -- why would one not want to provide a window manager where you can switch between desktops simply by rolling over to them using your mouse?). Without gnome, both the Print and the Pause keys seem to send nothing, at least according to emacs' "quoted-insert" command.
If I set the following in my .Xdefaults file
XTerm*vt100.translations: #override \
Shift <Key>Print: string("\033[50~") \n\
<Key>Print: string("\033[40~") \n\
Shift <Key>Pause: string("\033[51~") \n\
and load it using
xrdb -load $HOME/.Xdefaults
I then find that these two keys do properly send the above sequences. Unfortunately, the above sequences do not seem to correspond to emac's idea of what "Print" and "Pause" mean.
How can I figure out what "Print" and "Pause" mean to emacs? I.e. what string should I associated with "Pause" and "Print" so that emacs will then properly associate [Print] and [Pause] to "save-buffer" and "save-buffer-kill-emacs"?
Note: for keycode 107, which I think is normally associated with "Print" or "Print Scr", I get the following results (all under the X-server provided by F14);
xev reports that keycode 107 has keysym 0xff61,
xmodmap -pke reports
keycode 107 = Print Sys_Req Print Sys_Req
emacs quoted-insert reports nothing
keycode 107 = Select