The event that happens when a key on the keyboard gets lifted up after pressing it.
Questions tagged [keyup]
770 questions
7
votes
5 answers
Google Chrome change event in input is not fired if char added on keyup
$('input#not-gonna-work').bind({
keyup: function(){
console.log('Typed a key');
$(this).val($(this).val() + '.');// try with any other char
},
change: function(){
console.log('I\'m a changed input');
}
});
I…

Ivan Ivanic
- 2,982
- 1
- 20
- 21
7
votes
1 answer
Vue.js keyup events and v-model length on Android not working as expected
On Android the length of v-model is returning 0 on keyup unless its a number or the space bar key. Does anyone know why that is and how to make it fire the keyup event no matter what key it is and get the length? Here is a cleaned up version of what…

nunya
- 305
- 1
- 5
- 17
7
votes
3 answers
Trying to call the keyup function on ckeditor
I had a text area that has been replaced by ckeditor. I had some jquery to listen to the textarea input:
$('.formanswer').keyup(function () {
LimitText($(this), $(this).attr('data-maxlength'));
});
the limit text method just limits the text…

user2405469
- 1,953
- 2
- 22
- 43
7
votes
4 answers
7
votes
2 answers
jQuery: Getting new value in keydown handler
I came across this question: onKeyPress Vs. onKeyUp and onKeyDown, from where I found that keypress is supposed to fire whenever a character is typed into the text input. I am trying to run this following code. It is supposed to make the input's…

SexyBeast
- 7,913
- 28
- 108
- 196
7
votes
5 answers
jquery: percentage of two numbers
EDITED
Thank you for everyone who offered support... the best working script I will share with you in hope that I could help others who is looking for the same solution:
$(document).ready(function(){
$("#price1, #price2").keyup(function() {
…

Sergiu Costas
- 530
- 4
- 8
- 26
7
votes
2 answers
Combine keypress and keyup - jQuery
I'm trying to develop a jQuery plugin to do an action when the user enter a specific keyphrase.
For example, I want to match "HELLO" on keyup.
var controllerKey = [];
$(window).keyup(function(evt) {
var code = evt.keyCode ? evt.keyCode :…

Cyril F
- 1,842
- 2
- 19
- 35
6
votes
3 answers
Limit the number of characters in a WYSIWYG Editor (NicEdit)
I have this jQuery code:
var char = 60;
$("#counter").append("You have " + char + " char.");
$("#StatusEntry").keyup(function () {
if ($(this).val().length > char) {
$(this).val($(this).val().substr(0,…

Andrea Turri
- 6,480
- 7
- 37
- 63
6
votes
3 answers
crossbrowser keypress for special keys (arrows,...) in javascript
I am building a browser interface to a terminal. I need to catch both character (alphanumeric, dot, slash,...) and non-character key presses (arrows, F1-F12,...). Also, if the user holds some key down, it would be nice to get repeated keypresses…

johndodo
- 17,247
- 15
- 96
- 113
6
votes
2 answers
event.preventDefault() appears to not work for me within a contenteditable div
I have some simple Angular 7.x code that basically uses a contenteditable div where I am trying to prevent the default action when a user presses the [ENTER] key - the code appears fine but no matter what I seem to try it does the default action e.g…

Zabs
- 13,852
- 45
- 173
- 297
6
votes
3 answers
Angular Material 2 Autocomplete, mat-option element doesn't trigger keyup event
I am looking for a way to figure out when an mat-option inside the mat-autocomplete was either clicked or was selected using the enter key.
The click event binding works as expected but the keyup.enter or even just the keyup event doesn't work.
Is…

Praveen Puglia
- 5,577
- 5
- 34
- 68
6
votes
1 answer
Cordova Plugin for Passing keycode of a keyUp event to the App
I'm trying to create a cordova-plugin that will "listen" to any onKeyUp event, and will pass the keyCode to a callback function.
The purpose is detect ANY keystroke that comes from an external keyboard / barcode-scanner - any character (e.g.…

Oren Agiv
- 151
- 6
6
votes
5 answers
Jquery: filter input on keypress
I have a text field, which will accept only the following characters:
Allowed characters: [a-z 0-9 + # - .]
This is the same filter SO does in the 'Tags' field, when you're asking a question.
If the user types an invalid character, i want the…

Fernando
- 7,785
- 6
- 49
- 81
6
votes
4 answers
C# hold key in a game application
I'm trying to make a C# application, which is going to control a game. That I'm trying to do is for example: Hold key A for 150ms, Hold left arrow for 500ms and so on.
I was searching a lot and I found the following code. My program firstly target…

Deepsy
- 3,769
- 7
- 39
- 71
5
votes
2 answers
How should we handle keyboard events in WPF? Should it be KeyUp or KeyDown?
I have been using WPF with all the tunneling and bubbling events and I must say they are simply great and powerful.
But what I always question myself is whether to use the [PreviewKeyUp and KeyUp] or [PreviewKeyDown and Keydown]?
Which combination…

Gurucharan Balakuntla Maheshku
- 2,399
- 9
- 43
- 76