Some useful key codes for Terminal.app. The default behavior appears to be that the keys Page Up and Page Down will go up and down the Terminal.app buffer and not sent to the terminal program. This can be very annoying for interacting with programs like Emacs when it’s running in the terminal. The following are a few non-printing characters and their key bindings for use in the Terminal.app keyboard options. (From a post in the macosxhints.com forums)
Pause = 32
Macro = 3 # Break (Shift-Pause)
Home = 33[1~
Insert = 33[2~
Remove = 33[3~ # Delete
End = 33[4~
PageUp = 33[5~
PageDown = 33[6~