DEL, DLE, Backspace question (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: Keyboard.AsyncKeydown sorrows
Next thread: TabPanel within TabPanel


[OT] How to compile Carbon Shared Library w/ProjectBuilder?   -   Hadley, Joshua
  DEL, DLE, Backspace question   -   Jim Wagner
   Re: DEL, DLE, Backspace question   -   Jim Wagner
    Re: DEL, DLE, Backspace question   -   Frank Bitterlich
    Re: DEL, DLE, Backspace question   -   Greg Ewing
     Re: DEL, DLE, Backspace question   -   Brady Duga
     Re: DEL, DLE, Backspace question   -   Jim Wagner
     Re: DEL, DLE, Backspace question   -   Frank Bitterlich
      Re: DEL, DLE, Backspace question   -   Greg Ewing

DEL, DLE, Backspace question
Date: 12.12.02 05:45 (Wed, 11 Dec 2002 20:45:37 -0800)
From: Jim Wagner
Hello, NUG -

I'm working on an application that communicates serially with terminal-type
applications running on a variety of platforms (not my code).

One of the modes is to provide "echo" by which the terminal application
displays the characters it sent to my application.

So, my question is this: is there any consistant pattern for the use of
DEL, DLE, and BS among Mac, DOS/Windows, or unix "terminals"?

Many thanks,

Jim Wagner
Oregon Research Electronics
---------------------------------------------------------
<email address removed> Tangent, Oregon 97389
<email address removed> near Corvallis OR, home of
<email address removed> Oregon State University
----------------------------------------------------------
A computer without Windows is like a cake without mustard. - anonymous



---
A searchable archive of this list is available at:
<http://dbserver.realsoftware.com/KBDB/search.php>

Unsubscribe:
<mailto:<email address removed>>

Subscribe to the digest:
<mailto:<email address removed>>

Re: DEL, DLE, Backspace question
Date: 12.12.02 07:52 (Wed, 11 Dec 2002 22:52:43 -0800)
From: Jim Wagner
>Hello, NUG -
>
>I'm working on an application that communicates serially with terminal-type
>applications running on a variety of platforms (not my code).
>
>One of the modes is to provide "echo" by which the terminal application
>displays the characters it sent to my application.
>
>So, my question is this: is there any consistant pattern for the use of
>DEL, DLE, and BS among Mac, DOS/Windows, or unix "terminals"?
>
>Many thanks,
>
>Jim Wagner
>Oregon Research Electronics
Maybe, I should rephrase this question:

What character is sent from terminal programs on various platforms when the
DELETE key is pressed?

And, what is the expected behaviour?

Many thanks,

Jim Wagner
Oregon Research Electronics
---------------------------------------------------------
<email address removed> Tangent, Oregon 97389
<email address removed> near Corvallis OR, home of
<email address removed> Oregon State University
----------------------------------------------------------
A computer without Windows is like a cake without mustard. - anonymous



---
A searchable archive of this list is available at:
<http://dbserver.realsoftware.com/KBDB/search.php>

Unsubscribe:
<mailto:<email address removed>>

Subscribe to the digest:
<mailto:<email address removed>>

Re: DEL, DLE, Backspace question
Date: 12.12.02 15:56 (Thu, 12 Dec 2002 15:56:39 +0100)
From: Frank Bitterlich
That depends on the type of terminal - whether it's a VT100, VT52, or
one of the other five gazillion terminal types that exist.

Some terminals send a chr(127); some others send a Backspace (chr(8)).

Many terminals have a way to communicate their type (or emulation) to
the host, so that the host will know what to expect. Telnet for example
has a sophisticated system to negotiate such things with the host.

Cheers,
Frank+++

Jim Wagner wrote:
>
> >Hello, NUG -
> >
> >I'm working on an application that communicates serially with terminal-type
> >applications running on a variety of platforms (not my code).
> >
> >One of the modes is to provide "echo" by which the terminal application
> >displays the characters it sent to my application.
> >
> >So, my question is this: is there any consistant pattern for the use of
> >DEL, DLE, and BS among Mac, DOS/Windows, or unix "terminals"?
> >
> >Many thanks,
> >
> >Jim Wagner
> >Oregon Research Electronics
> Maybe, I should rephrase this question:
>
> What character is sent from terminal programs on various platforms when the
> DELETE key is pressed?
>
> And, what is the expected behaviour?

Re: DEL, DLE, Backspace question
Date: 13.12.02 00:02 (Fri, 13 Dec 2002 12:02:09 +1300 (NZDT))
From: Greg Ewing
Jim Wagner <<email address removed>>:

> What character is sent from terminal programs on various platforms when the
> DELETE key is pressed?
>
> And, what is the expected behaviour?

There's no easy answer to that, because the "expected behaviour"
depends on what the program or system running on the other end
expects. For this reason, terminal emulators very often make this
user-selectable.

If you have to make one choice, I'd say the key marked "Backspace"
or "<-" should send an ASCII backspace character (chr(8)) and the key
marked "Delete" should send an ASCII DEL character (chr(127)).

But making it a user preference would be best.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury, | A citizen of NewZealandCorp, a |
Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. |
<email address removed> +--------------------------------------+

---
A searchable archive of this list is available at:
<http://dbserver.realsoftware.com/KBDB/search.php>

Unsubscribe:
<mailto:<email address removed>>

Subscribe to the digest:
<mailto:<email address removed>>

Re: DEL, DLE, Backspace question
Date: 13.12.02 00:13 (Thu, 12 Dec 2002 15:13:53 -0800)
From: Brady Duga

On Thursday, December 12, 2002, at 03:02 PM, Greg Ewing wrote:

> Jim Wagner <<email address removed>>:
>
>> What character is sent from terminal programs on various platforms
>> when the
>> DELETE key is pressed?
>>
>> And, what is the expected behaviour?
> But making it a user preference would be best.
>
And behaving consistently with respect to whatever terminal type you
are emulating! And I seem to recall swapping the meaning of the
'delete' key for the meaning of 'backspace' was a popular preference.

--Brady
The La Jolla Underground

---
A searchable archive of this list is available at:
<http://dbserver.realsoftware.com/KBDB/search.php>

Unsubscribe:
<mailto:<email address removed>>

Subscribe to the digest:
<mailto:<email address removed>>

Re: DEL, DLE, Backspace question
Date: 15.12.02 00:17 (Sat, 14 Dec 2002 15:17:46 -0800)
From: Jim Wagner
Thanks, everyone, for the comments.

I should have been a little more complete about the question, but the
comments do help. For anywone who wants to add, here is the "real"
situation:

1. I am creating an external "box" using an 8-bit micro that is set up via
a terminal program over an RS-232 link.

2. I am creating a specialized terminal program (the RB connection) to go
with it, but users should be able to use ANY terminal program.

3. Key entries in the terminal program edit contents of internal memory in
the box.

4. Everything seemed pretty straight forward until I came to handling
backspace or delete. I noted that Mac keyboards have a key named "delete"
while the key in the same position on a WinTel machine is named "backspace".

5. I don't have a WinTel machine to test on at the moment and I am
concerned that common terminal programs might not generate the same ASCII
character when that key is pressed. And, I have no way to test with a unix
machine.

So. my question should have been:

What editing characters should my box expect from generic terminal
programs, such as WinTerm.

Again, thanks to all who have already responded....

Jim Wagner
Oregon Research Electronics
---------------------------------------------------------
<email address removed> Tangent, Oregon 97389
<email address removed> near Corvallis OR, home of
<email address removed> Oregon State University
----------------------------------------------------------
A computer without Windows is like a cake without mustard. - anonymous



---
A searchable archive of this list is available at:
<http://dbserver.realsoftware.com/KBDB/search.php>

Unsubscribe:
<mailto:<email address removed>>

Subscribe to the digest:
<mailto:<email address removed>>

Re: DEL, DLE, Backspace question
Date: 16.12.02 13:59 (Mon, 16 Dec 2002 13:59:54 +0100)
From: Frank Bitterlich
Hi Jim,

Jim Wagner wrote:
...
> 4. Everything seemed pretty straight forward until I came to handling
> backspace or delete. I noted that Mac keyboards have a key named "delete"
> while the key in the same position on a WinTel machine is named "backspace".

This is a slight misunderstanding from what I can see. I came across
some cheap ADB keybords (back in the days when I was servicing Apple
hardware) that that the Backspace key (the one above the Return key)
labelled "Delete". I was thinking "uh oh..." back then, but surprisingly
until today I've never noticed the confusion I feared it would create.
Until today :)

