ncurses - convert to esc-sequence
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > ncurses - convert to esc-sequence




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    ncurses - convert to esc-sequence  
Wolf Grossi


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-19-04 07: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










[ Post a follow-up to this message ]



    Re: ncurses - convert to esc-sequence  
Thomas Dickey


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-20-04 07: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.[/color
]

> 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





[ Post a follow-up to this message ]



    Re: ncurses - convert to esc-sequence  
Wolf Grossi


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-21-04 01:33 AM

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






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 11:51 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register