Skip to content

Arduino Sketch for the Pro Micro To Connect C64/Vic 20 Keyboard as a Standard USB HID Keyboard

Notifications You must be signed in to change notification settings

dabonetn/C64USBKey

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C64 USB Keyboard mod

09/29/19

Added config for a Teensey++2.0 using Soarer's Keyboard Controller Firmware.
This config has non blocking joysticks, so no weird matrix issues.
Pinouts are in the config file.



09/13/19

Added a quick and dirty soarer keyboard config file.



Also found a strange bug. In all the versions, so it's a weird matrix problem.

When I have a standard atari joystick plugged in, all keys work as they should.
But when I have a Wico Boss joystick plugged in, not touching it at all, 
when I press 3, it sends 3&5, when I press 5 it sends 5&7, and 7 sends 7&9.

Has anyone else seen this bug with a different joystick?




08/25/19
Fixed a bug for no single quote available in the arduino version.

All the keycodes I have been using are found in the teensy keylayouts.h file.

03/28/19
EDIT::::Added fix for German umlaut lowercase key in the promicro version. Teensy still needs testing.

This was a bug caused by the wrong KEY_QUOTE value in keydefs.h, should work with no changes for German users now.

02/22/19

Found out that the Teensy only works at 24Mhz, 48Mhz causes weird multiple key presses.

02/20/19	

Teensy LC Support! Hopefully this will be a much more compatible keyboard implementation.
Currently the LC is available for $12 USD + shipping.
The new versions are located in the C64Key3* directories. 
Both versions are the same program, I just commented out the correct lines for each board.
I've changed a lot again, dropping support for the 64 mode keymaps, and the eu keymap. 
I went with a single keymap that follows the Teensy keyboard macro style.
I'm starting the Teensy at pin 1 instead of zero because I have my original pro micro mounted in a 24 pin socket
and didn't want to rewire. (Also makes testing both versions much easier.)


New for 2019.
Optimized some code (Well my friend Worm did. :) Thank you so much )
Added a second joystick fire button on pin 9, and decided to just go foward with the joystick version.
If you don't want to use joystick support, just use the keyboard connections only. Nothing else needed to config.

01/27/19                  Swapped F10 and F12, Restore key is now F10 unshifted and F12 with left shifted.
                          Added new config files for Vice 3. Tested with Version 3.2 See the readme file in
                          the config directory for where to put the files.
                          Vice 2 hasn't been tested in a while. If there are problems, please let me know.
						  
						  
01/29/19                  Added a second hybrid key, using the ctrl key on the commodore keyboard.
                          F1 is F11, F3 is F12, F5 is Page Up, F7 is Page Down, Restore is F9
						  
						  
Based off code by Pyofer 
http://www.lemon64.com/forum/viewtopic.php?t=55650

						  
See inside the INO file for wiring instructions.

Variables to take note of.

int HybridKeyboard=1;                                 // Select 0 for normal or 1 for the left HybridKey allowing all f keys and cursor keys in windows mode. (Also has a shifted restore key)

Hybridkeys are there to let you actually type Cursor up, Cursor left, F2, F4, F6, F8, F9, F11, F12, PGUP, PGDOWN, and ` to the computer in windows mode.
Without this you could only pass the actual key shifted.

int HybridKey=17;                                     // Position of the Hybrid Select key in the keymap, Left Shift = 17, Right Shift = 64
int HybridKey2=72;                                    // Position of the Hybrid2 Select key in the keymap, CTRL = 72

Selects which shift key to activate hybridkeys. You could also make it a completely different key, this value is the position of the key
in the keyset. 

This allows you to have to directly send the hybrid key values that are contained in the Hybridkeys Array.

KEY_LEFT, KEY_F8, KEY_F2, KEY_F4, KEY_F6, KEY_UP, KEY_F12, 

These are mapped to the following keys

Cursor L/R, F7, F1, F3, F5, Cursor U/D, and Restore. 


The default for Hybridkey is the left shift key, so holding left shift and one of the above keys allows the secondary function of the key,

Right shift will give the original key. So say you needed shift F2, then you would hold both shift keys and press the f1 key.
For a shifted f1, you would only hold the right function key.

Hybridkey2 array has the following values.

KEY_PAGE_DOWN, KEY_F11, KEY_TILDE, KEY_PAGE_UP, KEY_F9,

These are mapped to the following keys

F7, F1, F3, F5, Restore

The default for Hybridkey2 is the CTRL key, so holding CTRL and one of the above keys allows the secondary function of the key,




Keys That are diffent than the labels


Commodore        Actual Key    
Key Label          Sent

Back Arrow       KEY_ESC
CTRL             KEY_TAB
RUN/STOP         KEY_LEFT_ALT
CommodoreKey     KEY_LEFT_CTRL
+                KEY_MINUS                      I swapped + and - on the keyboard to maps them like a standard keyboard
-                KEY_EQUAL                      Not reversed like on the actual C64. Shifted - key gives a + like a real pc keyboard
Pound            KEY_INSERT
CLR/HOME         KEY_HOME
INST/DEL         KEY_BACKSPACE
@                KEY_LEFT_BRACE
*                KEY_RIGHT_BRACE
RESTORE          KEY_F10        				Hybridkey is F12, Hybridkey2 is F9
:                KEY_SEMICOLON
;                KEY_QUOTE
UPARROW(Pi)      KEY_DELETE
=                KEY_BACKSLASH



Hybrid Key Assignments

KEY             LeftShift        CTRL
F1                 F2             F11
F3                 F4             ~ (TILDE)
F5                 F6             PAGEUP
F7                 F8             PAGEDOWN
RESTORE            F12            F9
CRSR U/D         CRSR UP
CRSR L/R         CRSR LEFT


!!!!!!!!Need Testers for the EU !!!

About

Arduino Sketch for the Pro Micro To Connect C64/Vic 20 Keyboard as a Standard USB HID Keyboard

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published