📜 ⬆️ ⬇️

Connecting the Wii RockBand Pro Drums to the PC with the definition of blows to the plates


To connect, we need:



Introduction

Anyone familiar with the JoyToKey program will probably ask the question: “Why is the programming language here?”. The fact is that the Wii joystick is limited in the number of buttons when giving a signal to the console, so the creators are not a little clever. When hitting the cymbals, they first send a button press of the corresponding color, then send an additional button (Button12 to the JoyToKey). Because of this method, at least two problems arise:
  1. As a result, the signal obtained by hitting the plate is NOT a combination of pressing two buttons.
  2. There are moments when an additional beat on the other drum sends a signal in the interval between the sending of a combination from a kick on a plate, therefore, selecting the right signals is almost impossible.

Denote the buttons / colors of the reels

ButtonJoyToKeyReduction
RedButton3R
YellowButton4Y
BlueButton1B
GreenButton2G
Barrel (pedal)Button5T
PlateButton12C

From here we obtain that YC, BC, GC is a yellow plate, blue and green, respectively.


')
Configuring JoyToKey

In this program, I hung the buttons on the NumPad:
Button1..Button5 - Num1..Num5
Button12 - Num9

Programming

The task of the program is as follows:
  1. Intercept keystroke.
  2. We form a stack of keystrokes of intercepted keys (thus we can select a hit on the plates).
  3. By the time interval we process our stack as a string.
  4. We send the keystroke to the active window according to the button code.
  5. Clearing the stack

The source code can be downloaded here . To describe
how it works, I will call only two functions: PostKeyEx32 (emulation of a key), RegisterHotKey (Interception of clicks).

Total

In conclusion, I want to show you not a great video with the result of the work of this whole bunch. In the program itself, the left column is a list of certain hits, on the right is spent stacks.

Source: https://habr.com/ru/post/130798/


All Articles