This event is triggered when when the user is pressing a key or holding down a key.
Questions tagged [onkeydown]
520 questions
0
votes
1 answer
How to go back to original Sub Procedure from Key Down Event (VB.NET)
I am trying to reference the KeyDown event from a independent sub procedure and have it loop back into original independent sub procedure.
Starts off in Independent sub procedure (DisplayAction - which then calls KeyDown Event)
Goes into KeyDown…

user1333792
- 11
- 1
- 4
0
votes
1 answer
android: pause (close) app so that it is re-opened on the same state
I have an app that records some data (time, user’s gps position etc). Now I want to implement this: when user presses back I pop an alertdialog with two options to “pause” or “exit”. I can do that overriding the onKeyDown method. Now “exit” should…

george
- 1,386
- 5
- 22
- 38
-1
votes
1 answer
Limit keydown execution only to specific div
I want to limit execution with hit enter only to specific div, not on whole page so that this enter key not impact to divs outside this #targer-wrapper but code below with checking div length didn't works:
if ($('#targer-wrapper').length) {
…

alench
- 53
- 6
-1
votes
2 answers
How to kill application onBackpress?
Does anyone know how to kill application after onBackpress on Android ? I using this code to close my application.
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (Integer.parseInt(android.os.Build.VERSION.SDK) <…

Riken
- 47
- 8
-1
votes
2 answers
how to detect keypress/keydown for special characters?
I need to trigger a javascript event on keypress. so when a use types ')' it triggers an event.
I'm unable to find out keyCode for this.
Any help please?

Sab
- 13
- 1
- 5
-1
votes
1 answer
How to implement onKeyDown in Fragment
I change all my activitys to Fragment. I got stuck in the onkeydown part.
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (!sector.getText().toString().equals("Sector") && (media.isChecked() || completa.isChecked())) {
…

Mustafa Essousy
- 31
- 2
- 5
-1
votes
1 answer
Set numeric only for text-field in ASP onKeyDown
This solution works perfectly in all browsers and this is very easy use.
This is work without Numpad.
onkeydown = "return (!(event.keyCode>=65) && event.keyCode!=32);"
This is work with Numpad.
onkeydown = "return (!((event.keyCode>=65 &&…

Lahiru Supunchandra
- 358
- 1
- 9
-1
votes
1 answer
trigger event with spacebar keydown for set duration
I have an animation that should start on keydown for a set duration (3s or so).
Wondering if I can bind the animation function to jquery keydown but how can I add the duration to that or if there is another jquery plugin that can handle this?
The…

njpatten
- 165
- 1
- 3
- 15
-1
votes
1 answer
What is the equivalent for onkeydown and onkeyup (Javascript events) in python?
There are events called 'onkeydown' and 'onkeyup' in Javascript. Can anyone please suggest the python equivalent of it?

Steve
- 381
- 1
- 6
- 16
-1
votes
2 answers
How to fire event onkeydown after entering at least 3 characters?
how to fire event onkeydown after entering at least 3 characters?
i will enter they in autocomplete, and after 3 characters calling function "autoload()" .
maybe I need some other…

r.r
- 7,023
- 28
- 87
- 129
-1
votes
1 answer
Activate a Javascript function with a keypress
function addone()
{
document.getElementById("subtract").disabled=false;
x += 1;
document.getElementById("result").innerHTML="Doshi has said OK " + x + " times."
if(x == 1 ){
…

muzzledog
- 15
- 1
- 1
- 3
-1
votes
1 answer
I want to initiate my activity anytime using Volume up/down hardware button is this possible using services?
I want to initiate my activity anytime using Volume up/down hardware button.
I tried in some links but no use.
And also i want to know how to use service for this.
Thanks in advance..

user1367295
- 13
- 3
-1
votes
1 answer
Android nullPointerException error
Eclipse finds no errors in my code, but when I try to run the app on an emulator, it opens and then immediately crashes. Logcat gives me the vague nullPointerException error. I can comment out the onKeyDown method, and then it runs just fine. But…

Blackhawk497
- 21
- 1
-1
votes
1 answer
A thread with a dialog is listening the back key, but i want that the main activity listen the back key
I'm launching a thread that shows a dialog, and if i press the back key (to do some logic to stop the thread), the onKeyDown listener of the activity is not being called. It is because it is being catched by the thread with the dialog... How can i…

Pableras84
- 1,195
- 5
- 18
- 30
-2
votes
2 answers
Disable onKeyDown for a ListView?
How can I disable onKeyDown of a listView? I want the onKeyDown of the activity to handle the keyEvent and only the keyEvent. Thanks.

Vervatovskis
- 2,277
- 5
- 29
- 46