ianespana / ShawzinBot

Convert a MIDI input to a series of key presses for the Shawzin
MIT License
105 stars 26 forks source link

Program writes keys to window. #4

Closed lilggamegenius closed 5 years ago

lilggamegenius commented 5 years ago

Currently requires the user to manually focus the window before input is registered.

Signed-off-by: Gabe Gonzalez lilggamegenius@gmail.com

ianespana commented 5 years ago

I actually think manual focus isn't a bad thing to be honest. It'd be annoying if the script tried to focus the window every time. The only part that might break is scale changing, but we can get around that easily

ianespana commented 5 years ago

Interesting... Quick question, are you running Warframe in fullscreen or in windowed mode @lilggamegenius ? Just tried the window to foreground on my end and it worked without issues while running Warframe in windowed mode

lilggamegenius commented 5 years ago

That's odd, I was using windowed mode and i had to manually click to enable. I forgot to test if it does this in fullscreen mode or not. It might have been because i had my controller connected and i think it default to the controller when one is connected.

lilggamegenius commented 5 years ago

Also i forgot to mention, This is where I got the library to send key and mouse input.

ianespana commented 5 years ago

Alright, so, I've made huge progress and I have (almost) all the keys working now. I just need to figure out the input devices and we're good to release!

lilggamegenius commented 5 years ago

Seems like the standard library has support for Midi devices https://docs.microsoft.com/en-us/windows/uwp/audio-video-camera/midi This code should get the list of devices

    string midiInputQueryString = MidiInPort.GetDeviceSelector();
    DeviceInformationCollection midiInputDevices = await DeviceInformation.FindAllAsync(midiInputQueryString);
ianespana commented 5 years ago

I'm already getting the devices with the DryWetMidi library (https://github.com/melanchall/drywetmidi), but it doesn't give you any more data when an input happens other than telling you it happened...

ianespana commented 5 years ago

I'll push my changes so you can have a look as well