Actions

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. The following actions are provided for using within the vt100 or tek4014 translations resources:

This action rings the keyboard bell at the specified percentage above or below the base volume.

This action ignores the event but checks for special pointer position escape sequences.

bell([percent])

ignore()

insert()

insert-seven-bit() insert-eight-bit()

keymap(name)

popup-menu(menuname)

secure()

This action inserts the character or string associated with the key that was pressed.

This action is a synonym for insert ().

This action inserts an eight-bit (Meta) version of the character or string associated with the key that was pressed. The exact action depends on the value of the eightBitlnput resource. This action inserts the string found in the selection or cut buffer indicated by sourcename. Sources are checked in the order given (case is significant) until one is found. Commonly used selections include PRIMARY, SECONDARY, and CLIPBOARD. Cut buffers are typically named CUT_BUFFER0 through CUT_BUFFER7.

This action dynamically defines a new translation table whose resource name is name with the suffix Keymap (case is significant). The name None restores the original translation table. This action displays the specified pop-up menu. Valid names (case is significant) include mainMenu, vtMenu, fontMenu, and tekMenu.

This action toggles the Secure Keyboard mode described in the "Security" subsection, and is invoked from the securekbd entry in mainMenu.

select-start()

select-extend()

select-end (destname [, ...]) select-cursor-start()

select-cursor-end (destname [, ...]) set-vt-font (d/1/2/3/4/5/6/e/s [,normalfont [, boldfont]])

start-extend () start-cursor-extend() string(string)

scroll-back(count [,units])

scroll-forw(count [,units])

allow-send-events (on/off/toggle) redraw()

send-signal(signame)

This action begins text selection at the current pointer location. See the subsection on "Pointer Usage" for information on making selections.

This action tracks the pointer and extends the selection. It should only be bound to Motion events. This action puts the currently selected text into all of the selections or cut buffers specified by destname. This action is similar to select-start except that it begins the selection at the current text cursor position. This action is similar to select-end except that it should be used with select-cursor-start. This action sets the font or fonts currently being used in the VT102 window. The first argument is a single character that specifies the font to be used: d or D indicate the default font (the font initially used when xterm was started), 1 through 6 indicate the fonts specified by the font1 through font6 resources, e or E indicate the normal and bold fonts that have been set through escape codes (or specified as the second and third action arguments, respectively), and s or S indicate the font selection (as made by programs such as xfontsel(1)) indicated by the second action argument.

This action is similar to select-start except that the selection is extended to the current pointer location.

This action is similar to select-extend except that the selection is extended to the current text cursor position.

This action inserts the specified text string as if it had been typed. Quotation is necessary if the string contains whitespace or nonalphanumeric characters. If the string argument begins with the characters 0x, it is interpreted as a hex character constant.

This action scrolls the text window backward so that text that had previously scrolled off the top of the screen is now visible. The count argument indicates the number of units (which may be page, half page, pixel, or line) by which to scroll. This action scroll is similar to scroll-back except that it scrolls the other direction.

This action set or toggles the allowSendEvents resource and is also invoked by the allowsends entry in mainMenu. This action redraws the window and is also invoked by the redraw entry in mainMenu.

This action sends the signal named by s i gname to the xterm subprocess (the shell or program specified with the -e command-line option) and is also invoked by the suspend, continue, interrupt, hangup, terminate, and kill entries in mainMenu. Allowable signal names are (case is not significant) tstp (if supported by the operating system), suspend (same as tstp), cont (if supported by the operating system), int, hup, term, quit, alrm, alarm (same as alrm), and kill. This action sends a SIGHUP to the subprogram and exits. It is also invoked by the quit entry in mainMenu.

set-scrollbar(on/off/toggle)

set -j umpscroll(on/off/toggle)

set-reverse-video(on/off/toggle)

set-autowrap(on/off/toggle)

set-reversewrap(on/off/toggle)

set-autolinefeed(on/off/toggle)

set-appcursor(on/off/toggle)

set-appkeypad(on/off/toggle)

set-scroll-on-key(on/off/toggle)

set-scroll-on-tty-output(on/off/toggle)

set-allow132(on/off/toggle)

set-cursesemul(on/off/toggle)

set-visual-bell(on/off/toggle)

set-marginbell(on/off/toggle)

set-altscreen(on/off/toggle) soft -reset()

hard -reset() clear-saved - lines() set-terminal-type(type) set-visibility(vt/tek,on/off/toggle) set-tek-text(large/2/3/small)

tek-page()

This action toggles the scrollbar resource and is also invoked by the scrollbar entry in vtMenu.

This action toggles the j umpscroll resource and is also invoked by the jumpscroll entry in vtMenu.

