Giter Club home page Giter Club logo

hotstuff's People

Contributors

laquasicinque avatar mesqueeb avatar

Stargazers

 avatar  avatar

Forkers

mesqueeb

hotstuff's Issues

Generic key listeners don't behave as expected or consistently

Generic key listeners trigger fine on key down, but only listen to one key up event (as it's removed after the first key is released).

Not only this but events caused my key down events should probably affect the correct key up event (e.g triggering a keydown event for e and having it return false should make it so that when e is released, no key up function is called.

Window losing focus doesn't trigger key up events

At the moment, when the window loses focus, all active keys are marked as released (dropped from the array). It does not, however, trigger the events of all the keyups.

We do have access to all the handlers that need to be triggered, however for them to be triggered correctly we need to provide each handler a KeyboardEvent object.

This object needs to contain fake, simulated, but accurate data, for example

  • if the keydown event was listening to char a the key up event should also be for the character a
  • for multiple keypresses, such as ctrl-shift-a it should be one of the valid characters (perhaps the last one pressed (ie, the one that caused the trigger).
  • for hotkeys that have multiple bindings, it should be one of the valid characters for the hotkey binding that triggered it (e.g if a binding is bound to ctrl-r and alt-f, and was triggered by the former, only ctrl and f are the only acceptable values for the key up

Currently, the only way I can think of doing this is storing the keydown event and using it to make a simulated keyup event (if not using the same object and changing the timestamp and eventtype)

keyCode 93: select vs meta?

I'm not sure what is meant with the "select" keycode for 93.
On macOS using the right command key (⌘) triggers 93 but I think this is considered to be the meta key?

meta down/up bug

There's a bug with meta and down/up
→ when doing meta+down successively it works.
→ when doing meta+up successively it works.
→ when doing meta+down and afterwards meta+up it will start logging down+meta+up instead.
This further also breaks the recognition of the regular up key logging down after this bug has occurred.

"Loose" Key Binding

Add the ability to provide hotkeys that accept a generic structure. Something like ctrl-<key> would listen to any keypresses that consist of ctrl and a key

Hotstuff breaks on command + shift + something

This is my biggest hurdle with the library.

When I do eg. meta+up (command+up on mac) it listens once, and also on more strokes of the up-key, but once I let go the command key, hotstuff stops listening completely to anything.

I wasn't able to reproduce this on Codepen, so let me know if you want me to show in my app on my screen.

issue with , char

when I type the , char I get:

Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
at HotStuff.handleKeyDown
Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
at HotStuff.handleKeyUp

from lines:

            // perhaps refactor;
            var key = (e.which && e.keyCode ? KEYCODE_ALIAS_MAP[e.which || e.keyCode] : e.key).toLowerCase();

google chrome

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.