Author Topic: Mapping Commodore 64 keys into the 21st century?  (Read 9318 times)

0 Members and 1 Guest are viewing this topic.

Offline hemflit

  • Thread Starter
  • Posts: 84
Mapping Commodore 64 keys into the 21st century?
« on: Mon, 14 February 2011, 16:38:59 »
So don't laugh, I'm of a mind to get a Commodore 64 keyboard and turn it into a USB one. And I'm wondering about how I should treat some keys, and I'd love to hear some suggestions.

This is the layout. After that come some jumbled thoughts I've had so far. I know they're leaning towards tl;dr material, so feel free to give suggestions without reading the rest of this post.



One thing I could do in theory is try to match every key's original function to something as close to it as possible, but this would not be practical.

There's a text key to the left of 1. I could make this act as Escape instead of tilde/backtick.

There are three text keys to the right of 7890, three to the right of UIOP, and three to the right of HJKL. I could make two of each threesome work like the keys in that position on modern keyboards. I'd swap at least the + and - keycaps, maybe some others. (I could in theory try to match the ;[;] keys to what they're marked as, but I'm leaning away from it - sounds like unnecessary hassle.)

That leaves three unused text keys on the right side. One would become the backslash, and another maybe the 102nd key, no idea what to do with the third.

I absolutely need a Tab key, and I'm not sure if I should make Stop do it, or make Control into Tab and Stop into Control.

The Delete key actually deleted to the left on the original, and it's in the right position for a Backspace, so I think that's what it should do. The Home key right next to it could reasonably stay Home, I'm just not sure how to do End (maybe put it on one of the unused text keys). An alternative is to have the two keys in the corner be "delete left" (ie. Backspace) and "delete right" (ie. Delete).

The two cursor keys on the C64 work as down and right, and with Shift they become up and left. This isn't nearly as clumsy as it sounds, but the problem is that shift+arrows already has a different meaning in today's software, so I'm thinking of a cheat: I could make the right Shift just be Shift, except when it's used with cursor keys, where I'm going to send the signal that "shift is no longer pressed, but an up or left arrow is". And when I actually want to use Shift together with arrows, the left Shift could do it.

This is making me think I could just generally make the right Shift (or some other key) into a "Fn" key of sorts, combining with non-text keys: Fn+Home = End and so on. That would also make it easier to squeeze PgUp and PgDn in there somewhere.

The F1-F8 could be used as labelled, but I could also make them something else (Home, End, PgUp…) and just press Fn+1 for F1 and the like.

The Commodore key could be Alt. I'm not sure I need a GUI key at all unless I decide to use this keyboard with a Mac. It would be esthetically pleasing to have Commodore as the Fn key, but I'm afraid it's physically far from other keys I'd combine it most with, so it would be impractical. It also wouldn't be bad to have some key for Alt Graphic.

This leaves two keys unaccounted for:

Restore is wired completely separately from the rest of the keyboard, so it has super Ghostbusters powers. But it's in an awkward spot to be used as a modifier. I dunno. Maybe make that the general Fn key, just keep the Fn functionality of the right shift for cursor keys.

