Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

i.e. to not wait for the key to be fully pressed and released.

I know this method works in a game I play so I know it is technically possible.

share|improve this question
    
I appreciate the programming answers, but since this was super user I accepted the 'chrome can't do it' answer since I'm not willing to edit its source at the moment. –  leladax Nov 11 '11 at 13:54
add comment

3 Answers 3

up vote 1 down vote accepted

The games that you're talking about were programmed specifically to behave this way, Chrome is not.

Chrome is an open-source program however, so it would be possible to modify the source code and recompile it to behave the way you want, but it would take some advanced developer skills.

Here's where you can access the Chrome source code : http://www.chromium.org/Home

It would only be possible to enable this through a Chrome plugin, if Google had enabled such a feature already through the plugin API.

share|improve this answer
add comment

In Microsoft Windows, mouse button press is actually a start of three separate actions:

  1. Regular mouse click. Sequence is a "press-release"

  2. Double click. Sequence is "press-release-pause-press-release"

  3. Drag-and-drop. Sequence is "press-drag-release"

As you see, in order to recognize #2 and #3 above, Windows waits for the mouse button release and a short pause afterwards, before it sends "mouse was single-clicked" message to an application. Games that you mention, however, listen to the "mouse was pressed" message, which is sent immediately as a mouse button is pressed down.

Google Chrome must also support double click and drag-n-drop, therefore it cannot just assume that mouse press is a mouse single click. Thus what you ask for is probably impossible.

share|improve this answer
add comment

This is simple. Do not use the onclick event handler. Instead use addEventListener to attach a handler to the mousedown event. You do this in Javascript rather than mixing it in with the HTML code of a page.

To understand this better, read about fastbuttons here http://code.google.com/mobile/articles/fast_buttons.html

Essentially, people don't like that onclick events are only triggered 300ms after the mousedown event (i.e. mousedown mouseup, wait a bit) so they have come up with some Javascript code to replace the browser click with a faster one. By reading the page above, and the fastbutton code (which is not that long) you will get a clearer idea of how Javascript events (including clicks) actually work.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.