Update on keyboard input overhaul

append delete gardners

Just a quick note to say that the keyboard input overhaul is mostly done. To support USB keyboard as well as a real keyboard (for both Nexys4 and MEGA65 PCB), I have had to virtualise the keyboard, implementing a hardware keyboard matrix scanner that presents the scanned matrix and synthesised matrix from any USB keyboard to the CIAs.

Also, to allow Matrix Mode text input from a real keyboard on the a MEGA65 PCB, I needed to add a hardware ASCII character stream from this.

I'll do a blog post on it when the last touches are finished, but it means that full keyboard scanning is trivial, as you can just read the key stream (complete with roll-over support) from the appropriate register.

Reply RSS


append delete #1. LGB

Nice! :) Just to be clear for me too :) does it mean that the USB and the "real" (kbd matrix based) keyboard can be (or will be able to) used equally in every aspects (like: the 65xx code, the "overlay-matrix-monitor" etc etc maybe other examples as well)? Also it rises a question in me: if the keyboard handling had to be virtualised anyway at the VHDL level, is there any way to write a program for Mega65 which does not do kbd matrix scanning at all (in the standard way, through CIA ports) but relies on the fact that there is a "scanner" at VHDL level anyway (which may expose the events and/or the actually pressed keys/etc for the "user space"), regardless the user is about typing on an USB keyboard or on a "real" one? This is more about a hardware level question (I'm interested because of Xemu development but also because of M65 software development), since the kbd scan routine by hypervisor call is another planned (?) feature, but I don't mean that now.

append delete #2. PGSmobile

Yes, both keyboards appear the same to the programmer: driving the CIA matrix and also producing an ASCII character stream. It is then as easy as reading a single register to see the last key pressed. Write to the same reg to clear that char ready for the next. Easy enough to do in basic with peek and poke.


(Leave this as-is, it’s a trap!)

There is no need to “register”, just enter the same name + password of your choice every time.

Pro tip: Use markup to add links, quotes and more.

Your friendly neighbourhood moderators: Deft, gardners, Ralph Egas