shared files for hid support
Go to file
Maschell aa0ce59f87 Huge commit
Changelog:

Bugfixes:
- Fixes the still moving mouse in aim mode, when mouse is actually not
moving
- Fixed a bug at initializing the config_controller_list;
- Fixed the support for almost all mouses that uses the normal HID mouse
standard (boot mode).
- The emulated sticks are now supported correctly
- The stick now only produces valid values. Stick absusing not possible
anymore

New features:
- Added support for config files that can be read from an SD Card.
- Added support for more keyboard buttons
- Added support for gamepad button remapping
- Made the double used buttons on the GC Pad configuable
- The keyboard can now emulate the sticks correctly
- Keyboard buttons for the sticks can be set
- The mouse buttons can now be configured
- The mouse can be configured to emulate the left stick
- Added support for one more DPAD mode (CONTRPDM_Absolute_2Values)

Other:
- Removed the support for the PS2 Adapter and Saitek P2600, but they can
be added trough a config file.
- The engine now uses 16 hardcoded slots the devices can use.
- cleaned up the logging output
- Logging of the currently pressed buttons possible

and more little things I dont remember
2016-08-03 20:46:46 +02:00
.gitattributes 💥🐫 Added .gitattributes & .gitignore files 2016-04-25 20:21:54 +02:00
.gitignore 💥🐫 Added .gitattributes & .gitignore files 2016-04-25 20:21:54 +02:00
config_parser.cpp Huge commit 2016-08-03 20:46:46 +02:00
config_parser.h Huge commit 2016-08-03 20:46:46 +02:00
config_reader.cpp Huge commit 2016-08-03 20:46:46 +02:00
config_reader.h Huge commit 2016-08-03 20:46:46 +02:00
config_values.cpp Huge commit 2016-08-03 20:46:46 +02:00
config_values.h Huge commit 2016-08-03 20:46:46 +02:00
controller_patcher.c Huge commit 2016-08-03 20:46:46 +02:00
controller_patcher.h Huge commit 2016-08-03 20:46:46 +02:00
cp_retain_vars.c Huge commit 2016-08-03 20:46:46 +02:00
cp_retain_vars.h Huge commit 2016-08-03 20:46:46 +02:00
pad_const.c Huge commit 2016-08-03 20:46:46 +02:00
pad_const.h Huge commit 2016-08-03 20:46:46 +02:00
README.md Update README.md 2016-07-31 13:05:32 +02:00
string_tools.cpp Huge commit 2016-08-03 20:46:46 +02:00
string_tools.hpp Huge commit 2016-08-03 20:46:46 +02:00

What is in this controller_patcher repository

These files are the magic behind tools like HID to VPAD and can used to use your USB HID Device on your WiiU console.

How to create config files

Detailed information about creating config files and adding support for more controller can be found in the wiki

Where can I find config files

Configfiles for all controllers are collection in this repository

#Dependencies for including it in other applications This controller_patcher is build to be used in serveral projects. It don't uses some ultra fancy external libraries.
To be able to use in other projects, you will need some external data though.

  • At first, you need a copy of the dynamic_libs in your src/dynamic_libs folder.
  • To able to log something, you need the right logger functions.

Example implementation

###How to "install" it In order to add hid support to your application, you need add these lines add each start up.

  #include "controller_patcher/controller_patcher.h"
  #include "controller_patcher/config_reader.h"
  #include "controller_patcher/cp_retain_vars.h"
  int __entry_menu(int argc, char **argv){
    [...]
    
    init_config_controller(); //Inits the data
    init_button_remapping(); // inits the data for the buttons remapping
    
    if(gConfig_done == HID_INIT_DONE){ // Only read the SD content once (When we're in the Mii Maker and have the rights to do it)
      gConfig_done = HID_SDCARD_READ;       
      ConfigReader::getInstance(); //doing the magic automatically
      ConfigReader::destroyInstance(); //destroying the SD reader
    }
    
    [...]
  }

When you return back to the homebrew launcher, simply add the following line:

deinit_config_controller();

Take a look at the HID to VPAD sources for an actual example.

###How to use it:

Once you set up everything correctly, you can use the "setControllerDataFromHID" method to fill a VPADData pointer. Example:

VPADData buffer;
setControllerDataFromHID(&buffer,HID_ALL_CONNECTED_DEVICES);

This example will add the input from ALL connected HID devices into the created VPADData.

#Credits:

  • Maschell
  • FIX94 - huge thanks to him and his initally created gc-to-vpad. Was a motivation and base to start all this