title: Change the escape sequence generated by xterm for key combinations
body: <p>My goal is to set up a terminal in which a command-line interface program would behave as expected for the keyboard inputs (the program is written in xharbour originally for Windows but now I would like to port it to linux).
  I have chosen xterm to start with as it is simpler, no need for disabling default terminal key combinations. </p>
  
  <p>With putty most of the characters work out well and for those that don't I use autohotkey, an ahk script and that does the job. For example, for Ctrl+F1:
  <code>^F1::SendInput ^[O5P</code></p>
  
  <p>I tried and modified, recompiled the terminfo, changed it and changed the keyboard types but could not achieve to get a ^[O5P response for pressing Ctrl+F1 in terminal. 
  If you know any way of doing this change, please tell me... I have read trough hundreds of pages that supposedly do this but all those changes did not made any effect or not the expected effect.</p>
  
  <p>So I left trying to modify the terminal settings to achieve my Ctrl+F1 to ^[O5P goal and tried some commands and programs that would do something similar to autohotkey:</p>
  
  <ul>
  <li><code>xmodmap</code>, but for key combinations it's not working</li>
  <li><code>xdotool</code> windowactivate xyz type ^[O5P, this returns the char codes of individual characters</li>
  <li><code>xmacro</code>, it doesn't send keystrokes to other window</li>
  <li><code>ironahk</code>, I get an error right at the start with trying to run the example.ahk and couldn't find the commands that I wished for in its light manual.</li>
  <li><code>bind '\e[1;5P":"\e[O5P"'</code>, here the first keycode is what I currently get when typing ctrl+f1 and after the one that I wish to get by this combination. No effect.</li>
  <li><code>xbindkeys</code> + <code>xvkbd</code>, didn't helped either.</li>
  </ul>
  
  <p>Please help me if you already know, managed somehow to achieve this (change the key code returned for a key combination).</p>
  
  <p>I use the latest CentOS and Ubuntu for testing.</p>