Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7801545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:58:57+00:00 2026-06-02T00:58:57+00:00

I know I can detect a single backspace keypress like this: $(#myelement).bind (keyup, function(event)

  • 0

I know I can detect a single backspace keypress like this:

$("#myelement").bind ("keyup", function(event) {
    if (event.keyCode==8) {
        alert ("Backspaced!!!");
    }
});

How would I detect double backspace that happens say within 1 second, just like double click?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T00:58:58+00:00Added an answer on June 2, 2026 at 12:58 am

    On jQuery.com itself, within their custom.js file, is a bit of code that might be helpful for you. It listens for the “konami” code in the users keystrokes. If it detects a certain sequence of keys, shown below in the variable konami, it responds.

    // Hehe.
    if (window.addEventListener) {
      var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65";
      window.addEventListener("keydown", function(e) {
        kkeys.push(e.keyCode);
        if (kkeys.toString().indexOf(konami) >= 0) 
          window.location = "http://ejohn.org/apps/hero/";
      }, true);
    }
    

    What this code doesn’t do is track the time between the last keypress, and our current keypress. But note, with a few slight modifications, we can mimic their code and produce the desired output that you want as well.

    <script>
      (function($){
        // Prep our variables
        var keys = [], lastEntry = 0, seq = '8,8';
        // Listen for keydown events
        $(document).keydown(function(e){
          // Push new key into keys array
          keys.push(e.which);
          // See if we need to respond
          if ( keys.toString().indexOf(seq) != -1 )
            if ( e.timeStamp - lastEntry <= 1000 )
              console.log( 'Correct keys, in the current time.' );
          // Update time of last keydown
          lastEntry = e.timeStamp;
        });
      })(jQuery);
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that richtextboxes can detect links (like http://www.yahoo.com ) but is there a
I would like to know a way can detect on how long the mouse
As you know an UIView can detect multi fingers. I just would like to
I would like to know how i can detect when an application is about
I would like to know how can I detect the press of a key
Does anyone know how can I detect the browser type in css? What I
Does anyone know how I can detect if the headphone jack on a device
Does anyone know if you can detect if headphones are plugged into the iPhone,
I know a simple URLConnection to google can detect if I am connected to
Is there a good way to detect deletes in Java? I know I can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.