How to integrate an HID USB Controller? - c++

I'm at a standstill. I have this non-standard game controller which I would like to integrate into an application. It has three joysticks, and fifteen possible buttons.
It is an HID compliant USB-connected controller, operating primarily on Windows, but at some point I will have to port it over to Android as well. I want to monitor for inputs in my C++ project, and then use those inputs. So for example, with the joysticks I will be monitoring the axis value, and buttons I will be monitoring the boolean.
How do I find the input variable (if any) for the joysticks and buttons, and then link them to the code? I've used XInput for compatible controllers before, so I have some familiarity with that system.

I think the easiest way could be by getting the key code. You can easily search in google for html key codes and if you use the joystick it should say what its code is

Related

Systemwide USB keyboard hook

im looking into the WDK at the moment to see how i would be able to make a systemwide keyboard hook on USB keyboards ( and a specific ID ).
What i want to be able to is to filter the keystrokes coming in from that specific USB keyboard (USB HID/keyboard), and be able to send that to a specific application/process only.
Ive seen examples of applications that has to be running that can do that in combination of rawinput and a hook, but i would like it to be systemwide and not demanding an application to run.
I can find examples that makes it quite easy to do with a PS2 keyboard, but when it comes to the USB it starts to look very different.
anyone could suggest me the correct model it has to be based on, and even better examples of how it would be possible to do that ?
and something that would work from XP/windows7 to Windows10 also.

Which trigger should I use for UWP app to be persistently in the background

I am trying to make a simple app that would work with the Corsair SDK to change the colors of my keyboard programmatically. I've developed a simple one that uses straight Win32 API that uses a notification icon to hold the process and allow me to stop it.
I'm trying to make a UWP equivalent of the application using C++ as well. The thing I am looking for is the appropriate trigger so that I can run it in the background as soon as I have it installed much like the "Mail" app that runs in the background and can create notifications (which I won't be doing yet).
Also I would like it that I don't have any forms (or at most have it integrated with Settings)
However for now, I would just like to figure out which trigger should I use?
I was thinking of SystemTrigger::userPresent and SystemTrigger::userNotPresent (to show a different lighting effects on my keyboard depending on whether the user is present or not).
The only thing different between the two modes if when the user is present, I will take in the keyboard states and read some user specific settings.

Low level keyboard hook doesn't work for a specific device in a specific app

I have coded up a low level keyboard hook using SetWindowsHookEX() on Windows CE 4.2 and it seems to work just fine. I am able to see key events using the keyboard and a barcode scanner in notepad and other applications as desired, but I do not see the barcode scanner events in the one application that I want to collect the keys in. I still see events from the keyboard, however, so I know that the keyboard hook is still working and in the hook chain. I have even tried inserting my hook in the chain every millisecond just to see if it would make a difference, but no dice. If I flip back to notepad, it's back to working the way I want it.
I'm not sure what the other application is doing to gain control of the scanner when that application is active that prevents it from acting like a keyboard any more. Any thoughts on this would be greatly appreciated. I've done a bunch of searches without any success. I looked into trying to use RAWINPUT, but it doesn't seem to be supported in Windows CE 4.2 from what I can tell as I don't see the user32.dll in the SDK.
There are two ways to get barcode data on most WEC devices.
The keyboard wedge (where data comes in as as keyboard events)
An OEM specific barcode reader API
If this other app your looking at uses option #2 then there is no keyboard data to retrieve, so it makes sense you wouldn't see any. That said, you might read this article to see if it offers any tips for your keyboard hook.
Functions exported by user32.dll in big Windows are generally found in coredll.dll in WEC/WEH.
-PaulH

Windows Mobile 6.5 Change the camera focus

I have a project to scan some QR-code or bar-code with camera on windows mobile. (phone x01t)
Programing in C++ and using DirectShow.
Tired to change focus with IAMCameraControl interface, but return the error like "...request is not supported".
Are there any way else?
Thanks
Most (if not all) Windows Mobile phones I've used so far used custom camera drivers, which means OEMs decide which functionalities to implement/support. IAMCameraControl is most likely not one of them.
However, you might want to look for OEM-specific SDKs. For instance, Samsung provides custom APIs enabling to change such parameters as camera focus or ISO. Maybe such APIs exist for your device.

Touch friendly GUI in Windows Mobile

I'm porting an audio processing application written in C++ from Windows to Windows Mobile (version 5+). Basically what I need to port is the GUI. The application is quite complicated and the GUI will need to be able to offer a lot of functionality. I would like to create a touch friendly user interface that also looks good. Which basically means that standard WinMo controls are out the window.
I've looked at libraries such as Fluid and they look like something I would like to use. However, as I said I'm developing i C++. Even though it would be possible to only write the GUI part i some .NET language I rather not. My experience with .NET on Windows Mobile is that it doesn't work very well...
Can anyone either suggest a C/C++ touch friendly GUI library for Windows Mobile or some kind of "best practices" document/how-to on how to use the standard Windows Mobile controls in order to make the touch friendly and also work and look well in later versions of Windows Mobile (in particular version 6.5)?
There are two aspects to your question:
Libraries. For this I would take a look at Qt for CE/WinMo. The C++ alternative is MFC.
GUI Design. About Face and Designing Interfaces (J. Tidwell) are a couple of good books.
Also:
make sure that your UI is finger-friendly, I hate it when I have to use a stylus.
keep in mind that on touch screens you can't have tooltips (no mouse over) and you don't have a mouse pointer. WinMo uses click and long click, but the latter is not easily discoverable.
add joystick UI navigation
don't try to cram too many controls on the tiny screen, use tabs or drill-down menus
I don't know any good C++ libs but you could try SlideUI mobile controls (it is in .NET), but you wouldn’t need any specific knowledge to use it and it's available via design time and easy to use.
http://www.devslide.com/products/slideui
Disclosure: I am affiliated with devslide.