Test Codice Cards Without Printed Markers
You do not need printed Codice cards — or a camera-equipped video wall — to test how your app responds to a Codice. The MT Showcase client includes two built-in simulators that inject virtual Codice markers using the keyboard and mouse.
This is useful when you are:
- Building an app on a desktop or laptop, away from the wall
- Waiting on printed cards, or testing a code before committing it to print
- Checking that a newly registered Codice opens the content you expect
Both simulators feed the same internal marker pipeline that the camera uses, so a widget cannot tell the difference between a simulated marker and a physical card.
Note
The simulators reproduce everything that happens after a card is detected — the Codice DB lookup, the offsets, and the widget behavior. They cannot test the detection itself. Always confirm with a printed card before going live.
Method 1: quick check with Ctrl+Number
The quickest method needs no setup and is always available.
- Start MT Showcase as normal and open your app.
- Press Ctrl+1 through Ctrl+0 to arm one of ten marker slots. These slots are fixed to Codice codes 1 to 10 — Ctrl+1 is code 1, Ctrl+9 is code 9, and Ctrl+0 is code 10.
- Press and hold the left mouse button on the screen. A virtual marker appears at the pointer and stays there while the button is held.
- Move the mouse to move the marker. Scroll the mouse wheel to rotate it.
- Release the mouse button to lift the marker, exactly as if the card had been taken off the screen.
Use this method for a fast look at behavior that only needs a marker held down briefly. For anything else, use Method 2.
Method 2: test any code with a key mapping file
The second method lets you test any Codice code, and leaves markers in place after you drop them — so you can place several at once, or work with the content a marker has opened.
Create the key mapping file
Create a plain text file that maps keyboard keys to Codice codes, one per line, in the form key,code:
# key,codice_code
a,42
b,101
7,2001
The rules are:
- The key must be a single letter (
atoz) or digit (0to9). Letters are not case-sensitive. - The code must be a whole number, and should match a Codice you have registered in the Codice DB screen.
- Lines starting with
#are comments. Blank lines are ignored. - If the same key appears twice, the last line wins.
Bad lines fail silently
Lines that do not follow these rules are skipped without an error. If a key does nothing in the app, check the file for a typo first.
Save the file anywhere convenient — for example markers.csv in your home folder.
Start MT Showcase with the file
Add the --codicetest option to the command you normally use to start the client.
-
On Ubuntu computers:
$ mt-showcase --app "My First App" --codicetest markers.csv -
On Windows computers, edit the MT Showcase desktop shortcut and add the option to the Target field:
"C:\Program Files\MT Showcase\bin\mt-showcase.exe" --app "My first App" --codicetest C:\markers.csv
For more about starting the client with options, see Start and Stop MT Showcase.
Place markers
With the client running:
- Press a mapped key. A marker appears at the mouse pointer. It is not committed yet — think of it as being held just above the screen.
- Move the mouse. The marker follows the pointer. You can release the key; the marker stays attached to the pointer.
- Scroll the mouse wheel to rotate the marker. Use this to test anything that responds to Codice rotation, such as a rotating menu or a widget set to move with the Codice.
- Left-click to drop the marker. It is now placed on the screen and stays there, as if a card had been set down and left.
- Press the key again to create another marker. You can place as many as you need.
- Right-click to remove every placed marker at once, along with any marker still attached to the pointer.
Only one marker can follow the pointer at a time. If you press a second mapped key before dropping the first, nothing happens.
If nothing happens
Work through these in order:
-
Is the code registered? A simulated marker behaves exactly like a printed one, which means an unregistered code does nothing unless your Codice detector is set to allow unregistered cards. Check the code in the Codice DB screen.
-
Does your app have a Codice detector? Without one, an app only recognizes erasers. See Codice Cards for how to add the detector widget to your structure.
-
Is the marker type marked "Coming Soon"? Some Codice types shown in the Codice DB screen can be configured ahead of time but do not yet respond on screen. These are labeled Coming Soon in the type list. Configuration for these types is saved, but nothing happens when the marker is placed — with a simulated marker or a printed card.
-
Was the mapping file read? If no key does anything, the file may not have been found or may contain no usable lines. Check the client log for a line beginning
CodiceTestMode— it reports how many key bindings were loaded, or warns that the file had no valid entries. -
Are you using both methods at once? Avoid combining an armed Ctrl+number slot with a
--codicetestmarker on the pointer. Both respond to the left mouse button, and the result is unpredictable. Use one method at a time.
Related pages
- Codice Cards — registering Codices, adding a Codice detector, and setting up Codice content
- Start and Stop MT Showcase — starting the client with command-line options