Program for testing (I had the opportunity to check on Kontakt5)
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:
As a result, the signal obtained by hitting the plate is NOT a combination of pressing two buttons.
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
Button
JoyToKey
Reduction
Red
Button3
R
Yellow
Button4
Y
Blue
Button1
B
Green
Button2
G
Barrel (pedal)
Button5
T
Plate
Button12
C
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:
Intercept keystroke.
We form a stack of keystrokes of intercepted keys (thus we can select a hit on the plates).
By the time interval we process our stack as a string.
We send the keystroke to the active window according to the button code.
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.