Hi guys,
Im currently trying to control virtual Dj from a c# application.
I was hoping to use sendkeys to perform this however iv come across a little hurdle...It doesn't work!
Iv used sendkeys and post message to try and get keyboard shortcuts to work.
It is finding virtual DJ as i can make the app type into the search function, also sending CRTL + enter will preview a track.
but any custom defined shortcuts will not operate.
Iv tested my code on other applications (Firefox notepad and FreestylerDMX) and all works as expected.
If any one has any experiences in this the help would greatly appreciated.
and if your interested this is what im trying to achieve. i want a simple 1u controller for VDJ + FreestylerDMX. It consists of a 1u blanking plate with buttons.
The buttons are linked to an arduino microcomputer which sends serial commands via usb to the computer, which is then processed by the software listening on a comPort.
I have buttons for deck A Play/Pause deck B Play/Pause AutoMix and then for the lighting i have Blackout / Strobe / Fog / taptempo
Im currently trying to control virtual Dj from a c# application.
I was hoping to use sendkeys to perform this however iv come across a little hurdle...It doesn't work!
Iv used sendkeys and post message to try and get keyboard shortcuts to work.
It is finding virtual DJ as i can make the app type into the search function, also sending CRTL + enter will preview a track.
but any custom defined shortcuts will not operate.
Iv tested my code on other applications (Firefox notepad and FreestylerDMX) and all works as expected.
If any one has any experiences in this the help would greatly appreciated.
and if your interested this is what im trying to achieve. i want a simple 1u controller for VDJ + FreestylerDMX. It consists of a 1u blanking plate with buttons.
The buttons are linked to an arduino microcomputer which sends serial commands via usb to the computer, which is then processed by the software listening on a comPort.
I have buttons for deck A Play/Pause deck B Play/Pause AutoMix and then for the lighting i have Blackout / Strobe / Fog / taptempo
Mensajes Mon 26 Jul 10 @ 1:55 pm
I had the same problem when i wrote my Griffin 2 VDJ mapper. This reads inputs from the Powermate and and send keystrokes to VDJ. It's also done in C#.
http://www.virtualdj.com/homepage/pern/blogs/1762/Griffin_Powermate_2_VDJ_Mapper.html
SendKeys doesn't work with VDJ, you have to use the SendInput function in USER32.DLL.
You also have to find the Window handle for VDJ and set that as foreground window before sending keystrokes to it.
http://www.virtualdj.com/homepage/pern/blogs/1762/Griffin_Powermate_2_VDJ_Mapper.html
SendKeys doesn't work with VDJ, you have to use the SendInput function in USER32.DLL.
You also have to find the Window handle for VDJ and set that as foreground window before sending keystrokes to it.
Mensajes Wed 28 Jul 10 @ 1:02 am
BTW:
I was also testing to do a controller like you are with keystrokes, after a while i dropped sending keystrokes and changed that to sending MIDI Data to VDJ.
http://www.virtualdj.com/homepage/pern/blogs/2484/Joystick_Gamepad_to_VDJ_MIDI_Mapper.html
I was also testing to do a controller like you are with keystrokes, after a while i dropped sending keystrokes and changed that to sending MIDI Data to VDJ.
http://www.virtualdj.com/homepage/pern/blogs/2484/Joystick_Gamepad_to_VDJ_MIDI_Mapper.html
Mensajes Wed 28 Jul 10 @ 2:50 am
excellent. thanks for the tip.
Theres no point reinventing the wheel. your software looks exactly what i need, il but a cheap usb game pad from ebay and get soldering.. ;)
I was just about to post my findings, that i needed to look at sendInput. it seems virtualDJ is using direct input.
sendkeys inserts keystrokes in the Windows event queue, but DirectInput bypasses it and hooks directly into the keyboard driver.
Theres no point reinventing the wheel. your software looks exactly what i need, il but a cheap usb game pad from ebay and get soldering.. ;)
I was just about to post my findings, that i needed to look at sendInput. it seems virtualDJ is using direct input.
sendkeys inserts keystrokes in the Windows event queue, but DirectInput bypasses it and hooks directly into the keyboard driver.
Mensajes Wed 28 Jul 10 @ 4:26 pm
hi,
do you have a griffin2VDJ for 64bit?
iv decided to try the sendinput route again as there was a few extra features that i needed. iv studdied the griffin2vdj and was able to make my code to work ... but only in 32bit xp.
do you have a griffin2VDJ for 64bit?
iv decided to try the sendinput route again as there was a few extra features that i needed. iv studdied the griffin2vdj and was able to make my code to work ... but only in 32bit xp.
Mensajes Thu 05 Aug 10 @ 3:53 pm
this worked for me.
Compiled as x64
[StructLayout(LayoutKind.Explicit)]
public struct Input
{
// Fields
[FieldOffset(8)]
public HardwareInput hi;
[FieldOffset(8)]
public KeyboardInput ki;
[FieldOffset(8)]
public MouseInput mi;
[FieldOffset(0)]
public IntPtr type;
}
Compiled as x64
[StructLayout(LayoutKind.Explicit)]
public struct Input
{
// Fields
[FieldOffset(8)]
public HardwareInput hi;
[FieldOffset(8)]
public KeyboardInput ki;
[FieldOffset(8)]
public MouseInput mi;
[FieldOffset(0)]
public IntPtr type;
}
Mensajes Fri 06 Aug 10 @ 3:37 am