Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

ANSI escapes for input (Developers)

posted by kerravon, Ligao, Free World North, 27.07.2023, 07:25

> Hey, it's OK to make old software and machines do unreasonable things. I'm
> not arguing with you about the merits of that; it's your project and not my
> business. I'm just pointing out that it's not in ANSI.SYS or any other
> device driver I know of for DOS because that's not how DOS software at the
> time used the keyboard.

Ok, thanks. That sounds like a chicken and egg
problem though.

> Usually if you want to write something that runs on multiple platforms you
> include some sort of compatibility layer that hides the machine specifics,
> like the curses library on Unix.

I see.

> Trying to bend the various OSes to your
> will is a very different approach. For DOS specifically you'll need a
> device driver that intercepts the BIOS routine and generates the ESC
> sequences that you are looking for.

I was thinking a TSR that hooks the DOS read, for
read from handle 0.

> Which will be fine while you are in
> your program, but that device driver will interfere with other DOS
> programs.

I didn't even think of that. The thing is - I'm not
running other DOS programs. Only Win32 programs,
using HX.

And even then - I'm only running Win32 programs that
I provide myself. Well - ones that read from the
keyboard and do something with cursor keys, anyway.
And really only one of them even - microemacs 3.6.

> Which is probably why a device driver that remaps the cursor
> keys like that doesn't exist.

Ok, makes sense. Thanks. I have an abnormal use case.
So I'll need to organize that myself.

Actually, the BIOS might be a better place to intercept.
Because if I redirect stdin to a file, for some unusual
situation like automatic commands for microemacs, it would
have the ANSI escapes in there already. And I wouldn't be
able to translate a single ESC pressed by the user into
two ESC for the stream.

And if that command STTY or whatever it is that redirects
stdin to a serial port, was run, and I attached a VT100
or whatever to the serial port, it shouldn't be interfered
with either.

BFN. Paul.

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 50 users online (0 registered, 50 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum