Path: utzoo!censor!geac!jtsv16!uunet!bloom-beacon!EXPO.LCS.MIT.EDU!jim From: jim@EXPO.LCS.MIT.EDU (Jim Fulton) Newsgroups: comp.windows.x Subject: Re: Sun function keys [really binding strings to keys for text apps] Message-ID: <8909191242.AA17680@expo.lcs.mit.edu> Date: 19 Sep 89 12:42:13 GMT References: <2645@husc6.harvard.edu> Organization: X Consortium, MIT Laboratory for Computer Science Lines: 40 Using xmodmap, is there a way to make the function key generate multi-character sequences? You wouldn't use xmodmap for this, you'd use whatever facility the application (e.g. xterm or emacs) provides for inserting strings when particular keys are typed. Xmodmap is only used to logically "re-etch" key symbols on top of keys. The way in which you do this depends upon which toolkit the application was built. For applications written with Xt-based toolkits (such as the MIT xterm), this is often done by specifying translations. The R3 xterm has the following action: string(string) Rebinds the key or key sequence to the string value; that is, inserts the string argument into the input stream. Quotation is necessary 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, the command xterm -xrm 'XTerm*VT100.Translations: #override F1: string("hello")' pops a window in which pressing F1 causes the string "hello" (without the quotes) to appear in the input stream. If this is for something that you use often, you should put the declaration into your resource database. You'll probably find that you need to specify translations for each type of text entry component. In the MIT release, this includes xterm and the Text widget. If you're lucky enough to have a version of GNU emacs that has uses Xt (there's at least one, but please don't ask me for it) to manage top-level windows and resources, you can even use translations to drive the internal gnulisp key bindings (for us naive users of emacs who've forgotten how to diddle gnuemacs keymaps).