Path: utzoo!attcan!uunet!lll-winken!ames!think!bloom-beacon!EXPO.LCS.MIT.EDU!jim From: jim@EXPO.LCS.MIT.EDU (Jim Fulton) Newsgroups: comp.windows.x Subject: Re: function key binding to strings under X11.3 Message-ID: <8901101906.AA27264@EXPO.LCS.MIT.EDU> Date: 10 Jan 89 19:06:46 GMT References: <1668@helios.ee.lbl.gov> Sender: daemon@bloom-beacon.MIT.EDU Organization: X Consortium, MIT Laboratory for Computer Science Lines: 64 > It seems that there is no way to define strings for the function > keys on a global scale (all clients connected to the server). You mean "strings for *textual* applications that translate key presses into some character set (perhaps ISO Latin-1)". > > ... > > What I want is a global binding, so that, for example, some function > keys have strings defined (e.g.) for vi, some for dbx, etc. But none of these programs (vi, dbx, etc.) are clients connected to the server! Instead, you are asking for a way for all clients of class XTerm to insert particular strings when particular keys are pressed. I know it sounds trivial, but the distinction is important. For example, would you want the same things to be inserted in an editor? Or in a text widget? In some cases you might, but probably not very many. > I have hacked xterm to read a .funkey file to do just that, but if anybody > knows of a more "correct" way to do this, I would be most pleased if > you could share that information. Yes, use the translation manager! The string() action was added in R3 specifically to support insertion of strings. From the xterm man page: KEY TRANSLATIONS It is possible to rebind keys (or sequences of keys) to arbitrary strings for input, by changing the translations for the vt100 or tek4014 widgets. Changing the translations for events other than key and button events is not expected, and will cause unpredictable behavior. ... string(string) Rebinds the key or key sequence to the string value; that is, inserts the string argument into the input stream. Quotation is neces- sary if the string contains whitespace or non-alphanumeric characters. If the string argument begins with the characters ``0x'', it is interpreted as a hex character constant and the corresponding character is sent in the normal way. ... For example, a debugging session might benefit from the fol- lowing bindings: *VT100.Translations: #override F13: keymap(dbx) *VT100.dbxKeymap.translations: \ F14: keymap(None) \n\ F17: string("next") string(0x0d) \n\ F18: string("step") string(0x0d) \n\ F19: string("continue") string(0x0d) \n\ F20: string("print ") insert-selection(PRIMARY, CUT_BUFFER0)