Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!watmath!clyde!cbatt!ucbvax!sdcsvax!gould9!joel
From: joel@gould9.UUCP
Newsgroups: comp.sys.mac
Subject: Re: Should we support (official solutions)
Message-ID: <912@gould9.UUCP>
Date: Wed, 10-Dec-86 10:59:49 EST
Article-I.D.: gould9.912
Posted: Wed Dec 10 10:59:49 1986
Date-Received: Sun, 14-Dec-86 03:23:15 EST
References: <385@runx.OZ> <1366@hoptoad.uucp> <342@apple.UUCP> <1411@hoptoad.uucp> <368@apple.UUCP>
Organization: Western Software Technology, Vista, CA
Lines: 119

In article <368@apple.UUCP>, dgold@apple.UUCP (David Goldsmith) writes:
> Somehow I feel I'm getting myself into this deeper and deeper, but I'll
> try to reply.  

I appreciate David's honesty in this matter, and his willingness to cooperate.

> First off I should cheat by once again extending my
> previous answer.  There are a class of things which we do not publish
> because A) not enough people care to make it worth a Tech Note, or
> B) we don't want people to do it unless they absolutely have to.  The reason
> for this is not that we think it's a morally indefensible thing to do, but
> because the devloper who does it is likely to get burned in the future as
> we change things (remember what started this whole discussion).

My point is that people do these things, and you will either A) burn people 
with incompatibilities or B) eventually have to standardize these.

> >   1.   How do you interrogate or modify the mapping of key codes
> >	to ASCII values?  For example, how do I find the key code
> >	for Enter?
> 
> This is done by calling the keyboard driver with a key code and seeing what
> it returns.  Depending on this information will make your program dependent
> on the layout of the keyboard.  I don't see why ASCII isn't sufficient.

No, it depends on the undocumented keyboard driver interface, which is subject
to change.  I am trying to find out the keycode of the CURRENTEnter key
to make sure I DON'T depend on the keyboard layout.

Suppose I wanted to make a program designed for a three-button mouse work
on the Mac?  Suppose I wanted to emulate the right-most button (call it the
"blue" button) in my product by calling GetKeys to see if the Enter button
was down at the time the mouse was pushed.  Sure, I could use the known
keycode for Enter from the Mac 512, but this would fail on the Plus, since
there is no keycode 52 available anywhere on the Plus.

Suppose I decided to call this program Mac Smalltalk 0.2, and call my 
company Apple Computer, Inc. :-)

> >   2.   How do you disable dead keys, as for a terminal emulator?
> 
> Dead keys are only produced with the Option key held down, so I assume you
> are talking about using Option as "Control".  There is a flag to set in the
> keyboard driver, but this makes your program dependent on the keyboard driver
> and makes it impossible for users to produce the foreign characters while
> your program is operating.  It's better to use the command key as "Control".

It may be "better" to use command, but this is equivalent to saying 
"we don't want you to do this", while the history of terminal programs
on the Mac and their users is that people want and need to do this.
(I think Option is better than the Columbia solution of physically
removing the spring from the Caps Lock key, but they had no choice.)

This is an example where Apple should define a standard (either the existing 
one, or a new one) in the same way that GetNextEvent or GetKeys is a defined 
standard.  This is such a trivial matter that it shouldn't cause problems for 
Apple to maintain compatibility in the future.

> >   3.   How does a drawing program set 'Tall Adjusted' mode for
> >	the ImageWriter?
> 
> This information can also be gotten from Tech Support.  We discourage people
> from making their programs dependent on a particular driver.

ANY painting/drawing program wants to default the TPrint to square
pixels, although the user can obviously change this.  MacDraw knows
how to do this, so certainly 3rd party programs should.

All the answers so far are in the areas where a developer wants to make
a product powerful and useful (and thus saleable), and so given a choice
of using an unofficial solution or remaining compatible with no solution,
many will use the unofficial solution and deal with the consequences in a
future release.

> >   5.   How does a program find the percentage reduction for
> >	the LaserWriter?
> 
> Why not use the field iVRes and iHRes in the print record (IM II-150), which
> gives you the resolution of the printer for ANY printer?

Because iVRes and iHRes are ALWAYS 72 dpi (except ImageWriter Tall, where
H is 80), even on the Apple LaserWriter.  I believe the LaserWriter drivers
were done this way to provide compatibility for MacWrite, or maybe MacDraw.
 
> >   6.	How do you write a printer driver?
> 
> Well, you've got a point there.  This information is available from Tech
> Support.  This information also falls in the category of things which could
> get you hosed in the future, but obviously we must allow people to write
> drivers.  

I think David has essentially said that if Tech Support believes you have
a legitimate need to know, they'll tell you.  When I asked I guess I
didn't have such a need, but this is somewhat encouraging.

>  We've mentioned publicly (in the Software Supplement, I believe)
> that the ImageWriter source code is available for licensing.

Tech support also said this is expensive, buggy, obsolete and, essentially,
useless.

> There are some things which we guarantee won't change, and others we
> discourage people from doing because we think they will.

Once things are changed, I hope they are changed to the RIGHT way once
and for all, and then documented for all to use, rather than saying
"We'll tell some people but they may get burned later", which is an
unrealistic approach, since if one of those people ends up building
the #1 program for the Mac, Apple will be cutting its own throat.

I hope no one (including David) interprets this as antagonistic to
David or Apple.  I just wanted to clarify the two positions to show
why people want to know this, and why Apple is approaching it the way
it is.  Perhaps some changes will come eventually.
-- 
	Joel West			     MCI Mail: 282-8879
	Western Software Technology, POB 2733, Vista, CA  92083
	{cbosgd, ihnp4, pyramid, sdcsvax, ucla-cs} !gould9!joel
	joel%gould9.uucp@NOSC.ARPA