jim@EXPO.LCS.MIT.EDU (Jim Fulton) (09/19/89)
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 <Key> 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).
pf@islington-terrace.csc.ti.com (Paul Fuqua) (09/21/89)
Date: Tuesday, September 19, 1989 7:42am (CDT) From: jim at EXPO.LCS.MIT.EDU (Jim Fulton) Subject: Re: Sun function keys [really binding strings to keys for text apps] For example, the command xterm -xrm 'XTerm*VT100.Translations: #override <Key> 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. In my resource database, I have XTerm*Translations: #override <Key>F28: string("clear") string(0x0d)\n\ <Key>Clear: string(0x15) (That makes the clear-screen key on my lispm send "clear\n" and the clear-input key send ^U.) Whenever I start up an xterm, I get the message "X Toolkit Warning: Actions not found: string" although everything actually works. I see the message when I start xterm on a Sun 4/280 or a MIPS M2000 running X11R3, but not when I start one on a Stellar running something X11R2ish. What's the problem? Paul Fuqua pf@csc.ti.com {smu,texsun,cs.utexas.edu,rice}!ti-csl!pf Texas Instruments Computer Science Center PO Box 655474 MS 238, Dallas, Texas 75265
swick@ATHENA.MIT.EDU (Ralph R. Swick) (09/21/89)
> In my resource database, I have > > XTerm*Translations: ... > Whenever I start up an xterm, I get the message "X Toolkit Warning: > Actions not found: string" although everything actually works. Your resource specification says "for all widgets in XTerm...". There are many other widgets besides the (virtual) VT100 widget; i.e. the Scrollbar, not all of which have a string() action. Make it XTerm*VT100.Translations, as Jim suggested and you'll be fine. This is a common error...