Previous Thread
Next Thread
Print Thread
Rate This Thread
Hop To
Page 1 of 2 1 2
#3126128 - 10/29/10 03:50 AM T.A.R.G.E.T. multiple devices and non-TM devices support  
Joined: Oct 2010
Posts: 54
Feed Offline
Junior Member
Feed  Offline
Junior Member

Joined: Oct 2010
Posts: 54
I have 2 MFD packs (4 devices), and TARGET refused to install with them connected. TARGET also only recognizes and allows configuration of the first pack (first 2 MFDs).

Last edited by Joe; 11/04/10 03:37 PM.
Inline advert (2nd and 3rd post)

#3126129 - 10/29/10 03:51 AM Re: T.A.R.G.E.T. multiple devices and non-TM devices support [Re: Feed]  
Joined: Oct 2010
Posts: 54
Feed Offline
Junior Member
Feed  Offline
Junior Member

Joined: Oct 2010
Posts: 54
It recognizes multiple T.16000-Ms as connected, but it only allows configuration of the first one.

#3128055 - 11/01/10 02:40 PM Re: T.A.R.G.E.T. multiple devices and non-TM devices support [Re: Feed]  
Joined: Oct 2010
Posts: 83
Nicu Offline
Junior Member
Nicu  Offline
Junior Member

Joined: Oct 2010
Posts: 83
There is a script sample which uses 2 T16000 and maps both of them over the mouse cursor. You need to define the second one by yourself (the first one is automatically defined by TARGET):

Code:
include "target.tmh"

alias T160001;	// second T16000 handle, which will be used all mapping commands


int main()
{
	if(Init(&EventHandle)) return 1;
	&T160001 = GetIndexJoy(SelectUsbDevice("VID_044F&PID_B10A"));		// expect a second T16000 to be plugged on USB
	
	MapAxis(&T16000, JOYX, MOUSE_X_AXIS);
	MapAxis(&T16000, JOYY, MOUSE_Y_AXIS);
	MapAxis(&T160001, JOYX, MOUSE_X_AXIS);
	MapAxis(&T160001, JOYY, MOUSE_Y_AXIS);
}

int EventHandle(int type, alias o, int x)
{
    DefaultMapping(&o, x);
}


The same way you can use more MFDs. The string used in SelectUsbDevice is taken from the target.tmh file at the beginning, where the default devices are defined.

#3129487 - 11/03/10 12:57 PM Re: T.A.R.G.E.T. multiple devices and non-TM devices support [Re: Feed]  
Joined: Oct 2010
Posts: 54
Feed Offline
Junior Member
Feed  Offline
Junior Member

Joined: Oct 2010
Posts: 54
Nicu - this is awesome news!!! I think the GUI is just about worthless ANYWAY, so if we can access additional devices via manual scripting - wonderful! From just a quick glance, the SelectUsbDevice() function looks like it might even be possible to grab non-TM hardware. Anyone able to confirm that?

#3129526 - 11/03/10 01:53 PM Re: T.A.R.G.E.T. multiple devices and non-TM devices support [Re: Feed]  
Joined: Apr 2002
Posts: 17,733
Joe Offline
Veteran
Joe  Offline
Veteran

Joined: Apr 2002
Posts: 17,733
Bridgewater, NJ
Originally Posted By: Feed
From just a quick glance, the SelectUsbDevice() function looks like it might even be possible to grab non-TM hardware. Anyone able to confirm that?
Ooh, very good point.

Where can one see a controller's ID (for example, "VID_044F&PID_B10A" in this case) so that one knows what to try in T.A.R.G.E.T.?

#3129798 - 11/03/10 07:16 PM Re: T.A.R.G.E.T. multiple devices and non-TM devices support [Re: Feed]  
Joined: Jul 2005
Posts: 4,328
Panther Offline
Senior Member
Panther  Offline
Senior Member

Joined: Jul 2005
Posts: 4,328
Right click on the hardware in device manager, select Properties, go to the Hardware tab, select your hardware, hit properties again, go to details, and from the Property drop down select Hardware ID.

There maybe an easier way but that's how I found the ID.


Virtual Thunderbirds, LLC | Sponsored by Thrustmaster