This action toggles the reverseVideo resource and is also invoked by the reversevideo entry in vtMenu. This action toggles automatic wrapping of long lines and is also invoked by the autowrap entry in vtMenu. This action toggles the reverseWrap resource and is also invoked by the reversewrap entry in vtMenu. This action toggles automatic insertion of line-feeds and is also invoked by the autolinefeed entry in vtMenu. This action toggles the handling Application Cursor Key mode and is also invoked by the appcursor entry in vtMenu. This action toggles the handling of Application Key-pad mode and is also invoked by the appkeypad entry in vtMenu. This action toggles the scrollKey resource and is also invoked from the scrollkey entry in vtMenu. This action toggles the scrollTtyOutput resource and is also invoked from the scrollttyoutput entry in vtMenu. This action toggles the c132 resource and is also invoked from the allow132 entry in vtMenu.

This action toggles the curses resource and is also invoked from the cursesemul entry in vtMenu.

This action toggles the visualBell resource and is also invoked by the visualbell entry in vtMenu.

This action toggles the marginBell resource and is also invoked from the marginbell entry in vtMenu.

This action toggles between the alternate and current screens. This action resets the scrolling region and is also invoked from the softreset entry in vtMenu.

This action resets the scrolling region, tabs, window size, and cursor keys, and clears the screen. It is also invoked from the hardreset entry in vtMenu.

This action does hard-reset() and also clears the history of lines saved off the top of the screen. It is also invoked from the clearsavedlines entry in vtMenu.

This action directs output to either the vt or tek windows, according to the type string. It is also invoked by the tekmode entry in vtMenu and the vtmode entry in tekMenu. This action controls whether or not the vt or tek windows are visible. It is also invoked from the tekshow and vthide entries in vtMenu and the vtshow and tekhide entries in tekMenu. This action sets font used in the Tektronix window to the value of the resources tektextlarge, tektext2, tektext3, and tektextsmall according to the argument. It is also by the entries of the same names as the resources in tekMenu. This action clears the Tektronix window and is also invoked by the tekpage entry in tekMenu.

visual-bell()

The Tektronix window also has the following action:

tek-reset()

tek-copy()

This action resets the Tektronix window and is also invoked by the tekreset entry in tekMenu.

This action copies the escape codes used to generate the current window contents to a file in the current directory beginning with the name COPY. It is also invoked from the tekcopy entry in tekMenu. This action flashes the window quickly.

This action sends the indicated graphics input code.

The default bindings in the VT102 window are

Shift <KeyPress> Prior: scroll-back(1,halfpage) \n\ Shift <KeyPress> Next: scroll-forw(1,halfpage) \n\ Shift <KeyPress> Select: select-cursor-start() \ select-cursor-end(PRIMARY, CUT_BUFFER0) \n\

Shift <KeyPress> Insert: insert-selection(PRIMARY, CUT_BUFFER0) \n\

"Meta<KeyPress>: insert-seven-bit() \n\

Meta<KeyPress>: insert-eight-bit() \n\

!Ctrl <Btn1Down>: popup-menu(mainMenu) \n\

!Lock Ctrl <Btn1Down>: popup-menu(mainMenu) \n\

!Mod2 Ctrl <Btn1Down>: popup-menu(mainMenu) \n\

!Mod2 Lock Ctrl <Btn1Down>: popup-menu(mainMenu) \n\

"Meta <Btn1Motion>: select-extend() \n\

!Lock Ctrl <Btn2Down>: popup-m

The default bindings in the Tektronix window are

"Meta<KeyPress>: insert-seven-bit() \n\ Meta<KeyPress>: insert-eight-bit() \n\ !Ctrl <Btn1Down>: popup-menu(mainMenu) \n\ !Lock Ctrl <Btn1Down>: popup-menu(mainMenu) \n\ !Mod2 Ctrl <Btn1Down>: popup-menu(mainMenu) \n\ !Mod2 Lock Ctrl <Btn1Down>: popup-menu(mainMenu) \n\ !Ctrl <Btn2Down>: popup-menu(tekMenu) \n\ !Lock Ctrl <Btn2Down>: popup-menu(tekMenu) \n\ !Mod2 Ctrl <Btn2Down>: popup-menu(tekMenu) \n\ !Mod2 Lock Ctrl <Btn2Down>: popup-menu(tekMenu) \n\ Shift "Meta<Btn1Down>: gin-press(L) \n\ "Meta<Btn1Down>: gin-press(l) \n\ Shift "Meta<Btn2Down>: gin-press(M) \n\ "Meta<Btn2Down>: gin-press(m) \n\ Shift "Meta<Btn3Down>: gin-press(R) \n\ "Meta<Btn3Down>: gin-press(r)

Below is a sample how of the keymap() action is used to add special keys for entering commonly typed works:

*VT100.Translations: #override <Key>F13: keymap(dbx) VT100.dbxKeymap.translations: \ <Key>F14: keymap(None) \n\ <Key>F17: string("next") string(0x0d) \n\ <Key>F18: string("step") string(0x0d) \n\ <Key>F19: string("continue") string(0x0d) \n\

<Key>F20: string("print ") insert-selection(PRIMARY, CUT_BUFFER0)

Was this article helpful?

0 0

Post a comment