Git Product home page Git Product logo

hotkeys's Issues

Any hotkeys seem already occupied

No matter which hotkey combination I try, the Contructor throws me an exception that the hotkeys may already be occupied.

System.ApplicationException
  HResult=0x80131600
  Nachricht = An unexpected Error occured! (Hotkey may already be in use)
  Quelle = Hotkeys
  Stapelüberwachung:
   bei mrousavy.HotKey.RegisterHotKey()
   bei mrousavy.HotKey..ctor(ModifierKeys modifierKeys, Key key, IntPtr windowHandle, Action`1 onKeyAction)
   bei mrousavy.HotKey..ctor(ModifierKeys modifierKeys, Key key, Window window, Action`1 onKeyAction)
   bei WpfApp1.MainWindow..ctor() in C:\Users\Dominik\source\repos\UeliSharp\WpfApp1\MainWindow.xaml.cs: Zeile28

a bug(I do not know whether this is bug actually)

Recently I am exploring how to use this package(dll) with InputSimulator.
I found out that every time I use [new Hotkey ] to monitor hot keys, I have to add a Thread.sleep(100) to insure that the monitored hot key combo is released.
For example:
var key = new HotKey(
(ModifierKeys.Control | ModifierKeys.Alt),
Key.S,
this,
() => {
Inputsimulator...
Inputsimulator...
}
);
This will not generate correct result.
I have to write like this:
var key = new HotKey(
(ModifierKeys.Control | ModifierKeys.Alt),
Key.S,
this,
() => {
Thread.sleep(100)
Inputsimulator...
Inputsimulator...
}
);
This will get the correct result. (Only in this way can the shift+s get released before Inputsimulator is used.)

problems with delegate

I tried to add a function to the delegate of your example like this

delegate{
keybd_event(VK_LCONTROL, 0, KEYEVENTF_KEYDOWN, 0);
keybd_event(A, 0, KEYEVENTF_KEYDOWN, 0);
keybd_event(A, 0, KEYEVENTF_KEYUP, 0);
keybd_event(VK_LCONTROL, 0, KEYEVENTF_KEYUP, 0);
}

does not get correct result. why?

I did not use the messagebox in the example. Is that nescessary?

suggestion to author

You really should tell the users to add "using mrousavy" in their code...
This is my solution to my problem, but I nearly took an hour to find it out...

new problem

Hi i am using the example you provided and tried to invoke ctrl+w when i press ctrl+alt+s,but it turns out to be buggy...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.