0

I have to send Shift + F11 key to telnet host(tn5250), how do I send it using python?

For example, to send Shift + F1, I am using this sequence of characters \x1B[25~

I know there is some logic involved in conversion of keyboard's keys to ASCII characters. Can someone give me a link or details to gain knowledge in this area?

Thanks in advance.

Abhineet
  • 5,320
  • 1
  • 25
  • 43
Avi
  • 368
  • 2
  • 13
  • 1
    Are you sure that "\x1B[25~" char sequence is for "Shift+F1" or is it for "Shift+F3"? – Abhineet Apr 07 '14 at 09:24
  • Yes it translate to "Shift+F1" on my machine. – Avi Apr 07 '14 at 09:58
  • http://brebru.com/asciicodes.html – Abhineet Apr 07 '14 at 10:13
  • http://www.geocities.jp/sakachin2/xehelp/html/HID00000594.htm – Abhineet Apr 07 '14 at 10:14
  • see if you can implement a key hook:: http://stackoverflow.com/questions/21767387/detect-shift-key-presses-with-python-ctypes – Abhineet Apr 07 '14 at 10:17
  • The code listed at http://www.geocities.jp/sakachin2/xehelp/html/HID00000594.htm is not working, I think it for "vt100" and mine is "tn5250". About http://brebru.com/asciicodes.html I think the code "135" should be used with proper escape sequence. But I tried "\x1B135", "\x1B0135", "\x1B[0x135","\x135"...but not working. – Avi Apr 07 '14 at 10:28

0 Answers0