Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Key Combination Triggered inside of assignment method #141

Open
ghost opened this issue Feb 12, 2021 · 0 comments
Open

Key Combination Triggered inside of assignment method #141

ghost opened this issue Feb 12, 2021 · 0 comments

Comments

@ghost
Copy link

ghost commented Feb 12, 2021

from article:
https://github.com/gmamaladze/globalmousekeyhook/blob/vNext/keycomb.md

Example:

        //1. Define key combinations (we're going to use Ctrl+Q)
        var pasteAddress = Combination.FromString("Control+Q");

        //2. Define actions
        Action actionPasteAddress = PasteAddressInWindow;

        //3. Assign actions to key combinations
        var assignment = new Dictionary<Combination, Action>
        {
            {pasteAddress, actionPasteAddress}
        };

        //4. Install listener
        Hook.AppEvents().OnCombination(assignment);


    void PasteAddressInWindow()
    {
        SendKeys.SendWait("Q");

    }

So when SendKeys.SendWait("Q"); is called, the software still thinks CONTROL is being held at this point. Im not sure why. This triggers an endless loop.

After I terminate the program, Windows thinks I still have CONTROL held in, so I have to restart my system for it to reset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants