|
Home > Archive > Unix Programming > February 2004 > ncurses - convert to esc-sequence
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
ncurses - convert to esc-sequence
|
|
| Wolf Grossi 2004-02-19, 2:34 am |
| 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
| |
| Thomas Dickey 2004-02-20, 2:34 am |
| Wolf Grossi <ng-wg@magro-soft.com> wrote:
> 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.
Perhaps keybound() does what you're asking (to simplify the conversion).
btw, getch() doesn't return KEY_CODE_YES.
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
| |
| Wolf Grossi 2004-02-20, 8:33 pm |
| Thomas Dickey wrote:
> Wolf Grossi <ng-wg@magro-soft.com> wrote:
>
>
[snip]
>
> Perhaps keybound() does what you're asking (to simplify the conversion).
Thanks, this appears to be what I'm lookin for.
>
> btw, getch() doesn't return KEY_CODE_YES.
Yes; I meant "checking the KEY_CODE_YES bit"
Wolf
|
|
|
|
|