How many keys the IKBD can handle?

GFA, ASM, STOS, ...

Moderators: exxos, simonsunnyboy, Mug UK, Zorro 2, Moderator Team

mikro
Atari God
Atari God
Posts: 1263
Joined: Sat Sep 10, 2005 11:11 am
Location: Brisbane, Queensland, Australia
Contact:

How many keys the IKBD can handle?

Postby mikro » Sun Nov 13, 2016 12:58 pm

Hi there,

I'm helping Jookie with some CosmosEx features and one of those is joystick emulation by (atari or pc) keyboard. The basic scenario in Lotus -one player accelerating and steering- works fine. However, as soon as next player maps another set of keys on his own, I can clearly see the limit - if two players accelerate, none of them can turn left.

Is this an Atari limit or a bug in the CE? I plan to do some tests yet but to me it seems like we're simply not getting from Atari more scan codes than two (i.e. "key down" event)

joska
Hardware Guru
Hardware Guru
Posts: 3574
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: How many keys the IKBD can handle?

Postby joska » Sun Nov 13, 2016 3:11 pm

There is no such limit in IKBD keyboards.
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

seedy1812
Atari User
Atari User
Posts: 33
Joined: Tue May 18, 2010 2:04 pm

Re: How many keys the IKBD can handle?

Postby seedy1812 » Mon Nov 14, 2016 4:40 pm

Some interesting reading here http://www.microchip.com/forums/m368006.aspx and http://www.usb.org/developers/hidpage/HID1_11.pdf

In the keyboard HID information is -- Input (Data, Array), ;Key arrays (6 bytes) --

mikro
Atari God
Atari God
Posts: 1263
Joined: Sat Sep 10, 2005 11:11 am
Location: Brisbane, Queensland, Australia
Contact:

Re: How many keys the IKBD can handle?

Postby mikro » Mon Nov 14, 2016 10:21 pm

Thanks for the information. However:

1. I'm using Atari keyboard
2. The buffer seems to be full after two key strokes

So I'm keen to believe it's a bug in the CE. ;)

User avatar
dml
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3468
Joined: Sat Jun 30, 2012 9:33 am

Re: How many keys the IKBD can handle?

Postby dml » Tue Nov 15, 2016 10:07 am

mikro wrote:Thanks for the information. However:

1. I'm using Atari keyboard
2. The buffer seems to be full after two key strokes

So I'm keen to believe it's a bug in the CE. ;)


I saw evidence of keypress limits on a Falcon while working on a game (At least, on my Falcon!). This effect did not occur under emulation. The limit was 2 keystrokes, in the worst case. It depended on the key pattern in question and the outcome depended on the hold/release order. It was consistent and could be predicted using a diagram of the keyboard matrix.

I wrote about this on AF somewhere a couple of years ago.

caveats:

- didn't check other machines
- the mainboard had been repaired at some point earlier
- never heard anyone else complaining about something like this until now (!)

mikro
Atari God
Atari God
Posts: 1263
Joined: Sat Sep 10, 2005 11:11 am
Location: Brisbane, Queensland, Australia
Contact:

Re: How many keys the IKBD can handle?

Postby mikro » Tue Nov 15, 2016 12:09 pm

Doug, your findings while developing Bad Mood are the exact reason why I asked here, I vaguely remembered something like that but as you say, it seems everybody else is happy. :) Although I still need to check whether we haven't screwed up something in the CE. :)

Out of curiosity, what was the pattern? Mine is "W" + "up arrow" -- with this combo I can't detect any other keys, like "D" or "left arrow".

User avatar
dml
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3468
Joined: Sat Jun 30, 2012 9:33 am

Re: How many keys the IKBD can handle?

Postby dml » Tue Nov 15, 2016 12:29 pm

mikro wrote:Out of curiosity, what was the pattern? Mine is "W" + "up arrow" -- with this combo I can't detect any other keys, like "D" or "left arrow".


I don't quite remember the details now - but I noticed it while attempting to map WSAD + arrows + one of the control keys. I got several conflicts from this arrangement.

Something like this:

KEY1(down) + KEY2(down) + KEY3(down) -> KEY3 keypress is lost
KEY1(down) + KEY2(down) + KEY3(down) + KEY2(up) -> KEY2 produces unknown release scancode, one key gets 'stuck'

The bogus scancodes resulting could sometimes look like F1 or F2 function key presses, which added to the 'fun'.

joska
Hardware Guru
Hardware Guru
Posts: 3574
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: How many keys the IKBD can handle?

Postby joska » Tue Nov 15, 2016 4:18 pm

dml wrote:It was consistent and could be predicted using a diagram of the keyboard matrix.


This is a "feature" of almost all keyboards. The IKBD controller and protocol has no limits on the number of concurrent keypresses (unlike USB keyboards), but because of the keyboard matrix you can experience "blocked" keys (certain combinations of keys blocks other keys) and "ghost" keypresses. Ask any PC gamer :)
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

mikro
Atari God
Atari God
Posts: 1263
Joined: Sat Sep 10, 2005 11:11 am
Location: Brisbane, Queensland, Australia
Contact:

Re: How many keys the IKBD can handle?

Postby mikro » Tue Nov 15, 2016 10:52 pm

