C3270 keymap tutorial

From The x3270 Wiki
Revision as of 02:24, 10 August 2022 by Pmattes (talk | contribs) (→‎Description)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

How to create a c3270 custom keymap.

First steps

First, you might want to make sure that the action you want isn't already defined in the default keymap. The default keymap defines common actions. For example, the Reset() action, which unlocks the keyboard, is defined as Ctrl-R.

Defining a simple keymap in .c3270pro

Using your favorite text editor, create a file called .c3270pro in your home directory. In that file, put the following:

! Use the 'mine' keymap, defined below
c3270.keymap: mine
! Definition of the 'mine' keymap
c3270.keymap.mine: \
 <Key>PPAGE: PF(7)\n\
 <Key>NPAGE: PF(8)

The first entry tells c3270 to use the keymap named mine. The second entry is the definition of the mine keymap itself.

Now, run c3270, and do not specify a -keymap command-line option. The PPAGE key (usually labelled Page Up) will now emulate the 3270 PF7 key, and the NPAGE key (usually labelled Page Down) will emulate the 3270 PF8 key. (If you do not have a Page Up or Page Down key, or if these keys are not properly defined in your terminfo database, this will not work.)

See also

c3270/keymap