Bug 836

Summary: EDIT does not accept ALL control codes as typed chars
Product: Edit Reporter: bart.oldeman_bristol.ac.uk@freedos.org <bart.oldeman_bristol.ac.uk@freedos.org>
Component: coreAssignee: edit@freedos.org <edit@freedos.org>
Status: RESOLVED WORKSFORME    
Severity: major    
Priority: P2    
Version: 0.6   
Hardware: PC   
OS: FreeDOS   

Description:   Opened: 2001-08-09 07:34
- in many editors,
Ctrl+P Esc
inserts the Escape character. (looks like <-)
Ctrl+P Ctrl+A
inserts a smiley
etc.
I couldn't find how to do that in FreeDOS edit.
EDIT 0.5
------- Comment #1 From eric_coli.uni-sb.de.nospamplease@freedos.org 2002-11-13 06:32:25 -------
Subject: The "block unprintable" system of EDIT investigated: Allow ASCII 0..31
here...

I think the culprit is in message.c:
                if (c != '\r' && (c < ' ' || c > 127))
                        clearBIOSbuffer();
However, with "Alt-223" I am able to insert ASCII 223,
so maybe there is more behind it that I have thought.
Ah, here we go, in EDITBOX.C:
/* --------- All displayable typed keys ------------- */
static void KeyTyped(WINDOW wnd, int c)
...
    if ((c != '\n' && c < ' ') || (c & 0x1000))
        /* ---- not recognized by editor --- */
        return;
...
which is called by
static int KeyboardMsg(WINDOW wnd, PARAM p1, PARAM p2)
and then by
static void DoKeyStroke(WINDOW wnd, int c, PARAM p2)
by the way, the output of getkey() is:
    if (((c = bioskey(0)) & 0xff) == 0)
        c = (c >> 8) | 0x1080;
    else
        c &= 0xff;
    return c & 0x10ff;
which gets sent into the message queue by some event collecting
function. I just tell because this explains when the 0x1000 bit is
set.
Eric
------- Comment #2 From jhall@freedos.org 2003-11-18 13:26:28 -------
Assigning to FreeDOS_1.0 milestone. -jh
------- Comment #3 From jhall@freedos.org 2003-11-18 14:35:22 -------
Upgrading the severity from 'normal' to 'major'.  If it's on the "1.0 to-do
list", then it should be more important than a 'normal' severity.  -jh
------- Comment #4 From Eric (EA) 2003-11-28 20:54:23 -------
You can now type every control code which is not used to control EDIT
(currently, Ctrl-C/V/X are used for the clipboard and Ctrl-Z for UNDO).
In particular, you can simply type ESC to type the ESC char in your text
now. Note that Ctrl-H/I/J/M are simply backspace, tab, cr, lf, and that
you cannot yet control cr/lf processing nor type backspaces in the text.
You do not type Ctrl-P, but rather type the desired special key directly.

I have added a "tab width 0" menu option which lets you edit TAB chars
without expanding them to spaces, and when you load a file, you are
prompted whether you want to expand tabs to spaces.

All this and more now in EDIT 0.6d :-).
------- Comment #5 From Eric (EA) 2003-12-01 19:53:15 -------
You can now type "^P followed by anything" to type that anything
as a verbatim char (including things like backspace). However,
you cannot manually override CR / LF style with this function.

You can also type Alt-numpad-digits to type most control chars
directly (without the Ctrl-C/V/X/Z limitation): Only things like
tab and backspace cannot be typed this way. Note that tabs can
be treated like "any other char" simply by selecting a tab size
below 2 in the tab size menu.

If you agree that EDIT 0.7 fixes this Bugzilla entry, please
mark the bug as fixed. Thanks and have fun with EDIT.