Professional Web Applications Themes

ncurses - convert to esc-sequence - UNIX Programming

Hi all on a linux 2.4.18 I'm using ncurses for a vt220-terminal-program and want it to replay from prevoulsly recorded keyins: ncursesProg < keyin. This is no problem for ascii-chars but KEY_CODES must be input in the proper vt220-esc-sequence. Currently I manually convert the KEY_CODES back to vt220-escape sequences, e.g. KEY_F1 11 is converted back to 3OP and so on. By manually I mean that I check the result of getch() if it's KEY_CODE_YES. I wonder if there would'nt be an easier methode. Thanks 4 reading and hints, Wolf...

  1. #1

    Default ncurses - convert to esc-sequence

    Hi all

    on a linux 2.4.18 I'm using ncurses for a vt220-terminal-program and
    want it to replay from prevoulsly recorded keyins:

    ncursesProg < keyin.

    This is no problem for ascii-chars but KEY_CODES must be input in the
    proper vt220-esc-sequence.
    Currently I manually convert the KEY_CODES back to vt220-escape
    sequences, e.g. KEY_F1 \0411 is converted back to \033OP and so on.
    By manually I mean that I check the result of getch() if it's KEY_CODE_YES.

    I wonder if there would'nt be an easier methode.

    Thanks 4 reading and hints,
    Wolf





    Wolf Guest

  2. #2

    Default Re: ncurses - convert to esc-sequence

    Wolf Grossi <com> wrote: 
     
     
     
     

    Perhaps keybound() does what you're asking (to simplify the conversion).

    btw, getch() doesn't return KEY_CODE_YES.

    --
    Thomas E. ey
    http://invisible-island.net
    ftp://invisible-island.net
    Thomas Guest

  3. #3

    Default Re: ncurses - convert to esc-sequence

    Thomas ey wrote: 
    >[/ref]
    [snip] 
    Thanks, this appears to be what I'm lookin for. 
    Yes; I meant "checking the KEY_CODE_YES bit"

    Wolf

    Wolf Guest

Similar Threads

  1. Replies: 0
    Last Post: October 4th, 01:05 AM
  2. #25752 [NEW]: ncurses includes in ext/ncurses/php_ncurses.h conflicts with BSD curses.
    By suga at netbsd dot com dot br in forum PHP Development
    Replies: 0
    Last Post: October 3rd, 11:41 PM
  3. [ANN] ncurses-ruby-0.8
    By Tobias Peters in forum Ruby
    Replies: 0
    Last Post: September 2nd, 08:20 PM
  4. ncurses newgroup
    By Simon in forum UNIX Programming
    Replies: 3
    Last Post: August 20th, 11:56 AM
  5. ncurses
    By maillist@bestworldweb.homelinux.com in forum Ruby
    Replies: 0
    Last Post: July 15th, 12:48 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139