Keydown

"keydown" is an event used in writing software that is triggered when a key on the keyboard is being pressed

Keyup

The event that happens when a key on the keyboard gets lifted up after pressing it.



Better button multiple

Example

"If you insist to use keydown add e.preventdefault to prevent that event s default behavior;but i think kiirosora09 s answer that switch to keyup is better"

from question  

Make form visible on keydown event then focus and clear input field

"You could do something like this html js jquery there is a change event on jquery but it s only called when the input has lost it s focus so using a keydown keypressed or keyup is better"

from question  

Replacing input text with jQuery

"Listen keyup better timing than with keydown on the parent only it ll bubble up from the child elements"

from question  

Getting focus() inside a content editable div on tab

"They have their differences better stick to one i prefer for this example to use keydown just plays better with me you can use keyup"

from question  

Keydown event in drop down list

"Also using keydown is a better idea because if you keep holding the backspace button with keyup it wont delete it will delete just one character when you release the button"

from question  

JQuery: How to remove the last character from input pressing backspace?

"Edit keydown is a little better than keyup for the element bind now enter key fails silently-ish"

from question  

Prevent form submission on enter key

"Also note that keydown is better for this methodology as keyup will fire multiple times though i guess this will too."

from question  

Javascript move text between brackets in textarea

"Also if you notice i ve changed the keyup event to keydown which is better in my opinion cause when the user holds their finger down on a button the code wouldn t be fired if it is on the keyup event"

from question  

Detecting when a scrollbar appears on texarea

"Keyup is more preferable than keydown because keydown may occur multiple times if user keeps it pressed"

from question  

Which keycode for escape key with jQuery

"Btw keydown event is usually more reliable if for some reason keyup is one off on results keydown is probably better"

from question  

How to remove certain characters on keyup

Slower frequency sense

Example

"Also note that using keyup or input makes far more sense than keydown otherwise the previous value will only be evaluated on the next event occurrence"

from question  

InArray doesn't recognize this.value but recognize normal numbers

"This problem could be related to the speed of typing and event handlers that are attached to the input field these event handlers execute slower than input keyup keydown frequency"

from question  

TestCafe - Internet Explorer 11 on Windows 10 Input text issue

Events right field

Example

"Then the right events to do it is keyup more than keydown since the value isn t yet in the field at this moment or on change"

from question  

How to use value in input type number for calculate and set value in to other input?

"As you can see the keyup events of numpad5 and numpad6 occured earlier than their keydown event"

from question  

C# KeyUpEvent occurs before KeyDownEvent

Others

Example

Edit 3 in a comment below the linked solution from this stackoverflow question does not cover all the cases because the disable action prevent the keyup event to be triggered and - on the other side - the keydown event is to earlier because when the button is hit a new section is created obviously by another keydown handler somewhere else and no i cannot modify that handler directly

from question  

Disabling focused button does not move the focus to the next focusable item

Keydown will be triggered when key is pressed and keyup will be triggered after pressing the key;in your case keyup is more suitable

from question  

Getting new value of input field on keypressed

Keyup doesn t work because characters are rendered on keydown therefore keyup is too late;you can t have a keyup event without a keydown occurring first.

from question  

JQuery "keyup" vs "keydown" vs "keypress"

In my test keyup gives a smoother transition as compared to keydown

from question  

Silverlight Combobox Fire KeyDown event when combobox is open

The events seem to not follow strict sequential rules second keydown comes earlier than first keyup so the timer gets initialized multiple times

from question  

JavaScript timeout fires 3 times instead of once (clearTimeout is not working ?)

Back to Home
Data comes from Stack Exchange with CC-BY-SA-4.0