ASUS ROG MAXIMUS VIII HERO, i7 6700k, G.SKILL Ripjaws V Series 32GB, 980TI 6GB G1 OC, Obutto oZone, Thrustmaster HOTAS Warthog, CH Pro Pedals, NP TrackIR5, ***Soon*** Oculus Rift
#3129891 - 11/03/10 09:32 PM Re: T.A.R.G.E.T. multiple devices and non-TM devices support [Re: Feed]  
Joined: Oct 2010
Posts: 54
Feed Offline
Junior Member
Feed  Offline
Junior Member

Joined: Oct 2010
Posts: 54
Panther - thanks for that - I've been using a freeware app from OpenCockpits that hangs every time. biggrin

edit - I have a Saitek Aviator ... somewhere. :/

Last edited by Feed; 11/03/10 09:34 PM.
#3129897 - 11/03/10 09:46 PM Re: T.A.R.G.E.T. multiple devices and non-TM devices support [Re: Feed]  
Joined: Jul 2005
Posts: 1,508
Teej Offline
Member
Teej  Offline
Member

Joined: Jul 2005
Posts: 1,508
Erp. Nevermind. Misunderstood the question. biggrin

Better answer in a moment....will update.

OK, maybe it's not a better answer for the way you're trying to do it. Heh.

But you can see everything that's currently plugged in in the registry.

HKLM\system\currentcontrolset\enum\USB

Last edited by Teej; 11/03/10 09:50 PM.

#6 - Opposing / Left Solo
Virtual Thunderbirds, LLC | Sponsored by Thrustmaster
#3130394 - 11/04/10 03:37 PM Re: T.A.R.G.E.T. multiple devices and non-TM devices support [Re: Feed]  
Joined: Apr 2002
Posts: 17,733
Joe Offline
Veteran
Joe  Offline
Veteran

Joined: Apr 2002
Posts: 17,733
Bridgewater, NJ
Thread re-titled pending this line of conversation.

#3130890 - 11/04/10 11:16 PM Re: T.A.R.G.E.T. multiple devices and non-TM devices support [Re: Feed]  
Joined: Apr 2002
Posts: 17,733
Joe Offline
Veteran
Joe  Offline
Veteran

