[Q] Teensy 3.2 - USB Joystick - Change device name?

Status
Not open for further replies.

Tyoi

New member
Hello there,

I've just received my very first Teensy 3.2 (have been using arduino's for ages) and made a little 24 button joystick for use in games. Only 15min in and I got it working! So I'm ditching my arduinos ;)

However, I have been trying to read up on ways to change the device name that shows up in the joy.cpl program (windows) and games. It's now listed as "Keyboard/Mouse/Joystick". I have found this link https://forum.pjrc.com/threads/23796-How-to-change-Teensy-3-0-PRODUCT_NAME but I can't seems to get it to work. The name doesn't change when uploading a "mynames.c" file (as writen by Paul). Restarting windows and/or disconnecting and reconnecting the device doesn't do anything either.

AmIDoingItWrong or have the steps changed? Help is very much appreciated!

I'm using either the arduino IDE (with teensyduino) or Visual Studio 2015 with Visual Micro.

EDIT:
The name did change when looking (windows) in the 'Devices and Printers' panel. However, it still shows up in games as "Keyboard/Mouse/Joystick".

Side question: Is it possible to attach mutplie USB joystick 'teensy's' on the same computer? For say, use in a flightsimulator? I.E. Will it show up in games as "JOY1 button0" for the first and "JOY2 button0" for the second joystick?
 
Last edited:
Unfortunately, that's a Windows thing (though maybe Linux/Mac do it as well)... it caches some of the information, and unless you change the USB VID/PID, or remove the corresponding registry keys, it shows the old name (and holds some of the other parameters as well).

And yes, you can use multiple Teensy joysticks on the same computer... it acts just like having multiple USB joysticks plugged in.

Pat
 
Hey Pat,

Thanks for replying. I have just deleted (as it seems) all regkeys/values ect for the board and the name seems to work now (HKEY_CURRENT_USER>System>CurrentControlSet>Control>MediaProperties>Joystick>OEM deleted the VID_16C0&PID_0482 dir)
However, only the modelname (OEMName) is changed to ' Something', the manufacturer name is set to 'unknown' where I expected to see ' myName'. Any idea why it hasn't changed?

I used the following code for a name.c file:
Code:
#include <usb_names.h>

#define MANUFACTURER_NAME  {'m','y','N','a','m','e'}
#define MANUFACTURER_NAME_LEN 6
#define PRODUCT_NAME    {'S','o','m','e','t','h','i','n','g'}
#define PRODUCT_NAME_LEN  9

struct usb_string_descriptor_struct usb_string_manufacturer_name = {
  2 + MANUFACTURER_NAME_LEN * 2,
  3,
  MANUFACTURER_NAME
};
struct usb_string_descriptor_struct usb_string_product_name = {
  2 + PRODUCT_NAME_LEN * 2,
  3,
  PRODUCT_NAME
};

Also, is it possible to set a Model number and a Description? (and, how to change the VID and PID?)
 
Hmm, I've never done it that way... I've only changed the info directly in hardware\teensy\avr\cores\teensy3\usb_desc.h under the Arduino directory. But if changing the name your way works, to change the VID/PID, maybe you can do something similar with:
Code:
#define VENDOR_ID		0x16C0
#define PRODUCT_ID		0x0482

In my case, Windows shows "Unavailable" and grayed out for Manufacturer, Model Number, and Description... is that what you're seeing, or is it actually "unknown" (in black text like "Something" under Model)? I'm not sure, but I get the impression that it's pulled from the driver or something, not the manufacturer name of the device. Quite a few of my devices show the exact same thing... and my built-in laptop webcam shows "Microsoft" as the manufacturer, though I'm almost certain it's not (though it's using the generic Microsoft UVC driver).

Looking at the device information using USBlyzer, it does show the correct manufacturer and product names that I specified in my code... so I'd guess it's just the way Windows is.

Pat
 
Excuse my typo, it indeed reads "Unavailable", not unknown, and is greyed out so we're seeing the same thing.

When edititng the usb_desc.h file, it will probably have to be changed manually every time I use a new Keyboard/Mouse/Joystick?
 
When edititng the usb_desc.h file, it will probably have to be changed manually every time I use a new Keyboard/Mouse/Joystick?
Yep... exactly. It's kinda annoying, but not a huge deal. I wasn't aware of the method you did, but that seems a little bit cleaner.

Pat
 
Status
Not open for further replies.
Back
Top