How to read raw keyboard codes?

Get help from the community & developers with the X16 hardware if you can't find the solution elsewhere
Post Reply
iljitsch
Posts: 25
Joined: Thu May 27, 2021 4:38 pm

How to read raw keyboard codes?

Post by iljitsch »


Ever since I got a mechanical keyboard with hot swappable switches I find it very useful to have an app that will show me which key(s) I'm pressing. So I've made several (!) keyboard test programs. I also want to make one for the X16. But... how do I read the raw keycodes produced by the keyboard?

AFAIK on the C64 the KERNAL API only gives you the character a keypress produces, and obviously the C64 tricks for lower level access don't work on the X16 because it uses a completely different keyboard interface.

Elektron72
Posts: 137
Joined: Tue Jun 30, 2020 3:47 pm

How to read raw keyboard codes?

Post by Elektron72 »


There's a section in the Programmer's Reference Guide about custom scan code handlers: https://github.com/commanderx16/x16-docs/blob/master/Commander X16 Programmer's Reference Guide.md#custom-keyboard-scan-code-handler

However, I believe this only works using the latest version of the ROM built from source (what will eventually become r39).

iljitsch
Posts: 25
Joined: Thu May 27, 2021 4:38 pm

How to read raw keyboard codes?

Post by iljitsch »


Thanks!

User avatar
svenvandevelde
Posts: 488
Joined: Wed Dec 23, 2020 6:30 am
Location: Belgium, Antwerpen

How to read raw keyboard codes?

Post by svenvandevelde »



On 5/28/2021 at 4:53 PM, Elektron72 said:




There's a section in the Programmer's Reference Guide about custom scan code handlers: https://github.com/commanderx16/x16-docs/blob/master/Commander X16 Programmer's Reference Guide.md#custom-keyboard-scan-code-handler



However, I believe this only works using the latest version of the ROM built from source (what will eventually become r39).



Thank you. Was also looking into this.

KICKC home page by Jesper Gravgaard.
My KICKC alpha with Commander X16 extensions.
Post Reply