joska wrote:This is a "feature" of almost all keyboards. The IKBD controller and protocol has no limits on the number of concurrent keypresses (unlike USB keyboards), but because of the keyboard matrix you can experience "blocked" keys (certain combinations of keys blocks other keys) and "ghost" keypresses. Ask any PC gamer :)

So there's a limit then. Because if I can't press more then two keys in certain combinations, then it's a limit. What is not very good news, dammit. I guess we can say goodbye to multiplayer games controlled by keyboard, I guess the CosmosEx shouldn't offer it either.

On the other hand, you mention PC keyboards. How it is possible that on PC it's totally OK to play with AWSD + arrows on the same keyboard? In that way our keyboards are much more limited.

LuigiThirty
Atariator
Atariator
Posts: 28
Joined: Sat Sep 03, 2016 12:20 am

Re: How many keys the IKBD can handle?

Postby LuigiThirty » Wed Nov 16, 2016 4:00 am

It depends on the keyboard's internal design. Here's an article from Microsoft detailing why keyboards have this problem. If you press multiple keys that share a column AND a row (only possible with three or more keys at once), you can't know with certainty which keys were pressed. You can certainly make a keyboard that can register every possible key combination but it would be very expensive and complex.

joska
Hardware Guru
Hardware Guru
Posts: 3574
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: How many keys the IKBD can handle?

Postby joska » Wed Nov 16, 2016 11:41 am

mikro wrote:So there's a limit then. Because if I can't press more then two keys in certain combinations, then it's a limit.


No, there is no such limit. What you describe is a limitation that exists in all (except for some expensive gamer keyboards) keyboards. E.g. on my laptop's internal keyboard pressing "N" will block arrow left, while this works just fine on the external keyboard. It depends on how the matrix is implemented, and how the keyboard controller (attempts to) deal with ghosting. Pick another key combination and you can easily press 10 keys simultaneously.

There's a good description of these problems here: https://deskthority.net/wiki/Rollover,_blocking_and_ghosting

Remember that keyboards are designed for typing, not gaming. Personally I have never experienced this problem on the ST, most likely because I belong to a generation that knows how to operate one of these :)

Image
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

mikro
Atari God
Atari God
Posts: 1263
Joined: Sat Sep 10, 2005 11:11 am
Location: Brisbane, Queensland, Australia
Contact:

Re: How many keys the IKBD can handle?

Postby mikro » Fri Nov 25, 2016 10:01 am

joska wrote:because of the keyboard matrix you can experience "blocked" keys (certain combinations of keys blocks other keys)

Well, I have done a few tests, on the original IKBD keyboard, just to be sure my CosmosEx doesn't interfere. I think it's safe to say that whatever the reason is more than two normal keys are not possible.

You can have CONTROL+ALT+both SHIFTs+two arbitrary keys but that's it. Any combination like Q, HELP and keypad + is not possible even if they are physically very distant. I tried 6-7 different combinations (keys close to each other, far away each other, alphabet vs F keys vs keypad, ...), nothing works with more than two keys.

I've briefly tested it on Falcon, can't say I see any significant difference. Sometimes I had a feeling that a key has spontaneously released in favour of another but it was very random.

User avatar
calimero
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2032
Joined: Thu Sep 15, 2005 10:01 am
Location: STara Pazova, Serbia
Contact:

Re: How many keys the IKBD can handle?

Postby calimero » Fri Nov 25, 2016 12:55 pm

Amateur question:
How do you read two keys? Are there some special codes for combinations of keys? From what memory location do you read keypress?
using Atari since 1986.http://wet.atari.orghttp://milan.kovac.cc/atari/software/ ・ Atari Falcon030/CT63/SV ・ Atari STe ・ Atari Mega4/MegaFile30/SM124 ・ Amiga 1200/PPC ・ Amiga 500 ・ C64 ・ ZX Spectrum ・ RPi ・ MagiC! ・ MiNT 1.18 ・ OS X

joska
Hardware Guru
Hardware Guru
Posts: 3574
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: How many keys the IKBD can handle?

Postby joska » Fri Nov 25, 2016 1:11 pm

mikro wrote:I think it's safe to say that whatever the reason is more than two normal keys are not possible.


You are correct. It is not a limitation of the IKBD protocol, but most likely the keyboard controller's way of dealing with ghost keys. I could not find this documented anywhere, but to test this I hooked my Mega ST keyboard up to a Teensy and monitored the scancodes. When two non-modifier keys are pressed, no more keypressed are registered.

mikro wrote:Sometimes I had a feeling that a key has spontaneously released in favour of another but it was very random.


Atleast my Mega keyboard does not release previous keys but stops reporting non-modifier keypresses when two non-modifier keys are already pressed.

I've been using IKBD keyboards for almost thirty years now, and even made IKBD<->USB converters without noticing this limitation :)
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

mikro
Atari God
Atari God
Posts: 1263
Joined: Sat Sep 10, 2005 11:11 am
Location: Brisbane, Queensland, Australia
Contact:

Re: How many keys the IKBD can handle?

Postby mikro » Fri Nov 25, 2016 1:53 pm

Thanks for the confirmation, Jo.


Social Media

     

Return to “Coding”

Who is online

Users browsing this forum: No registered users and 2 guests