First, pick a unique name for your keymap, e.g., mine. Using a text editor such as notepad, create a file called mine.wc3270km in the wc3270 installation directory. (The wc3270 installation directory is usually C:\Program Files\wc3270, but can vary depending on your Windows installation and the options you chose when you installed wc3270.) In that file, put the following:
! Definition of the 'mine' keymap <Key>PRIOR: PF(7) <Key>NEXT: PF(8)
To use the keymap, you can either create a new wc3270 session, or you can modify an existing one.
To create a new one, run the wc3270 New Session Wizard. The list of available keymaps should now include mine.
To modify an existing session, use notepad to edit the session file. (Session files are located in the wc3270 installation directory, and have the suffix .wc3270, so the session file for foo is called foo.wc3270.) If the session already uses a keymap, it will have a line that starts with wc3270.keymap:. If it has this line, modify it to specify mine instead. If it does not have this line, add it:
wc3270.keymap: mine
Now, run your wc3270 session. The Page Up key should now emulate the 3270 PF7 key, and the Page Down key should now emulate the 3270 PF8 key.
[modifier...] <Key> keyname... : action[(args)]...where:
The list of names for special Windows keys, such as PRIOR, NEXT and HOME, is on the wc3270 manual page.
To find out which key or sequence of keys is being generated for any given key on your keyboard, start wc3270 with the -set eventTrace option. wc3270 will create a pop-up window showing a trace file, which will include several lines of text for each key that is pressed. Each entry will include the text for the left-hand side of a keymap entry that will match that key. You can copy and paste the text into a keymap definition. The trace file is x3trc.pid in the current directory.
The second is the show keymap command at the wc3270> prompt, which displays the current keymap. This tells you exactly which keymap entries are active. Often times it will point out that wc3270 isn't using the keymap you thought it was, or that some of your keymap entries are interfering with one another.