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

  • Home
  • SEARCH
  • 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 7443387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:19:21+00:00 2026-05-29T11:19:21+00:00

I am quite new to javascript, but not to programing in general. What I

  • 0

I am quite new to javascript, but not to programing in general. What I attempt to do is have the page wait for the user to use a keyboard shortcut, and then proceed to open a popup. A few hours with confusing tutorials leads me to nothing. I’ll re-iterate, this is not asp or other such scripts, this is javascript that it should be written in.

I wish online code example would provide a full, working, ready-to-run source code file from which I can learn more from by looking at instead of text explanations and code snippets.

Keeping in mind my noobishness to this, could you explain what and how this would be done, or better yet, instead give the simplest possible working HTML+js example – a blank page that gives a popup when ctrl+3 is hit for instance. The latter would be far more effective (and probably easier for you than typing out a description) in me figuring this out.

NOTE: Im not trying to do anything complicated, just the basics

  • 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-05-29T11:19:22+00:00Added an answer on May 29, 2026 at 11:19 am

    Start with:

    window.onkeydown = function(e) {
        e = e || window.event;
        var k = e.keyCode || e.which;
        switch(k) {
            case ...:
                // do something
                return false;
        }
        return true;
    }
    

    Now add some cases. For example, to capture a space you would use case 32.

    You can also combine with modifier keys. For example, to capture Ctrl+Space:

    case 32:
        if( e.ctrlKey) {
            // do something
            return false;
        }
        return true;
    

    Keep adding shortcuts in this way, just be careful not to interfere too much with expected behaviour.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm quite new to javascript but have undertaken a task to get better aquainted
Dear experts, I am quite new to javascript and I often see coders use
Yo. I'm really quite new to this whole JavaScript business, not to mention AJAX,
Hi I am quite new to php but i have been following some tutorials
I'm quite new to javascript programming and got stuck in this problem: I have
I'm extremely new to jQuery, although not new to javascript in general. I'm trying
I have found adding inputs to a form is quite simple in Javascript, but
Heads up: I am quite new to Javascript and have so far only written
I'm quite new to Javascript and the GoogleMaps API.. I have a problem with
I'm quite new to php and have been reading Larry Ullman book to develop

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.