I think tput will let you get the value of the F-key, but not reprogram it. ie, you can read the contents of the terminfo entry, and use those entries, but you can't update the actual terminfo entry.<br><br>From a <FONT FACE=monospace>tput</font> man page on a SCO box here:<br><FONT FACE=monospace><br> tput uses the terminfo database to make the values of<br> terminal-dependent capabilities and information available to the shell<br> (see sh(1)), to initialize or reset the terminal, or return the long<br> name of the requested terminal type. tput outputs a string if the<br> attribute (capability name) is of type string, or an integer if the<br> attribute is of type integer.<br></font><br>and so on... In other words, it's read only.<br><br>So, what you probably need is a new terminfo entry containing your amendments. This is easier to do than it sounds.<br><br>1) Think of a <b>new</b> name for your terminal type. Do not overwrite an existing terminfo entry, in case you have problems.<br><br>2) Use the <FONT FACE=monospace>infocmp</font> command to get the terminfo entry for the terminal type you want to amend. For example:<br><FONT FACE=monospace><br>$ <b>infocmp xterm</b><br># Reconstructed via infocmp from file: /usr/share/lib/terminfo/x/xterm<br><b>xterm</b>¦<b>xterm terminal emulator (monochrome)</b>,<br> am, km, mir, msgr, xenl, xon,<br> cols#80, lines#24,<br> acsc=aakkllmmjjnnwwvvuuttqqxx, bel=^G, bold=\E[1m,<br> clear=\E[H\E[2J, cr=\r, csr=\E[%i%p1%d;%p2%dr,<br> cub=\E[%p1%dD, cud=\E[%p1%dB, cud1=\n, cuf=\E[%p1%dC,<br> cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA,<br> cuu1=\E[A, dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM,<br> dl1=\E[M, ed=\E[J, el=\E[K, home=\E[H, ht=\t, hts=\EH,<br> ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, il1=\E[L,<br> ind=\n, is2=\E7\E[r\E[m\E[?7h\E[?1;3;4;6l\E[4l\E8\E>,<br> kLFT=\E[d, kRIT=\E[c, kbs=\b, kcbt=\E[Z, kcub1=\E[D,<br> kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kend=\E[8~,<br> kf1=\E[11~, kf10=\E[21~, <b>kf11=\E[23~</b>, kf12=\E[24~,<br> kf2=\E[12~, kf3=\E[13~, kf4=\E[14~, kf5=\E[15~,<br> kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,<br> khome=\E[7~, knp=\E[6~, kpp=\E[5~, rc=\E8, ri=\EM,<br> rmacs=\E(B, rmcup=\E[2J\E[?47l\E8, rmso=\E[m,<br> rmul=\E[m,<br> rs1=\E>\E[1;3;4;5;6l\E[?7h\E[m\E[r\E[2J\E[H,<br> rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7,<br> sgr0=\E[m\E[m, smacs=\E(0, smcup=\E7\E[?47h,<br> smso=\E[7m, smul=\E[4m, tbc=\E[3g,<br></font><br> In the example above, I've highlighted the items that will need changing.<br><br>3) If the terminfo entry is the one you want, re-run the <FONT FACE=monospace>infocmp</font> command again, this time redirecting the output to a new file. For example:<br><FONT FACE=monospace><br>infocmp xterm >myxterm.txt<br></font><br><br>4) Edit the file you just created. Change the "short name" of the terminal (<i>xterm</i> highlighted in the example above), and the description of the terminal (highlighted above immediately following xterm). This will ensure that you create a <i>new</i> terminfo entry. To see what termingo entries already exist, list the contents of <FONT FACE=monospace>/usr/lib/terminfo/<i>x</i></font>, where <i>x</i> is the initial letter of the name you want to use.<br><br>5) Edit the <FONT FACE=monospace>kf11</font> entry to set the value for F11 that you want to use. Then save your changes and exit.<br><br>6) Recompile your new terminfo entry. You need to be root to do this:<br><FONT FACE=monospace><br>tic myxterm.txt<br></font><br>7) Finally, set TERM to be your new terminal name. eg,<br><FONT FACE=monospace><br>export TERM=xterm-new<br></font><br><br>So, if you want to set your F11 key to send the string "date" followed by "<Return>", change kf11 to be:<br><FONT FACE=monospace><br>kf11=date\r<br></font><br><br>Hope this helps. <p> <br><a href=mailto: > </a><br><a href= > </a><br>--<br>
0 1 - Just my two bits