[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] Remapping keyboard



Hi!

Almost two years ago Michael Schwingen wrote:

----8<----

>From mint-request -at- terminator rs itd umich edu Sun Jun 21 17:47:14 1998
Message-ID: <19980620230830 23102 -at- tubul dascon de>
Date: Sat, 20 Jun 1998 23:08:30 +0200
From: Michael Schwingen <rincewind -at- tubul dascon de>
To: Petr Stehlik <stehlik -at- cas3 zlin vutbr cz>
Cc: Konrad Kokoszkiewicz <draco -at- mi com pl>, joska -at- nuts edu,
        mint -at- atari archive umich edu
Subject: Re: Loadable keyboards
References: <199806191822 TAA08987 -at- cas3 zlin vutbr cz>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Mailer: Mutt 0.84
In-Reply-To: <199806191822 TAA08987 -at- cas3 zlin vutbr cz>; from Petr Stehlik on Fri, Jun 19, 1998 at 07:22:20PM +0100

On Fri, Jun 19, 1998 at 07:22:20PM +0100, Petr Stehlik wrote:
> No, the Alt combinations are handled by TOS and are hardcoded, AFAIK.
> You would have to write a completely new keyboard driver.

Only up to TOS 2.06.

"New code as of 5/92: in the all-countries cases (TT, SPARROW) we use
 the new variables salttran/saltshif/saltcl as associative lookup tables
 instead of doing the alt-key translation job in code."

Keytbl (XBIOS 16) returns the pointer to the KEYTAB struct. In newer TOS
versions, these consist of:
 - unshift table
 - shift table
 - CTRL table
 - unshifted ALT table
 - shifted ALT-Table
 - capslock ALT-table

The new tables consist of scancode, ASCII code pairs, terminated by a zero
scancode.

I am not sure if this was documented by Atari (I don't have a compendium
here), and if you should use this feature to load new keytables - but I do
not see much danger in using it as long as you are sure that the TOS version
you are on does have these tables. It definitely is much easier than writing
a whole new keyboard driver.

cu
Michael
-- 
Michael Schwingen, Ahornstrasse 36, 52074 Aachen

----8<----

I took a closer look at this today, as I need to add remap and add some
ALT-keys. I wrote a small program to examine the current tables (or to
be more precise, give me the addresses to them so I can check them with
TT-Digger):

#include <osbind.h>
#include <stdio.h>

#define KT_NOCHANGE (char *)-1

typedef struct
{
   char *unshift;
   char *shift;
   char *caps;
   char *alt_unshift;
   char *alt_shift;
   char *alt_caps;
} KEYTBL;

int main(void)
{
   KEYTBL *keytbl;

   keytbl = (KEYTBL *)Keytbl(KT_NOCHANGE, KT_NOCHANGE, KT_NOCHANGE);

   printf("%08lX\n", keytbl->unshift);
   printf("%08lX\n", keytbl->shift);
   printf("%08lX\n", keytbl->caps);
   printf("%08lX\n", keytbl->alt_unshift);
   printf("%08lX\n", keytbl->alt_shift);
   printf("%08lX\n", keytbl->alt_caps);
}

Running this gives me the following pointer:

011B6FF8
011B7078
011B70F8
00E03639
00E03640
00E03647

The first three looks OK, but the last three are way off. Just look at the
size of the unshift-table... I guess that either my TOS (4.04) doesn't
support this or I've done something wrong (most likely). Has anybody used
this functionality? Michael? Petr?


/*
** Jo Even Skarstein    http://www.stud.ntnu.no/~josk/
**
**    beer - maria mckee - atari falcon - babylon 5
*/