Giter Site home page Giter Site logo

Comments (4)

pkamb avatar pkamb commented on August 21, 2024

Good idea. We do get the Key Up / Key Down events for the Power Key. And there is a small window where the system power key behavior does not activate, to reduce accidental presses.

PowerKey could be changed to only activate the replacement keystroke if the measured delay between key up / key down is less than the system's power key delay.

Before Implementing I'd like to find the exact millisecond delay used by the system. Does anyone know?

from powerkey.

bezenson avatar bezenson commented on August 21, 2024

I can only assume, that there is 1000ms delay before laptop goes to sleep mode.

from powerkey.

pkamb avatar pkamb commented on August 21, 2024

Through a bit of testing it looks like 0.35 seconds is our magic number.

Testing in OS X 10.11.1 shows: a power key Key Up > Key Down timeframe of 0.342775 seconds no-ops. A press of 0.366125 causes the screen to go black.

from powerkey.

pkamb avatar pkamb commented on August 21, 2024

In the new version of PowerKey I've enabled modifier keys to work alongside the power key, and that will cause some issues with this proposed "key up" behavior. When modifier keys are held, the system does not send the "key up / key down" event pair that is needed for this to work.

So we have no choice but to send the event on key down when using modifier keys. Inputing the character on key down also feels more natural.

Due to the above I'm going to close this issue, but thanks for the suggestion. If you'd like you could enable it on your copy of the app by changing the place in which the replacement key is inputted.

from powerkey.

Related Issues (20)

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.