Skip to content

Command line options

kmcnaught edited this page Jul 24, 2023 · 5 revisions

If you launch Optikey Pro (v3.2.4 onwards) from the command line, you can pass it arguments to launch directly into a particular keyboard or folder of keyboards.

For example, you can type one of these at Windows Command Line:

Open a folder

./OptikeyPro.exe "C:\Users\Kirsty\Documents\OptikeyKeyboards"

This will open Optikey showing you a list of XML files found in the OptikeyKeyboards directory

Open a file

./OptikeyPro.exe "C:\Users\Kirsty\Documents\OptikeyKeyboards\my_keyboard.xml"

This will directly open the my_keyboard.xml file in Optikey.

Note that I've used double quotes around the file paths in both examples. This is good practise as it works even when file paths contain a space. If your file paths don't contain spaces then the quotes are optional.

Multiple instances

If you want to have multiple instances running simultaneously, you need to enable "Allow multiple instances of this Optikey app to run simultaneously" in the Management Console -> Extra Features. If this is not enabled and you try to launch another instance at the command line, it will silently fail.

Shortcuts

You may find it helpful to set up shortcuts to specific keyboards using command line arguments. To do this, open the Program Files folder (C:\Program Files\Optikey Pro (x86)\ or C:\Program Files\Optikey Pro\). Right click on OptikeyPro.exe and "Create Shortcut". It will initially place the shortcut on your desktop but you can move it later if you prefer. Find the shortcut, right click, edit Properties and modify the "Target" to include the full path to the file as a command line argument.

screenshot showing shortcut properties

Now rename your shortcut to something meaningful!

Clone this wiki locally