it gives me 'VolumeUpNone' not found (pardon my french) :
System.ArgumentException
HResult=0x80070057
Message=La valeur demandée 'VolumeUpNone' est introuvable.
Source=mscorlib
Arborescence des appels de procédure :
à System.Enum.EnumResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument)
à System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)
à System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
à WK.Libraries.HotkeyListenerNS.HotkeyListener.Convert(String hotkey)
à WK.Libraries.HotkeyListenerNS.Helpers.HotkeyHandle.WndProc(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
à System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
à MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
à System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
à System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
à System.Windows.Application.RunDispatcher(Object ignore)
à System.Windows.Application.RunInternal(Window window)
à System.Windows.Application.Run(Window window)
à System.Windows.Application.Run()
à Volmatic.App.Main()
Here is the bit that I use :
volume_up = new Hotkey(System.Windows.Forms.Keys.VolumeUp);
The error happens only after I press the VolumeUp key.
I just found a workaround!
volume_up = new Hotkey(System.Windows.Forms.Keys.VolumeUp);
volume_up.KeyCode = System.Windows.Forms.Keys.VolumeUp;
Console.WriteLine(volume_up.KeyCode);
Modifying the keycode after creating the variable allows to remove the "None" that seems to be the problem.
edit :
Actually it does not work but gives VolumeUpVolumeUp
Doing this tho :
volume_up = new Hotkey(System.Windows.Forms.Keys.Control, System.Windows.Forms.Keys.F);
volume_up.KeyCode = System.Windows.Forms.Keys.VolumeUp;
Console.WriteLine(volume_up.KeyCode);
gives me "VolumeUp" but then the handling function does not capture anything.
I therefore do not have a valid workaround.