A guide to setting up VICE controls with an IPAC or other keyboard encoder
tuki_cat last edited by
I have written this short guide for @ZX81 and hopefully it helps others with an IPAC, or other keyboard encoder. It is made up of information I have found and my own messing around with the system.
This guide applies to the standalone version of VICE, and not lr-VICE. lr-VICE uses the standard retroarch.cfg files to set up controls but there is a current issue with the "up" key being mapped to RUN/STOP on the C64 keyboard.
The guide assumes that you already have VICE installed, if you need to know how to install VICE, add roms, etc. then please refer to the docs on the retropie page which tells you how to install emulators.
This guide also assumes that you IPAC or keyboard encoder is setup with the standard MAME key bindings, these can be found here: - https://www.ultimarc.com/ipac2.html
Things you will need
- A USB or wireless keyboard - you only need this connected for the setup of the keys.
- winSCP.exe - this is so you can alter the key you use to open the VICE GUI.
Setting up the VICE gui keys
For some reason these keys were the only ones that I could not map using the method below and so in order to map these commands a little more work is needed. I used winSCP to obtain access to the files on the Retropie, if you need to know how to set this up there is a guide in the docs section of the Retropie website, under getting Started/Transferring roms.
- Once you have started winSCP, or whichever method you use to access the Retropie, navigate to opt/retropie/configs/c64
- Open the file named sdl-vicerc
- The second line of text says "MenuKey=293" 293 is the SDL key code for "F12". In order to set up the key for opening the gui just replace 293 with the appropriate SDL Key code that is mapped to your IPAC/encoder. Here is a list of SDL keycodes - I think these are all correct - https://pastebin.com/PdCpi6cD.
As example I wanted to map mine to key "1" (which is is 1 player start on my IPAC) so I used keycode 49.
- One of the key bindings that is not in this file is "MenuKeySelect", this is mapped to "enter" on the keyboard. If you want to re-map this another button then add
the following to the sdl-vicerc file "MenuKeySelect=" remember to include the appropriate SDL key code after the = symbol. As example I wanted to map mine to lctrl (which is player 1 button 1 on my IPAC) so I used keycode 306.
- Save and close this file, and the commands should now work.
- You can also add a menu cancel key by adding "MenuKeyCancel=" to this file along with the appropriate SDL keycode.
Setting up the keyboard joysticks
- Connect the USB/wireless keyboard to your Retropie.
- Run a game so the emulator starts, this can be any game. Once the game starts press the button you have mapped to bring up the VICE gui or press F12 on the USB/wireless keyboard. You should be able to use your joystick (if it is set up to connect to the arrow keys on your IPAC/encoder) to navigate the menus.
- Go to "Machine Settings" and then "Joystick Settings".
- Then go to "Define Keysets", this screen will show you the keyboard mappings for two joysticks. Navigate to the "up" mapping. Press the menu key you have mapped or "enter" on the USB keyboard and then press "up" on the joystick. Repeat this step for all the other mappings, and for both joysticks if you have a two players connected.
- Now go to "Joystick Settings" and "Joystick Device 1" and set this as "Keyset 1", you can also set "Joystick Device 2" as ""Keyset 2" if you have two players.
- Next go to "Machine Settings" and "Joyport Settings". Choose "Control Port 1" and select "Joystick, do the same for "Control Port 2".
- Now exit the gui and the joystick should now work.
- However, C64 games are sometimes played from Joystick port 1 or 2, this may mean the joystick will not work. The way to remedy this is to re-enter the gui, navigate to "Machine Settings" and then "Joystick Settings". There will be an option to "Swap Joystick Ports" press enter and then exit out of the gui. The joystick should now work. You can also map the "Swap Joystick Ports" to a hotkey (see below).
- Now these keys have been set they need to saved so that VICE will use these mappings next time it is started. To do enter the gui and choose "Settings Management", then choose "Save Current Settings" and then exit out of the gui.
Setting up hotkeys
There are a number of hotkeys that can be set up in VICE, this will mean you will not need to enter the gui - examples of this are bringing up the virtual keyboard or swapping the joystick ports.
As an example we can map the key to bring up the virtual keyboard to a button on the IPAC/encoder. To do this: -
- Enter the gui and navigate down to "Virtual Keyboard", but do not select it.
- Once the "Virtual Keyboard" is highlighted press "m" on the USB/wireless keyboard.
- VICE will then ask you to press a key to map to this action, this key will then be used to bring up the virtual keyboard while using the emulator.
- Like the keyboard joystick mappings, these settings need to be saved. This can be done by entering the gui and choosing "Settings Management" , then choose "Save Hotkeys" and then exit out of the gui.
You can map practically any of the actions in the VICE gui to a key by using this method.
Mapping C64 keyboard keys to your IPAC buttons
This can be done by opening the virtual keyboard, moving to the key you want to map and then pressing the "m" key on the USB/wireless keyboard. Then click the button you want to map.
What I haven't yet managed to work out is how to save these on a 'per game' basis, but if anyone knows I would be grateful to hear about how it can be done.
I hope this guide works for anyone using VICE on Retropie that is not using USB gamepad or similar, and if I can help to make any of this clearer just let me know!
agent4125 last edited by
I've installed VICE from binary from the optional packages from within retropie setup. Version 3.4 rev 37535 SDL2.
I want to map some keys to my controls which are connected to an IPAC keyboard controller.
Specifically for the C64 I want player 1's button 3 when pressed to simulate a press of the C64's RETURN key, since this is common in many games (as is space, F-keys etc).
I am pulling up the virtual keyboard, moving the cursor to RTRN and pressing 'm'. Then pressing pushbutton 3 connected to my IPAC. It asks me do define shift options then... I deselect everything. then hit backspace to get out of the Vice menus.
Then the button 3 works fine, press it and simulates a return keypress no probs.
I then save current settings, save hotkeys, and save joystick mappings. For each of those it says it saved OK.
I've then checked all of these files and none of them have the saved mapping of the RETURN key!
Exiting VICE and reloading confirms it - it doesn't work and I have to manually map it again. :(
Have you had this problem? Any ideas?
It's really frustrating and means I can currently only add C64 games that have no keyboard controls at all. :(
Thanks for any help you can give.
agent4125 last edited by
I solved this as detailed here: (you have to save a keymap and set the active keymap to "positional (user)")...