question

pmandl-4608 avatar image
0 Votes"
pmandl-4608 asked ·

How to use the Racing Wheel class in the UWP windows.gaming.input namespace

I want to use the windows.gaming.input to connect my Thrustmaster T300 with Force-Feedback. Some background information: I have to read all data (steering angle, buttons, ...) from the steering wheel and simply display them in a command prompt. If this works, I would like to add the functionality to send the wheel a desired moment (force feedback) and duration. I'm not really deep into C++ (have little experience with it). I read some articles about how to read the wheel and chose the UWP (Universal Windows Program) with its windows.gaming.input API over DirctInput or InputX.

I browsed through the documentation page of windows.gaming.input and found that there is a racing bike class in the namespace windows.gaming.input --> racing wheel.

But now I have the problem that I really can't get anything working with the documentation provided. It's most likely due to my lack of c++-skills, to be frankly I don't really know where to start.

windows-uwp
· 3
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I have some questions here.

First of all, what do you mean by "I really can't get anything working with the documentation provided"? Which function do you want to get and what's the behavior you are getting now?

You mentioned that you are not deep into C++, is your app a C++ UWP project?

Is the RacingWheel object valid when you get it using var wheel = RacingWheel.RacingWheels[0]?

According to the document -RacingWheel Class, if you want to use Thrustmaster T300RS in your app, you need to add extra DeviceCapability in the manifest. Could you please double-check it?


0 Votes 0 · ·

Any updates about this issue? Have you solved your issue?

0 Votes 0 · ·

Hi, sorry for my late reply.

Any updates about this issue? Have you solved your issue?

Since I am limited to 1000 characters I have posted my full reply as a Answer. Thanks for sticking to my question :D



0 Votes 0 · ·

1 Answer

pmandl-4608 avatar image
0 Votes"
pmandl-4608 answered ·

Hi, sorry for my late reply. Yes I got it working, after some painful hours of coding with UWP and the RacingWheel Class. Now that I can read with an UWP console the state of the racing wheel and even request a force-feedback, I would like to warp it into a .dll. Therefore I created some functions like initRacingWheel() and so on. However, I face some problems. In my FF_dll.cpp I get errors that Windows::Foundation::Collections does not exist. Same problems for Windows::Gaming::Input resepctively Windows::Gaming::Input::ForceFeedback. Here is my code:

 #include "pch.h"
 #include "FF_dll.h"
 #include <Synchapi.h>
 #include <windowsnumerics.h>
 #include <Windows.Gaming.Input.ForceFeedback.h>
 #include <Windows.Gaming.Input.h>
    
 using namespace Platform;
 using namespace Windows::Foundation;
 using namespace Windows::Foundation::Collections;
 using namespace Windows::Gaming::Input;
 using namespace Windows::Gaming::Input::ForceFeedback;
 using namespace concurrency;
    
 void initRacingWheel()
 {
 ...
 }

Here is the pch.h file:

 #pragma once
    
 #include "targetver.h"
    
 #include <windows.h>
    
 #include <collection.h>
 #include <ppltasks.h>
    
 #ifndef WIN32_LEAN_AND_MEAN
 #define WIN32_LEAN_AND_MEAN
 #endif


So that you guys know what I would like to do with the .dll: If I get it work I will try to load the .dll into matlab and call the functions with the loadlibrary command. So if you guys could help me with my error message you would really help me. Thanks :D

· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.