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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:00:09+00:00 2026-06-15T20:00:09+00:00

Is There any possible way to display only one character when a key is

  • 0

Is There any possible way to display only one character when a key is pressed DOWN for a longer period of time what I mean is when I press lets say ‘s’ DOWN for a longer period of time I want only ‘s’ displayed and I don’t want this to happen ‘ssssssssssssssssssssssssssssssssssssssss….’ .

And whit out using this method because this brings on the problem that if a user types fast and presses two keys at the same time only the second one will get displayed for example if I press down ‘k’ and press down whit out letting ‘k’ go the ‘p’ only the ‘p’ will get displayed.

var textarea='';

document.getElementById('textareaID').onkeydown=keydown;
document.getElementById('textareaID').onkeyup=keyup;

function keydown () {

this.value=textarea;

}

function keyup () {
textarea=this.value;
this.value=textarea;

}

And please do not say using counters because it doesn’t work for some reason believe me I have tried for the last 3 days.

http://toki-woki.net/lab/long-press/ this is what i am basically trying to do but I cant understand how the part where you hold the key down and only one is displayed out is done and of course if i press a key and while the key is down i press another one both of them get displayed rest is easy.

So i would love and explanation its driving me crazy.

  • 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-15T20:00:11+00:00Added an answer on June 15, 2026 at 8:00 pm

    Alright I think I got it.

    1: On keydown cancel the input to the textarea.

    2: On keyup put in the clicked letter.

    document.getElementById('textareaID').onkeydown=keydown;
    document.getElementById('textareaID').onkeyup=keyup;
    
    // keydown is run more than once if held down hence "ssssssss"
    function keydown (event) {
        // cancel input
    }
    // since the keyup event is only fired once we will do most of the work here
    function keyup (event) {
        // insert input
    }
    

    Here is the code (there are comments so you can see what’s going on):
    http://jsfiddle.net/NerfAnarchist/gXVuC/

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

Sidebar

Related Questions

Possible Duplicate: Create facebook tab for only my company page Is there any way
Is there any possible way to achieve this? For instance, I have an I/O
Is there any possible way of adding class and id attributes in form_dropdown of
Is there any possible way to edit this code <asp:LoginName ID=LoginName1 runat=server style=top: 165px;
Is there any possible way to PLAY a you tube video on page load
Is there any possible way to apply more than CSS to a control through
For a json data as below is there any possible way to construct a
Possible Duplicate: Overriding the power button in Android Is there any possible way I
I was wondering if there was any possible way to get the number (count)
Is there any way possible to find out the total number of sent emails

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.