Coder Social home page Coder Social logo

michel-pi / lowlevelinput.net Goto Github PK

View Code? Open in Web Editor NEW
46.0 6.0 11.0 146 KB

A thread safe and event driven LowLevelMouse and LowLevelKeyboard Hook

License: MIT License

C# 100.00%
mousehook keyboardhook input csharp hook mouse keyboard events

lowlevelinput.net's People

Contributors

calledude avatar michel-pi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

lowlevelinput.net's Issues

KeyState.Pressed doesn't work

Im trying to make a macro using this hook so it detects when the Left Mouse Button is pressed, but it never works

m_StartMacro = key == VirtualKeyCode.Lbutton && state == KeyState.Pressed;

I also tried to use the WaitForEvent option but it doesnt work either.

Possible to suppress keys?

This isn't so much an issue, and more of a feature request... would it be possible to implement a way to suppress a key from being sent with this method of hooking?

Option to not initialize mousehook in inputmanager.

I have a project where I don't care about mouse-hooking at all. I only listen to a select few keypresses and since InputManager has a nice subscription-system on a per-key-basis I use that. But debugging the program becomes a pain because the mouse-hook is installed no matter what and you can't disable it, the mouse is extremely sluggish as a result.
Are you still working on this project at all?

Suppress mouse input

Filtering works great, but I do need to suppress mouse input too. Sorry if it's a lot of work.

Filtering LButton

I've been messing around with mouse filtering today and I've found that it works perfectly for RButton, but does not seem to block LButton properly.

        WindowsHookFilter.Filter += LbuttonHandler;
        WindowsHookFilter.Filter += RbuttonHandler;

        private static bool LbuttonHandler(VirtualKeyCode key, KeyState state)
        {
            if (!Engine.ReadyToRun)
                return false;

            return key == VirtualKeyCode.Lbutton;
        }

        private static bool RbuttonHandler(VirtualKeyCode key, KeyState state)
        {
            if (!Engine.ReadyToRun)
                return false;

            return key == VirtualKeyCode.Rbutton;
        }

This code seems to work for RButton, but not LButton.

Question: Example of capturing combination keys

I was wondering if you had an example on how you can capture key combinations using this. (i.e. Ctrl-A). I couldn't find one in the example or if it is there I apologize I must of overlooked it.

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.