-
-
Notifications
You must be signed in to change notification settings - Fork 505
XKeysJoystickNotes
This page explains how to program X-keys switch interfaces to send joystick input for use as a selection mechanism in OptiKey.
An X-keys switch interface is a USB device that pretends to be another USB device, such as a mouse, keyboard, or game controller.
To use a switch as a selection method in OptiKey, you would usually tell the switch interface to pretend to be a keyboard and follow instructions for changing the selection method.
Sometimes you might want to tell the switch interface to pretend to be a joystick. See the main wiki article on game controller / joystick input for more details on why you might want to do this and how to configure OptiKey.
The rest of this page describes how to actually program the X-keys switch interface to pretend to be a joystick.
These instructions will use the X-keys 3-switch interface as an example. The procedure for the 12-switch interface is essentially identical.
These instructions assume you are only connecting one switch to your switch interface. If you want to connect multiple switches, you may need to purchase a splitter device (for the 3-switch interface) or use multiple ports (on the 12-switch interface).
Plug your switch into the end of the switch interface. Plug the switch interface into a USB port on your computer or a USB hub (preferably a hub with an external power supply).
Go to the X-keys website download page, and download the MacroWorks 3.1 installer. Run the installer and follow the prompts to complete the installation.
When you first run MacroWorks with your switch interface plugged in, it will prompt you to do some setup tasks. Accept the default options and click OK before moving on.
- Open MacroWorks.
- You should see a dialog box titled Select Mode. Click on Hardware.
If you don't see this dialog box, go the Mode menu and verify that Hardware Resident Mode is selected.
-
Press the switch you want to program. This should open another window.
-
Click on the Function tab.
- Click Show Functions.
- Another window listing functions should appear. Click on the + next to Game Controller. Then double click on Game Button.
After you double click, the text GameButton[1,1] should appear under Press Macro Event. This indicates that the game controller button 1 should be pressed whenever you press the switch.
- Click on the white line under Release Macro Event. Double click on Game Button in the Functions Window. You should see GameButton[1,1] appear under the Release Macro Event. We want to release button 1 when the switch released, so change the State box from 1 to 0. Your screen should look like this:
- Close the Functions window. Click Save in the Macro Window. You've finished specifying the script. Now we need to write it to the memory of the X-keys device.
- In MacroWorks, click file and then click Write to Device.
- Wait for the process to finish. This may take from a new seconds to a couple minutes.
Finally, we need to change the PID so Windows will recognize the device as a joystick/game controller. You want to do this only AFTER writing your program to the device. Once you change the PID, you won't be able to edit your script without changing the PID back to the original PID.
- Click on the Tools menu and then hover over Advanced. Click Endpoints/PID changer.
- From the drop down menu, select 1223 | Joystick | Mouse | Multimedia. (For the 12 switch interface, select 1194 | Joystick | Mouse | Multimedia.) Click OK.
- You should see messages from MacroWorks and Windows showing the one device was unplugged and a new one was plugged in. You should now be ready to use the
TestControllers.exe
tool and proceed with OptiKey configuration as described here.
Once you've changed the PID, a game controller should show up in the Control Panel. However, the Windows game controller properties may not correctly display your switch presses. This isn't necessarily a problem. Try with OptiKey before you assume it's not working.
If your switch interface is not working or is working intermittently, you can try:
- Make sure you're programming in hardware mode.
- Exit MacroWorks after the programming is complete. (Right click on the icon on the taskbar and click exit from the menu.) If this works, be sure to remove MacroWorks from your startup programs list so it doesn't restart automatically.
- If you're using a USB hub, instead plug directly into the computer. If this isn't possible, try a USB hub with an external power supply.
- Update the firmware of your X-keys device.
- Contact tech support at P.I. Engineering. They are generally very helpful and responsive.
If you find Optikey useful please consider sponsoring this project: https://www.patreon.com/Optikey
Question/problem/request? [email protected], or tweet me @Optikey_Julius
Approved and recommended by Fundacion de Neurociencias
Korean dictionary "Frequency of modern Korean usage" in 2005, by "National Institute of Korean Language":
Translation functionality powered by Yandex.Translate
Want to play Minecraft using only your eyes?! Check out the brilliant fork of Optikey: EyeMine
User guides:
- Type your first word
- Numbers, symbols & diacritics
- Using eye trackers
- Using webcams
- Change selection method
- Using a joystick or gamepad
- Speech
- Voice banking
- Simulate a keyboard
- Simulate a mouse
- Multi-key selection
- Suggestions
- Next word prediction
- Auto-capitalisation & auto-spacing
- The dictionary
- Size & position
- Transparency
- Change the theme
- Conversation only mode
- Sleep
- Speed up & slow down
- Shut down
- Alternative keyboard layouts
- Dynamic Keyboards
- Symbol / CommuniKate boards
- Look to scroll
- Plugins
- Play Minecraft
Management console screens:
- Visual settings
- Sound settings
- Word settings
- Pointing & selecting settings
- Dictionary management
- Plugin management
- Other settings
Troubleshooting: