Questions tagged [keycode]

A number linked with specific key on keyboard in many languages. May be different for one key depending on browser or platform. Use this tag for questions about the keycode property in a language.

Many languages associate different keys on the keyboard with different numbers, called "keycodes". The keycode is not to be confused with the ASCII character code, though there are some similarities. For example, JavaScript interprets an A keypress as 65 (ASCII code for capital "A") whether or not the Shift key was pressed or Caps Lock was enabled.

For more information about the JavaScript property, see

For more information about the C# KeyEventArgs.KeyCode property, see the Microsoft documentation.

839 questions
-1
votes
1 answer

How to detect if the keycode_numpad_dot is clicked in Android?

I'm a newbie on this language. I am struggling on this problem detecting if the keycode_numpad_dot is clicked.
-1
votes
1 answer

Javascript e event resetting for Canvas Game

I'm currently building a Tron canvas game based on this code. it works kinda good, but if I restart the game, two values are getting passed via e.which. Try to show main code: function loadGame() { var e; …
Standard
  • 1,450
  • 17
  • 35
-1
votes
1 answer

Trouble with KeyEvent and KeyStroke

I noticed that I get two different keyCode for the same Char. Here is a little experiment: package main; import com.sun.javafx.scene.control.Keystroke; import javax.swing.*; import java.awt.event.KeyEvent; import…
Synoon
  • 2,297
  • 4
  • 22
  • 37
-1
votes
1 answer

Detect if the value of keyCode equals an item in an array

I am building a small typewriter app and I have a problem with detecting whether a pressed button corresponds to the value of a span elements. Basically, I have two divs, which contain spans with different letters for values. I have the spans stored…
Georgi B. Nikolov
  • 976
  • 2
  • 13
  • 24
-1
votes
2 answers

Toggle pause with key in HTML5 game

I want to make a function for a html5 game to pause and unpause with the keyboard key p. I can get the game to pause while pressing p, but not to unpause while pressing p again. What am I doing wrong here? document.addEventListener('keydown',…
Justin
  • 73
  • 1
  • 12
-1
votes
4 answers

How Processing knows that user is pressing multiple key at the same time?

I have no idea how Processing knows that a user is pressing Ctrl and some character at the same time. Multiple buttons at same time only. Is it possible? ex: (Ctrl+r).
2Divide3
  • 75
  • 1
  • 7
-1
votes
3 answers

enter key pressed call javascript function

I have an asp:TextBox on my page and I would like to detect the enter key to call a javascript function. This is what I have: Codebehind txtSearch.Attributes.Add("OnKeyPress", "ProcessKeyPressed()") aspx page function ProcessKeyPressed() { if…
user1839862
  • 13
  • 1
  • 4
-1
votes
1 answer

Backspace/Delete not working in Jquery alphanumeric validation

Backspace/Delete not working in Mozilla Firefox for Jquery alphanumeric validation . $("#myTextBox").bind("keypress", function(event) { var charCode = event.which; var keyChar =…
Sush
  • 87
  • 1
  • 9
-2
votes
1 answer

Key code value send jquery

Everything is going fine jst a little bit mistake only when i press enter it will send the value througn $.post(). after success the page refreshes why so and if i use some other keycode it will remain same value inserted but no refresh