Giter Club home page Giter Club logo

Comments (6)

dmauro avatar dmauro commented on July 26, 2024

So the problem you are seeing is that when a user has selected a text field, you are calling stop_listening() on your listener, but when you type into the text field, your combos are being activated? Perhaps you are also immediately calling start_listening() as well. Do you have a code sample to demonstrate this issue?

from keypress.

98004702 avatar 98004702 commented on July 26, 2024

HI David,

$(document).ready(function() {

var listener = new window.keypress.Listener();

listener.sequence_combo("shift g o", function() {
    window.location.href = "app/view-orders";
});

$('input').bind("focus", listener.stop_listening)
.bind("blur", listener.listen);

});

from keypress.

98004702 avatar 98004702 commented on July 26, 2024

Whenever I place a console.log event in the stop_listening part of the code, I can see it's being fired but the actual listener event doesn't seem to stop.

from keypress.

Canardlaquay avatar Canardlaquay commented on July 26, 2024

It's better to use

$('input').focus(function(){console.log("got focus")}); 

now

Replacement for .bind("blur") is just blur(func)

from keypress.

dmauro avatar dmauro commented on July 26, 2024

The problem with your code sample is that you're calling stop_listening as if it were a function instead of a method. The value of this in that method is important. Try this:
$(input).bind("blur", function() { listener.stop_listening(); });
That should do it.

from keypress.

dmauro avatar dmauro commented on July 26, 2024

Just realized I made this mistake in my documentation :0
Sorry about that. Fixed: #80

from keypress.

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.