Hi Erik34 and anyone interested in 'screen key substition,
You have to use the user .screenrc file in your login's home folder, ie:
/home/erik/.screenrc
If you don't have one, copy the general one from your system, often
located here: /etc/screenrc
cp /etc/screenrc ~/.screenrc
I modified my /home/jeff/.screenrc file based on the keys I need for
my main terminal based application "Appgen Business Software".
I need F1 through F10, actually use PF1 through PF4 instead of F1 to
F4, like an old vt100 or vt220 terminal.
I need the up, down, left and right arrows, page-up, page-down,
control-d, control-c, control-A (for screen), Below you'll see my
setup, comments start with #. One key, TAB already works if you hold
Alt + TAB.
Below you'll find a cut from my working "~/.screenrc" and may be a
starting point others. For some reason some keys didn't work until I
moved them to the top of the list, hence the random-ish order of the
key definitions. My comment lines starting with '#' show this:
#desired key === (actual-keys-pressed)
The bindkey syntax is: bindkey X stuff newkey
Replace X above by pressing the key-pair you wish to use for 'newkey',
ie ALT-1
Note: \033 == octal value of ESC,
################### cut from ~/.screenrc ###################
#F10===(alt-0)
bindkey º stuff \033[21~
#F5===(alt-5)
bindkey ∞ stuff \033[15~
#F7===(alt-7)
bindkey ¶ stuff \033[18~
#PageUp===(alt-O)
bindkey ø stuff \033[5~
#Up Arrow===(alt-K)
bindkey ˚ stuff \033[A
#Right Arrow===(alt-L)
bindkey ˙ stuff \033[D
#Down Arrow===(alt-J)
bindkey ∆ stuff \033[B
#Left Arrow===(alt-H)
bindkey ¬ stuff \033[C
#Control-D===(alt-D)
bindkey ∂ stuff \004
#Control-C===(alt-C)
bindkey ç stuff \003
#Control-W===(alt-W)
bindkey ∑ stuff \027
#Control-R===(alt-R)
bindkey ® stuff \022
#PF1===(alt-1)
bindkey ¡ stuff \033OP
#PF2===(alt-2)
bindkey ™ stuff \033OQ
#PF3===(alt-3)
bindkey £ stuff \033OR
#PF4===(alt-4)
bindkey ¢ stuff \033OS
#F6===(alt-6)
bindkey § stuff \033[17~
#F8===(alt-8)
bindkey • stuff \033[19~
#F9===(alt-9)
bindkey ª stuff \033[20~
#PD===(alt-M)
bindkey µ stuff \033[6~
#################### end of cut from ~/.screenrc ################
Have fun!
Jeff