Media keys don't work on Windows
Hi, first of all thanks for your work on this. I've starting to mess a bit with Rust and was trying to simulate the MEDIA KEY PLAY/PAUSE press on Windows. I might be messing something up but this is the code I'm trying to use as an example:
use inputbot::{*};
fn main() {
KeybdKey::OtherKey(0xB3).press();
}
Running this code seems to cause the "g" key to be pressed instead of VK_MEDIA_PLAY_PAUSE.
I've noticed this behaviour on similar crates so this might be an issue of the windows api.
Thanks
@skkeeper I am not sure, but media keys may require for KEYEVENTF_EXTENDEDKEY to be specified as an additional flag in the KEYBDINPUT struct https://docs.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-keybdinput.
I am not sure how to best implement this in InputBot. I will take a deeper look.
Another thought is that on Windows InputBot currently uses scan codes instead of VK codes, so 0xB3 would probably not be the right code. Maybe we should switch from scan codes to the VK codes..
@obv-mikhail I have tried both scan codes and vk codes for the LAlt, as both decimal and hex numbers (number is 0x38 scan.) I cannot get OtherKey to work for anything, even keys that are already defined in the enum (passing in the usize manually). I notice LAlt exists on dev branch, but I am not contributing and will be using your actions branch.
I am on windows.
(Specifically the bind function).