Shift Lock is hard-wired parallel to the left Shift, but I think it's easy enough to separate. It's probably not easy at all (for me) to make it into a non-locking key. So what good is a physically locking key? Caps Lock, for the lulz? (I know there's a separate USB HID code for a physically locking Caps Lock.)

Offline hemflit

  • Thread Starter
  • Posts: 84
Mapping Commodore 64 keys into the 21st century?
« Reply #1 on: Tue, 15 February 2011, 04:47:13 »
Oh, thanks, that serious I am already, but right now I'm aiming my sniper at an eBay auction. If that falls through later today, I'm coming to you.

[strike]You'd be sending it from the US, right? Do you have just the bare keyboard, or a dead C64, or (shudder) a live one?[/strike] Scratch that, I've won the one on eBay. But thanks for the offer.
« Last Edit: Tue, 15 February 2011, 12:31:56 by hemflit »

Offline elef

  • Posts: 146
Mapping Commodore 64 keys into the 21st century?
« Reply #2 on: Tue, 15 February 2011, 05:14:04 »
Buying one should be the least of your problems, I'm sure you can get one under $10.

Best of luck - I think the main problem is not the layout, which you'll have ample time to figure out, but the technical details. What sort of a connector does it use, what protocol it communicates with... If those things are compatible(ish) with modern computer hardware, you can always rig up whatever layout you want with autohotkey.
But it might be very tricky to get it to communicate with a modern computer. I wouldn't be surprised if you needed to install a new controller in it.
That said, I'm sure someone out there has already done it before you, so google around.

Offline elef

  • Posts: 146
Mapping Commodore 64 keys into the 21st century?
« Reply #3 on: Tue, 15 February 2011, 05:17:10 »
Buying one should be the least of your problems, I'm sure you can get one under $10.

Best of luck - I think the main problem is not the layout, which you'll have ample time to figure out, but the technical details. What sort of a connector does it use, what protocol it communicates with... If those things are compatible(ish) with modern computer hardware, you can always rig up whatever layout you want with autohotkey.
But it might be very tricky to get it to communicate with a modern computer. I wouldn't be surprised if you needed to install a new controller in it.
That said, I'm sure someone out there has already done it before you, so google around.

Offline hemflit

  • Thread Starter
  • Posts: 84
Mapping Commodore 64 keys into the 21st century?
« Reply #4 on: Tue, 15 February 2011, 05:59:35 »
Thanks Elef, I got that figured out.

The original keyboard is integrated into the computer chassis - the thing you see on the pics above is the whole machine. The keyboard doesn't have a separate controller in the IBM sense, the rows and columns are connected directly to the motherboard and the role of "keyboard controller" is shared between the main CPU and a simple I/O interface chip (the same one that reads joysticks and stuff). The whole firm concept of a "protocol" only makes real sense when we treat the keyboard as a fully separate device.

So you're right, I'll need to stick in a controller. I'm just going to wire those same rows and columns to a Teensy.

Offline mr_a500

  • Posts: 401
Mapping Commodore 64 keys into the 21st century?
« Reply #5 on: Tue, 15 February 2011, 09:31:30 »
Have you seen this?


Offline Findecanor

  • Posts: 5081
  • Location: Koriko
Mapping Commodore 64 keys into the 21st century?
« Reply #6 on: Tue, 15 February 2011, 09:51:46 »
C64 keyboard with Atmel AVR controller (same as Teensy) has been done before: c64key.
🍉

Offline hemflit

  • Thread Starter
  • Posts: 84
Mapping Commodore 64 keys into the 21st century?
« Reply #7 on: Tue, 15 February 2011, 12:53:31 »
Oh wow, hey, someone's made that into a product? I may even have heard of some of this stuff and then forgotten. Thanks guys!


With all the respect that Symlink guy's deserved, that's not something I'd do on my own. I've looked superficially into low-level USB programming before and it's such a ***** to do, OMG the intents and pages and reports and interrupts and just shoot me now. I'm not even all that clueful about microcontrollers to begin with, that would just turn into one of those eternal projects that never get anywhere but I don't have the heart to trash.

I got a Teensy to play with a couple of months back, and now I don't see myself doing anything USB with any other board (much less making my own MC board) - it simply has all the hard work pre-done and lets me just lazily fill in the blanks.


Keyrah is... hmmm. Wow, tempting I guess. It would totally get me everything I think I want, hassle-free. But to convince myself away from it, I'm saying (a) where's the fun in that, (b) it costs three times as much, (c) the key mapping is not customizable, gosh darn it. I mean, I'm not even saying there's anything wrong with the mapping they've come up with, but I don't want to be stuck with it.

(Ha, looking further I see people have made entire PCs inside C64 cases with Keyrah. Predictable but very cool.)

And if anyone else's looking into this, Keyrah discussions on lemon64 are all peppered with references to this other thing that's supposed to be a PS/2 interface, and customizable (well, open source) but for similar reasons I think it's not for me.

Offline mr_a500

  • Posts: 401
Mapping Commodore 64 keys into the 21st century?
« Reply #8 on: Wed, 16 February 2011, 14:16:10 »
Speaking of PC inside C64 case, have you seen this?



It currently looks like BS vapourware, but maybe it'll eventually get made. I doubt it'll have the same quality plastic as the original C64. (which wasn't exactly quality plastic, but nicer than modern Chinese cheapo-plastics)

Offline hemflit

  • Thread Starter
  • Posts: 84
Mapping Commodore 64 keys into the 21st century?
« Reply #9 on: Fri, 18 February 2011, 13:05:12 »
Aye, seen that :). Looks cool, and no technological reason for it to stay vapourware really - apart from the economy of scale of new keycaps and the case, anyone could make one of those at home with off-the-shelf parts and one screwdriver. The only question is how expensive they can sell it and to how many :)