Shop OBEX P1 Docs P2 Docs Learn Events
Keyboard Scan Code Fun — Parallax Forums

Keyboard Scan Code Fun

KyeKye Posts: 2,200
edited 2008-12-23 04:07 in Propeller 1
Hey all,

I recently finished my vga engine and now I'm working on writing ps2 mouse and keyboard drivers. I've completed the mouse driver so far and it works perfectly, but now I'm trying to make a ps2 keyboard driver and I'm runninng into a few design problems.

First of all, I don't know which scan code set to use... I know there are three sets, but which one should I count on being implemented and actually useable as some keyboards may not support all three...

I would like to use scan code set 3 because it is the simplest, with a one byte make code and·two byte break codes per key.

However, I'm not sure if every keyboard will support set three. I know every keyboard will support set two, but set two has a few outliers like the print screen and pause break keys in addition to the altered shift and numberlock keys which can make the code very convoluted for nothing.

I not sure about set one however and how easy it would be to use. I know set one is what the computer sees internally after the scan code conversion from the keyboard controller, but I don't know if it will be easier to use.

So, if anyone has a reconmendation for which set to use please help.

Also, the way I want my driver to deliver information is simply in a truth false table that will show the state of every key on the keyboard using a 104 entry buffer. I'm not sure how to arrange the values in a buffer like this though. Should I try to put the characters that overlap with the ASCII character set in the same place or should I make it into a listing of the key groups?

Thank you for your help!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,

Comments

  • VIRANDVIRAND Posts: 656
    edited 2008-12-23 02:07
    Probably the same one that the Parallax keyboard driver uses.
    Set 3 sounds like the one that the ancient IBM PC/XT used,
    since I recall it as not having the extra nonsense with long
    codes for some of the keys. I have no idea why there are
    3 different sets, all of which are neither obviously
    standard or logical, except for the evil conspiracy
    known as planned obsolescence. Any other explanation?

    I have, and also find it easiest to make from scratch,
    a keyboard that outputs either ASCII or Row/Column code,
    but no one is selling those since the 1980's.
  • KyeKye Posts: 2,200
    edited 2008-12-23 02:56
    mmm, well, I really want to use scan code set three. Anyone else ever had problems using set three? Or must I use set 2...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • kwinnkwinn Posts: 8,697
    edited 2008-12-23 04:07
    I would really suggest finding out what code is used on PC's and use that as it is the least likely to become obsolete in the near future. No fun writing software and not being able to find the required hardware.
Sign In or Register to comment.