Joined: Apr 2002
Posts: 17,733
Bridgewater, NJ
OK, this is definitely not a simple process (if it's going to work at all).

This is the easy part; I identified the hardware ID of a G940 joystick. It is VID_046D&PID_C2A8.

So, I added a line to target.tmh (BTW, on my system this file was read-only, and I had to change that property). It now reads:
Code:
alias Throttle	= "VID_044F&PID_0404", Joystick	= "VID_044F&PID_0402", LMFD	= "VID_044F&PID_b351";
alias RMFD 	= "VID_044F&PID_b352", HCougar	= "VID_044F&PID_0400", T16000	= "VID_044F&PID_B10A";
alias G940Stick	= "VID_046D&PID_C2A8";


I then wrote a very simple program just to see what would happen...
Code:
include "target.tmh"

int main()
{


    if(Init(&EventHandle)) return 1; // declare the event handler, return on error

MapKey(&Joystick, TG1, "x");
MapKey(&G940Stick, TG1, "y");


}

int EventHandle(int type, alias o, int x)
{
    DefaultMapping(&o, x);
}

... keeping in mind that T.A.R.G.E.T. does not know what the "TG1" button is on the G940 stick.

This program compiles without errors. However, when I run it I get the following:

Quote:
Physical USB HID devices managed by script!
Currently plugged USB HID devices[4]:
1: "Thrustmaster HOTAS Cougar" - "USB\Vid_044f&Pid_0400&Rev_0110&MI_00"
2: "Joystick - HOTAS Warthog" - "USB\Vid_044f&Pid_0402&Rev_0100"
3: "Throttle - HOTAS Warthog" - "USB\Vid_044f&Pid_0404&Rev_0100"
4: "F16 MFD 1" - "USB\Vid_044f&Pid_b351&Rev_0100"
USB HID device "Throttle - HOTAS Warthog"(USB\VID_044F&PID_0404\6&12616152&0&4) selected
USB HID device "Joystick - HOTAS Warthog"(USB\VID_044F&PID_0402\6&33BC7F0&0&1) selected
USB HID device "F16 MFD 1"(USB\VID_044F&PID_B351\5&227472FB&0&1) selected
USB HID device with hardware id "VID_044F&PID_b352" cannot be found
USB HID device "Thrustmaster HOTAS Cougar"(USB\VID_044F&PID_0400&MI_00\8&F5FA503&0&0000) selected
USB HID device with hardware id "VID_044F&PID_B10A" cannot be found
Virtual HID devices managed by script!
Connecting virtual joystick...Done
Device name set to Thrustmaster Combined
Connecting virtual keyboard...Done
Connecting virtual mouse...Done
Script stopped!

Runtime Error: Index out of bounds for: devicedata in GetDeviceData ( line 250 in target.tmh )


Here is the code around line 250 of target.tmh:
Code:
int GetDeviceData(alias dev) // fill global devdata alias based on device name (joy1, joy2,...)
{
	char t; Dim(&t, 16);
	strname(&dev, &t);
	Map(&devdata, &&devicedata[t[3]-'0']);
}


I am not a computer programmer, so the above is beyond my understanding.


Anyone care to continue?

#3130972 - 11/05/10 12:59 AM Re: T.A.R.G.E.T. multiple devices and non-TM devices support [Re: Feed]  
Joined: Oct 2010
Posts: 54
Feed Offline
Junior Member
Feed  Offline
Junior Member

Joined: Oct 2010
Posts: 54
Joe - instead of adding this line to target.tmh: alias G940Stick = "VID_046D&PID_C2A8";
You might try replacing an existing alias definition (I'd go with Joystick) with your G940's id. Make a backup (as I'm sure you know)!
I'm willing to bet that works (but I'm no programmer, either). This is exciting, though!

[edit] - actually, I bet it doesn't work. I bet the device ids for the ThrustMaster products are hard-coded somewhere. It doesn't even appear that it *tried* to find your G940...

Last edited by Feed; 11/05/10 01:06 AM.
#3131021 - 11/05/10 01:40 AM Re: T.A.R.G.E.T. multiple devices and non-TM devices support [Re: Feed]  
Joined: Apr 2002
Posts: 17,733
Joe Offline
Veteran
Joe  Offline
Veteran

Joined: Apr 2002
Posts: 17,733
Bridgewater, NJ
Originally Posted By: Feed
Joe - instead of adding this line to target.tmh: alias G940Stick = "VID_046D&PID_C2A8";
You might try replacing an existing alias definition (I'd go with Joystick) with your G940's id. Make a backup (as I'm sure you know)!
I'm willing to bet that works (but I'm no programmer, either). This is exciting, though!

[edit] - actually, I bet it doesn't work. I bet the device ids for the ThrustMaster products are hard-coded somewhere. It doesn't even appear that it *tried* to find your G940...


No, it didn't even try, it would appear.

Your suggestion is a good one, so let's see what happens.

target.tmh
Code:
// alias Throttle	= "VID_044F&PID_0404", Joystick	= "VID_044F&PID_0402", LMFD	= "VID_044F&PID_b351";
alias Throttle	= "VID_044F&PID_0404", Joystick	= "VID_046D&PID_C2A8", LMFD	= "VID_044F&PID_b351";
alias RMFD 	= "VID_044F&PID_b352", HCougar	= "VID_044F&PID_0400", T16000	= "VID_044F&PID_B10A";


G940 test.tmc
Code:
include "target.tmh"

int main()
{


    if(Init(&EventHandle)) return 1; // declare the event handler, return on error

MapKey(&Joystick, S1, "x");


}

int EventHandle(int type, alias o, int x)
{
    DefaultMapping(&o, x);
}


Resulting log:
Quote:
Physical USB HID devices managed by script!
Currently plugged USB HID devices[4]:
1: "Thrustmaster HOTAS Cougar" - "USB\Vid_044f&Pid_0400&Rev_0110&MI_00"
2: "Joystick - HOTAS Warthog" - "USB\Vid_044f&Pid_0402&Rev_0100"
3: "Throttle - HOTAS Warthog" - "USB\Vid_044f&Pid_0404&Rev_0100"
4: "F16 MFD 1" - "USB\Vid_044f&Pid_b351&Rev_0100"
USB HID device "Throttle - HOTAS Warthog"(USB\VID_044F&PID_0404\6&12616152&0&4) selected
USB HID device with hardware id "VID_046D&PID_C2A8" cannot be found
USB HID device "F16 MFD 1"(USB\VID_044F&PID_B351\5&227472FB&0&1) selected
USB HID device with hardware id "VID_044F&PID_b352" cannot be found
USB HID device "Thrustmaster HOTAS Cougar"(USB\VID_044F&PID_0400&MI_00\8&F5FA503&0&0000) selected
USB HID device with hardware id "VID_044F&PID_B10A" cannot be found
Virtual HID devices managed by script!
Connecting virtual joystick...Done
Device name set to Thrustmaster Combined
Connecting virtual keyboard...Done
Connecting virtual mouse...Done

main returned 0

It didn't crash. However, note the line I designated in red text; the script did not find the G940.

There is also the second line "Currently plugged USB HID devices[4]". That's not accurate, as when I ran the script I also had connected the G940 stick, X-65F throttle, X-52 Pro Throttle, and CH Fighterstick. What it really is saying is "Currently plugged Thrustmaster USB HID devices".


I still don't think this is a definite no-go, but there is more to a possible solution.

#3131280 - 11/05/10 01:09 PM Re: T.A.R.G.E.T. multiple devices and non-TM devices support [Re: Feed]  
Joined: Oct 2010
Posts: 54
Feed Offline
Junior Member
Feed  Offline
Junior Member

Joined: Oct 2010
Posts: 54
I feel like there should be a "nice try, buddy ... " error being reported, instead of "not found." LOL

#3131364 - 11/05/10 02:41 PM Re: T.A.R.G.E.T. multiple devices and non-TM devices support [Re: Feed]  
Joined: Jul 2005
Posts: 1,508
Teej Offline
Member
Teej  Offline
Member

Joined: Jul 2005
Posts: 1,508
I have a pretty good idea how this might work (and also a pretty good idea why it might not).

I'll be able to give it a try in a couple of hours. Will report back and/or work with Joe.

I'm not going to be asking TM about this - I know they're busy enough making stuff work that's supposed to work. wink If they want to chime in, I know they're reading here.


#6 - Opposing / Left Solo
Virtual Thunderbirds, LLC | Sponsored by Thrustmaster
#3131390 - 11/05/10 03:07 PM Re: T.A.R.G.E.T. multiple devices and non-TM devices support [Re: Feed]  
Joined: Apr 2002
Posts: 17,733
Joe Offline
Veteran
Joe  Offline
Veteran

Joined: Apr 2002
Posts: 17,733
Bridgewater, NJ
I'm sure they are reading this and either cringing or smiling. Either way, there's no way they're going to comment in this thread. smile

Good luck, Teej.

#3131439 - 11/05/10 04:16 PM Re: T.A.R.G.E.T. multiple devices and non-TM devices support [Re: Feed]  
Joined: Jul 2005
Posts: 1,508
Teej Offline
Member
Teej  Offline
Member

Joined: Jul 2005
Posts: 1,508
Right. They really have 2 routes...they can say "OK, I guess now we have to lock it down" if they haven't already....

Or they can realize that the most successful ventures in entertainment/sims come from aftermarket modifications...look at rFactor..."Hey, here's your framework! Have fun!"


#6 - Opposing / Left Solo
Virtual Thunderbirds, LLC | Sponsored by Thrustmaster
#3131455 - 11/05/10 04:41 PM Re: T.A.R.G.E.T. multiple devices and non-TM devices support [Re: Feed]  
Joined: Jul 2005
Posts: 1,508
Teej Offline
Member
Teej  Offline
Member

Joined: Jul 2005
Posts: 1,508
Not looking promising right now. Looks like some of the stuff might be hardcoded in stuff that gets run before the .tmh gets loaded.


#6 - Opposing / Left Solo
Virtual Thunderbirds, LLC | Sponsored by Thrustmaster
#3138789 - 11/17/10 12:59 AM Re: T.A.R.G.E.T. multiple devices and non-TM devices support [Re: Feed]  
Joined: Mar 2007
Posts: 1,298
Reschke Offline
Plankowner
Reschke  Offline
Plankowner
Member

Joined: Mar 2007
Posts: 1,298
Vestavia, AL
How would it work if I wanted to build a USB device with a bodnar board and try to use TARGET to configure that. Not worrying about other OEM devices but just a home built device?

Last edited by Reschke; 11/17/10 01:01 AM.

Star Citizen Referal Code
STAR-MP6J-VFH7

i7-13700K @ 3.40GHz
32GB RAM
GeForce 3060RTX
MSI MAG Z790 Tomahawk
lots of SSD's and a good old fashioned 1TB HDD
Samsung G9 Odyssey 49"
TrackIR 5 with Track Clip Pro
Windows 11 64bit
Warthog #1397...compliments of SimHQ
#3138843 - 11/17/10 02:53 AM Re: T.A.R.G.E.T. multiple devices and non-TM devices support [Re: Feed]  
Joined: Apr 2002
Posts: 17,733
Joe Offline
Veteran
Joe  Offline
Veteran

Joined: Apr 2002
Posts: 17,733
Bridgewater, NJ
Doubt it would work any differently to a Logitech /CH/Saitek device - meaning (currently) it wouldn't work at all.

#3140402 - 11/19/10 11:03 AM Re: T.A.R.G.E.T. multiple devices and non-TM devices support [Re: Feed]  
Joined: Apr 2010
Posts: 67
Hempstead Offline
Junior Member
Hempstead  Offline
Junior Member

Joined: Apr 2010
Posts: 67
Bellevue, WA, USA
The new TARGET RC2 gives this for SelectDevice() for a CH rudder.

Code:
Cannot use "VID_068E&PID_00F2"
T.A.R.G.E.T is supporting only Thrustmaster devices!


Thanks to business consideration, Guillemot has made their position as clear as the blue sky. And, I don't blame them.

However, I have managed to do the followings...

Code:
Running script: test.tmc
Mapped plugin module "C:\Program Files\Thrustmaster\TARGET\Plugins\sys.dll"
Compile Succeeded.
Physical USB HID devices managed by script!
Currently plugged USB HID devices[3]:
1: "Joystick - HOTAS Warthog" - "USB\Vid_044f&Pid_0402&Rev_0100"
2: "Throttle - HOTAS Warthog" - "USB\Vid_044f&Pid_0404&Rev_0100"
3: "CADDY's Joystick"... 


And I have also done MapKey(&CaddyJoystick, TG1, 'f') and successfully generated an 'F' inside the Device Analyzer by pressing a H/W button on my non-TM controller; just as a proof of concept. It's "sort of" a general solution, but it will not let you take any controller and put it under TARGET. However, it will let me do some controllers.

For some controllers, it's just a whole lot of trouble for not much gain. I mean, for Pete's sake, my CH rudder works just fine outside of TARGET. I never like complicated macros/scripts anyway.

Don't bother asking me how I do it... I don't tell, and Guillemot might tolerate a small number of my real life friends doing it in private. Tell that in public and they will code me out (it would be a bit difficult, but not too hard) and I would have to resort to a lot more difficult and time consuming methods. I am not keen on provoking an arms race with Guillemot. I have a job, and this is their job.

#4354600 - 04/30/17 05:53 PM Re: T.A.R.G.E.T. multiple devices and non-TM devices support [Re: Feed]  
Joined: Apr 2017
Posts: 1
klabauta Offline
Junior Member
klabauta  Offline
Junior Member

Joined: Apr 2017
Posts: 1
... and how you did it?

Page 1 of 2 1 2

Moderated by  RacerGT 

Quick Search
Recent Articles
Support SimHQ

If you shop on Amazon use this Amazon link to support SimHQ
.
Social


Recent Topics
Actors portraying US Presidents
by PanzerMeyer. 04/19/24 12:19 PM
Dickey Betts was 80
by Rick_Rawlings. 04/19/24 01:11 AM
Exodus
by RedOneAlpha. 04/18/24 05:46 PM
Grumman Wildcat unique landing gear
by Coot. 04/17/24 03:54 PM
Peter Higgs was 94
by Rick_Rawlings. 04/17/24 12:28 AM
Whitey Herzog was 92
by F4UDash4. 04/16/24 04:41 PM
Anyone can tell me what this is?
by NoFlyBoy. 04/16/24 04:10 PM
10 Years ago MV Sewol
by wormfood. 04/15/24 08:25 PM
Pride Of Jenni race win
by NoFlyBoy. 04/15/24 12:22 AM
Copyright 1997-2016, SimHQ Inc. All Rights Reserved.

Powered by UBB.threads™ PHP Forum Software 7.6.0