[comp.sys.atari.st] TOS quirk with ALT key

dbrooks@penge.osf.org (David Brooks) (01/02/91)

I was trying to do something with 8-bit keyboard input, and use the
ALT key to signal "hi-bit on" I'm reading with Bconin.  The general
idea was to see if the translated character is zero; if so, and
kbshift indicates ALT, I would re-translate the scancode using the
standard keyboard mapping tables and plug in the top bit.

Mostly, this works fine.  But the keys in the top row, between "1" and
"=", get 0x76 arbitrarily added to their scancodes before being
returned to me.

Of course, once I knew this I could compensate for it.  But does
anyone know the rationale for dickering with something as basic as the
scancode?  It's the 11/86 ROM, if it matters.
-- 
David Brooks				dbrooks@osf.org
Systems Engineering, OSF		uunet!osf.org!dbrooks
In Memoriam: Chris Naughton, aged 16, killed by a drunk driver Dec 22, 1990

apratt@atari.UUCP (Allan Pratt) (01/03/91)

dbrooks@penge.osf.org (David Brooks) writes:
>...the keys in the top row, between "1" and
>"=", get 0x76 arbitrarily added to their scancodes before being
>returned to me.

That's not arbitrary; it's part of the VDI spec, which is really just a
codification of the behavior of the IBM PC keyboard/scancode
characteristics.  I don't know WHY it is, but the keys from 1 to = are
defined to return scan codes 0x78 to 0x83, and that's just the way it
is.

============================================
Opinions expressed above do not necessarily	-- Allan Pratt, Atari Corp.
reflect those of Atari Corp. or anyone else.	  ...ames!atari!apratt

dbrooks@osf.org (David Brooks) (01/04/91)

In article <2792@atari.UUCP>, apratt@atari.UUCP (Allan Pratt) writes:
|> dbrooks@penge.osf.org (David Brooks) writes:
|> >...the keys in the top row, between "1" and
|> >"=", get 0x76 arbitrarily added to their scancodes before being
|> >returned to me.
|> 
|> That's not arbitrary; it's part of the VDI spec, which is really just a
|> codification of the behavior of the IBM PC keyboard/scancode
|> characteristics.  I don't know WHY it is, but the keys from 1 to = are
|> defined to return scan codes 0x78 to 0x83, and that's just the way it
|> is.

Thanks for the explanation, Allan.  A clarification: in the part you
edited out I explained that this only happens when ALT is depressed.
Otherwise, the scancodes 0x02 to 0x12 are returned.  Is *this* also
true of the IBM keyboard?
-- 
David Brooks				dbrooks@osf.org
Systems Engineering, OSF		uunet!osf.org!dbrooks