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 8113169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:44:31+00:00 2026-06-06T02:44:31+00:00

OK, I know how to detect keyboard input. I know how to focus on

  • 0

OK, I know how to detect keyboard input. I know how to focus on keyboard input.

But I want to know what the best practice is for detecting keyboard input => focusing to textarea or textfield => AND enter that key into the field.

Here’s how it would work: I’m on a page. I type A. Then my textfield gets focused and A is typed into the field. This sounds trivial but actually I haven’t found a simple way to do this. The reason is because the initial keyboard input event is not directed towards the textfield, and I need to propagate that event to the newly focused text field.

Is there a conventional approach to doing something like this?

  • 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-06T02:44:32+00:00Added an answer on June 6, 2026 at 2:44 am

    Sample html:

    <form>
    <input type="text" />
    <input type="text" id="thisguy" />
    <input type="text" />
    <input type="text" />
    </form>​​​
    

    jQuery for above html

    $(document).live('keypress', function (e) {
    
    $('#thisguy').val($('#thisguy').val() + String.fromCharCode(e.which));
    });​
    

    Needs to be cleaned up. Maybe set focus instead of changing the text value.

    • 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 already know how to detect VMWare and VirtualPC, but I want to know
Does anyone know how to detect in a OnBeforeUnload event that the server side
I know how to detect device orientation change on iOS in Safari, but I
I know I can detect flash gaining and losing focus with these callbacks: stg.addEventListener(
I want to know how to detect GPS HardWare in present in Iphone or
I want to detect and block certain keyboard shortcuts on a web page. For
I want to know how to detect the running OS using the C++ and
G'day all, After learning on here that the Java console doesn't support keyboard input
I am pretty new to programming and I want to know how to detect

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.