[comp.sys.mac] International Macs + new user interface = ?

oster@dewey.soe.berkeley.edu (David Phillip Oster) (01/02/88)

Two questions about writing compatible macintosh software:

How do international issues effect <Cmd>-?
How do international issues effect the function keys on the large 
	keyboard?

1.) How do international issues effect <Cmd>-?.
<Cmd>-? is an evolving standard for help in the Macintosh environment,
yet, if the user actually holds down the <Cmd> key and hits the question
mark key, the system software shows my application a <Cmd>-/ keyDown
event.  I am capable of writing <Cmd>-/ as a synonym for <Cmd>-?, but 
what about non-American keyboards? Surely the '?' is not above the '/'
on every keyboard Apple will ever sell, anywhere in the world?
How do I do the right thing for all the foreign language keyboards that
Apple might introduce. (I want my software to work, well into the future.)

2.) How do international issues effect the function keys on the large 
	Apple Desktop Bus keyboard?
With the default 'KMAP' resource, the large Apple Desktop Bus returns the
same ASCII codes for <Clear> and <Escape>.  All the new special function keys 
(keys F1-F15, (these are not the <Cmd>-<Shift>-<numeral> keys)) return
the same ASCII code.  The user can use the <Control> key and the ordinary 
letters to generate any ASCII code.  How does Apple expect programmers to
work with this?  I can look at the keyNumber, and so tell one key from
another, but in the past Apple has specificly asked developers not to depend
on the key numbers, because the key numbers change from model to model, and
because different national keyboards (the French and English keyboards, for
example) generate different key numbers for keys in the same position.

Am I expected to install a custom 'KMAP' in my applications to map the low
function keys to Apple's suggested undo, cut, copy, paste, and clear?
If so, am I expected to swap it out in reponse to a SUSPEND event and swap
it back in response to a RESUME event?


--- David Phillip Oster            --A Sun 3/60 makes a poor Macintosh II.
Arpa: oster@dewey.soe.berkeley.edu --A Macintosh II makes a poor Sun 3/60.
Uucp: {uwvax,decvax,ihnp4}!ucbvax!oster%dewey.soe.berkeley.edu

tecot@apple.UUCP (Ed Tecot) (01/05/88)

In article <22366@ucbvax.BERKELEY.EDU> oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster) writes:
>Two questions about writing compatible macintosh software:
>
>How do international issues effect <Cmd>-?
>How do international issues effect the function keys on the large 
>	keyboard?
>
>1.) How do international issues effect <Cmd>-?.
><Cmd>-? is an evolving standard for help in the Macintosh environment,
>yet, if the user actually holds down the <Cmd> key and hits the question
>mark key, the system software shows my application a <Cmd>-/ keyDown
>event.  I am capable of writing <Cmd>-/ as a synonym for <Cmd>-?, but 
>what about non-American keyboards? Surely the '?' is not above the '/'
>on every keyboard Apple will ever sell, anywhere in the world?
>How do I do the right thing for all the foreign language keyboards that
>Apple might introduce. (I want my software to work, well into the future.)

You are correct in stating that the '?' is not above the '/' in every keyboard
that Apple might sell, especially when Europe is considered.  This is a
significant problem, and you might argue that command-? should always return
command-?, even when the keys are shifted.  I did.  However, several
applications (e.g. FullPaint) expect to get command-shift-/ and broke when
they were given command-? instead.  So... the correct solution is to accept
BOTH command-? and command-shift-/ to operate any command-? feature.

>2.) How do international issues effect the function keys on the large 
>	Apple Desktop Bus keyboard?
>...

Whenever decoding a keystroke on the Macintosh, always use the character
code first, and only if you need more information, go to the key code.
So, if you see a character code of $1B, and you need to know if it is clear
or escape, then and only then should you examine the key code.  The same
goes for the function keys.  Under no circumstances should you ever modify
the KMAP, as this is intended for the use of the keyboard manufacturer only.

						_emt