The facts:
- The key above the Carriage Return key is the "Backspace" key. It
should return the ASCII code 0x08 (unless in very special setups).

- The key below the "Help" key (on the extended keyboard; on Wintel
machines it is below the "Insert" key) is the "Delete" key. It will in
most cases return 0x7F or Chr(127).

> 5. I don't have a WinTel machine to test on at the moment and I am
> concerned that common terminal programs might not generate the same ASCII
> character when that key is pressed. And, I have no way to test with a unix
> machine.

That depends on the Terminal that the program emulates, which can (in
most cases) be chosen by the user.

> So. my question should have been:
>
> What editing characters should my box expect from generic terminal
> programs, such as WinTerm.

Again, depends on emulation. The most common terminal emulation IMO is
the VT100. An excerpt:
> (* ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** *)
>
> CONTROL SEQUENCE SUMMARY
>
> * For additional information on the DEC VT100 and VT102 terminals, please
> consult the VT100 USER GUIDE and VT102 USER GUIDE, published by Digital
> Equipment Corporation as part numbers EK-VT100-UG and EK-VT102-UG.
>
>
> CONTROL CHARACTERS:
> ------------------
>
> Character
> Name Decimal Action Taken
> ----------------------------------------------------------------
> NUL 0 Fill character; ignored on input.
> ENQ 5 Transmit answerback message.
> BEL 7 Ring the bell.
> BS 8 Move cursor left.
> HT 9 Move cursor to next tab stop.
> LF 10 Line feed; causes print if in autoprint.
> VT 11 Same as LF.
> FF 12 Same as LF.
> CR 13 Move cursor to left margin or newline.
> SO 14 Invoke G1 character set.
> SI 15 Invoke G0 character set.
> XON 17 Resume transmission.
> XOFF 19 Halt transmission.
> CAN 24 Cancel escape sequence and display checkerboard.
> SUB 26 Same as CAN.
> ESC 27 Introduce a control sequence.
> DEL 127 Fill character; ignored on input.
>
> * All characters less than 32 decimal which are not listed above are ignored.
>
> (* ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** *)
>
> ANSI MODE SUMMARY:
> -----------------
>
> *In ANSI sequences, parameters are given as a string of ASCII digits
> ('0' - '9') seperated by semicolons. Pn refers to a number whose value
> used directly. Ps refers to a number used as a selector.
>
> CURSOR MOVEMENT:
> ---------------
>
> Cursor Up: Esc [ Pn A
> Cursor Down: Esc [ Pn B
> Cursor Left: Esc [ Pn C
> Cursor Right: Esc [ Pn D
>
> Direct Addressing : Esc [ Pn(row);Pn(col);H or
> Esc [ Pn(row);Pn(col);f
>
> ie. (Pascal)
> Writeln (Esc,'[',Row:1,';',col:1,';','H');
>
> Index: Esc D
> New Line: Esc E
> Reverse Line: Esc M
>
> Save cursor & Attributes: Esc 7
> Restore cursor & attributes: Esc 8
>
> ERASING:
> -------
>
> Cursor to end of line Esc [ K
> Beginning of line to cursor Esc [ 1 K
> Entire line Esc [ 2 K
> Cursor to end of screen Esc [ J
> Beginning of screen to cursor Esc [ 1 J
> Entire screen Esc [ 2 J
>
> (Some programs expect Esc [ J to always clear the entire
> screen, but this does not conform to the standard.)
>
> MODES:
> -----
>
> Set with Esc [ Ps h
> Reset with Esc [ Ps l
>
> Mode name Ps Set Reset
> --------------------------------------------------------------------
> Keyboard action 2 Locked Unlocked
> Insertion 4 Insert Overwrite
> Send - Receive 12 Full Echo
> Line feed/New line 20 New line Line feed
> Cursor key ?1 Application Cursor
> ANSI/VT52 ?2 ANSI VT52
> Column ?3 132 80
> Scrolling ?4 Smooth Jump
> Screen ?5 Reverse Normal
> Origin ?6 Relative Absolute
> Wraparound ?7 Wrap Truncate
> Auto key repeat ?8 Repeating No repeat
> Print form feed ?18 Yes No
> Print extent ?19 Full screen Scrolling region

There's more; you can find it e.g. at

http://www.geocities.com/SiliconValley/Campus/7071/vtcodes.html

Cheers,
Frank+++

Re: DEL, DLE, Backspace question
Date: 16.12.02 23:01 (Tue, 17 Dec 2002 11:01:34 +1300 (NZDT))
From: Greg Ewing
Frank Bitterlich <<email address removed>>:

> I came across some cheap ADB keybords (back in the days when I was
> servicing Apple hardware) that that the Backspace key (the one above
> the Return key) labelled "Delete". I was thinking "uh oh..."

This is the way it was on the original Mac keyboards
(128/512/Plus) -- they didn't have a key labelled "Backspace"
at all. So those keyboards were actually being true to the Mac
way.

> but surprisingly until today I've never noticed the confusion I feared
> it would create.

Probably because, since the Mac never had a "Backspace" key
until later in its life, Mac applications tend not to rely
on having both "Backspace" and "Delete" keys that do different
things. Terminal emulators are kind of special in this regard.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury, | A citizen of NewZealandCorp, a |
Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. |
<email address removed> +--------------------------------------+

---
A searchable archive of this list is available at:
<http://dbserver.realsoftware.com/KBDB/search.php>

Unsubscribe:
<mailto:<email address removed>>

Subscribe to the digest:
<mailto:<email address removed>>