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.

Filter by
Sorted by
Tagged with
0 votes
1 answer
35 views

Example for scancode vs virtual scancode vs keycode vs virtual keycode vs virtual key

I have problems figuring out the the difference between scancode, virtual scancode, keycode, virtual keycode, virtual key: I know that virtual Key (or virtual keycode ??) is a pressed modifier (Ctrl, ...
  • 1,365
0 votes
2 answers
62 views

What can i use instead of event which is deprecated?

i need to move the element by the arrows (arrowUp arrowDown and so on)but event key/keyCode is deprecated. So what can i use instead of them?
4 votes
2 answers
95 views

Encoding of key codes (virtual?) send to virtualbox-guest-system

How to send a string to a virtualbox-guest-machine? This is my code: public void testKeyboard() throws Exception { IVirtualBox b = connect(); List<IMachine> machines = b.getMachines(); ...
  • 3,152
-1 votes
1 answer
51 views

ɔ̃ does not exist in JavaScript

I was doing a simple program in JS to get a list of keyCodes for all french phoneme symbols in the International Phonetic Alphabet, and I realised that key like ɔ̃ are actually considered as ɔ and ~. ...
  • 1
1 vote
1 answer
63 views

Cypress - how to draw a line using cypress while holding option key on a text file

I need to draw a line using one application tool. I tried code below, it is not working. So basically I need to click on a word while holding option key and then click on another word, it will create ...
  • 11
-1 votes
1 answer
39 views

Jquery: Use preventDefault() to disable only the space bar

I'd like to use the function preventDefault() to disable the spacebar from jump-scrolling down, like it usually does in Chrome, for example. If I try this: $('html').keydown(function(e){ if(e.keyCode ...
0 votes
0 answers
22 views

Next page "spacebar button" press

I need the JavaScript to go to 'pag2' when I press spacebar, but it does nothing, there isn't anything on 'pag1' or 'pag2' (the files) ` document.body.onkeyup = function(e) { if (e.key == " &...
1 vote
1 answer
36 views

Javascript movement delay on initial keypress (3D)

I want the movement to be smooth upon pressing a key, the object does an initial movement and then starts moving completely when holding down the button. //movement speed var xSpeed = 0.5; var zSpeed ...
  • 13
0 votes
0 answers
30 views

Java: How to type non english letters, like "ä", with robot?

I am writing a java program that can type german words and these contain letters like "ä", "ö" and "ü" and I need my robot to type them as well. I am not able to use &...
0 votes
0 answers
17 views

Javascript using regexp instead of keyCodes to capture Android soft keyboard characters?

I know Android, and many users, say not to use $event.keyCode || $event.charCode because the returned characters can't be trusted. And its true, it can't. But what about using a regexp to test for ...
  • 2,649
1 vote
0 answers
319 views

Javascript, Android and Chrome in industrial devices: enter key not firing event keyup and keydown in input text fields

Recently I updated the Chrome to version 106 in some industrial devices working with Android. These devices works with web pages developed with PHP and Javascript routines. Now I show you the problem ...
  • 11
0 votes
2 answers
128 views

Unity: allowing keycodes to shift with a variable

I'm currently making a purposefully frustrated mini-game where the movement keys change each time you use them. I intended to do this with the code bellow. public class Flop : MonoBehaviour { ...
0 votes
0 answers
70 views

The escape key does not work the same way in all browsers

With the following code I can scroll back and forth in my picture gallery with the arrow keys. I would like to be able to use Escape to end the display of the images - but this only works in Chrome ...
  • 1
0 votes
0 answers
42 views

KDGKBENT returns wrong keysym values?

Example code: #include <stdio.h> #include <stdlib.h> #include <linux/keyboard.h> #include <sys/ioctl.h> #include <sys/kd.h> int main(int argc, char **argv) { struct ...
  • 101
0 votes
0 answers
33 views

Direction mistake in a snake game

I'm want to make a small snake game, but it doesn't work with the direction changes. No matter on which button I pushed, the snake doesn't change his direction. What's the problem? There is the code ...
0 votes
0 answers
77 views

Convert WinForms KeyCode to USB-HID-KeyCode

I built a circuit with Arduino Micro that sends Keyboard inputs to my Laptop. With a program on my Laptop I want to define what keyboard inputs should be simulated. To do that I try to record keycodes ...
  • 15
0 votes
1 answer
51 views

The keys won't remove transition after clicked

I think the problem could be with the const audio = document.querySelector(audio[data-key="${e.keyCode}"]); const key = document.querySelector(.key[data-key="${e.keyCode}"]); It ...
2 votes
0 answers
22 views

keyCode not working, geting scratch on keyCode on using document.onkeyup or onkeydown, scratch will go when i use document.onclick, but i want onkeyup

document.onkeyup = function(e){ console.log("Key code is:",e.keyCode) if(e.keyCode == 38){ dino=document.querySelector('.dino'); dino.classList.add('animateDino'); setTimeout(()=&...
0 votes
1 answer
36 views

Swift - keycode keyboardReturn not working

I have hotkeys on my app when using a physical keyboard and all the keys work fine except for the return key. Is there a reason why or a workaround to make this work? Thanks. extension ...
  • 3,765
0 votes
2 answers
914 views

Unity C# GetKey() not working when i set a variable with the button i want pressed in

Im trying to make it so that you can assign whatever key you want to make the player jump/move via unity itself and not the script. I want to set public variables with the keycodes of each key and use ...
  • 59
1 vote
2 answers
307 views

P5.js SOME Keycodes not responding

I've been surfing through a lot of old P5.js questions and ran into this question: p5.js code isnt executing when spacebar is pressed in combiniation with up and left I tried out a few of my ideas in ...
  • 382
0 votes
0 answers
30 views

Incorrect Keypress keyCodes when using Google Japanese IME

I have a Chrome Extension that opens a popup window when a shortcut is pressed. The popup window has an keypress event listener that looks at event.keyCode. I noticed that when I use Google Japanese ...
0 votes
0 answers
99 views

What do I replace KeyCode with

Im unsure how to replace e.keycode? should it be KeyBoardevent? document.body.addEventListener("keyup", function(e){ keys[e.keyCode] = false;
0 votes
0 answers
33 views

Tkinter event.keycode is not working properly

from tkinter import* from tkinter import messagebox def key1(event): print(event.keycode) messagebox.showinfo("event","k: "+chr(event.keycode)) window=Tk() window.bind(&...
1 vote
0 answers
83 views

Creating a KeyEventArgs field with the desired KeyCode value in C#

I wanna make an opportunity to rebind some buttons. I have "launchParametrs.txt" file so the KeyEventArgs field must get KeyCode from "Start: (bind button from file)". But I can't ...
  • 11
0 votes
1 answer
516 views

Angular: How can I prevent the scrollbar from moving when navigating with the arrow keys up and down?

I have developed a table and which I have integrated a self-created navigation. Problem is, when I scroll up and down so always moves the scrollbar with. Is there a way when I press keydown or keyup ...
user avatar
-2 votes
1 answer
208 views

Activate button by Pressing Enter in Texbox

Im new here in Coding and im Trying to activate my button from a Textbox by pressing enter. I tried to google for the Answer but Visual Studios say it doesnt work. The most common Thing i read while ...
  • 3
-1 votes
1 answer
118 views

How do I allow my program to detect keyCode without getting a type-error in Javascript?

I am fairly new to coding and I have been constantly been coming upon one problem. When making a game, such as snake or pong, I tend to use an event listener to listen for a keydown event such as : ...
-1 votes
1 answer
98 views

How do I get Input to read other keys and not just Up and Down

I saw some codes like this: if (Input.GetKey(KeyCode.UpArrow)) and if (Input.GetKey(KeyCode.UpArrow)) Wanted to know how do I put other keys, as in the case of the "a" if (Input.GetKey(...
0 votes
1 answer
233 views

How does 4 byte scancode get mapped to keycodes in Linux?

I was messing around with scancodes and keycodes in Debian Buster and I've found something strange. Using sudo showkey -s I discovered that the scancode of the PrintScreen/SysRq key of my USB wired ...
-1 votes
1 answer
36 views

How can I access the result of this function on this other function?

So i have this text input field and I have the showKeyCode() function which gets the value from the text input and prints the keycode representation of the pressed key into the console. function ...
  • 68
0 votes
1 answer
49 views

I want to alert a value when I press the Esc button in prompt, but I have no idea... (code below)

const login = prompt("Enter username!", ""); if (login === "Admin") { prompt("Enter password!"); } else if (login === "" || login.keyCode === 27) { alert("Canceled"); } else { alert("I don't ...
0 votes
1 answer
264 views

Vanilla Javascript: How do I create a working searchbar with hidden results?

I am pretty new to Javascript and have been using it for almost a month. I am trying to create a website easter egg that can be found by typing a hidden word into the searchbar. My problem mostly has ...
  • 3
0 votes
2 answers
50 views

How can i get the character of a key code

I have some code which captures a key. Now i have in event.code the real key-name and in event.key i get the key-char. To make an example: I press SHIFT and J, so i get: event.code: SHIFT KEYJ event....
-5 votes
2 answers
342 views

how do I extend virtual key codes in the windows API (Win32)?

I want to create a new virtual key code in the windows API that I can assign scan codes to and read with GetKeyState but I cannot find a way to extend the enumeration. I have tried using "unknown&...
  • 112
1 vote
1 answer
159 views

Convert libgdx int keycode to non-QWERTY char

I've got a bunch of code set up that uses InputListener.keyDown to test keys pressed, and uses those keycodes to display keystroke hints. However, on non-QWERTY keyboard layouts (like Dvorak or ...
1 vote
1 answer
79 views

Virtual keycode for key 2 (small, just on top of tab key)

I'm looking for a way to be able to capture the key shown in the photo below: On a French keyboard, it's the key that only has the character 2 (small). Key 2 I first tried to use the Esc key but it ...
1 vote
2 answers
252 views

Unity 2D Object not Moving while using GetKey and tranform.position

Got a problem with my code (on Unity 2D). I'm trying to make a PacMan like for my class, and my PacMan doesn't want to move at all. He's animated but he's not moving. public class PacmanMove : ...
  • 417
1 vote
2 answers
723 views

How to map an Android keycode to a Unity keycode?

I am trying to get the touchpad of the Vizux M400 to work in Unity. The Vuzix runs on Android and I know that for example a touchpad swipe forward is handled with the android keycode ...
  • 89
-2 votes
3 answers
601 views

JavaScript: What should keyCode be replaced with?

this is the js code: document.addEventListener('keyup', function (e) { e.preventDefault(); if (e.keyCode === 191) { document.getElementById('search-input').focus() } }) but in ...
user avatar
0 votes
1 answer
66 views

How to get the hotkey definition if a shortcut is pressed?

For example, if I press Ctrl+Shift+Alt+C in this order, how I do get the corresponding hotkey definition? I expect something like the following: ; pseudo code *::MsgBox %A_ThisHotkey% was pressed
  • 7,703
1 vote
1 answer
627 views

Ctrl, Alt, Cmd and Shift key not recognized on mac (Unity 3D)

I am exporting a windows game on mac using unity 3D and I am encountering some issues with the key binding: CTRL, ALT, CMD and SHIFT key are not recognized at all (no errors). I used the following ...
0 votes
2 answers
523 views

How can I jump to the next row when I navigate with keyCode on the right?

I have a table with three columns. In the first column is text and in the second and third are input fields. Within the row I can navigate with keyCode to the right, but when I reach the last column ...
user avatar
1 vote
2 answers
317 views

How can I set an automatic focus in the input for a keyCode navigation?

I have written a table and in it all contain input fields. For this template I have developed a keyCode navigation. A navigation up, down, left and right is possible. What do I have to add to my code ...
user avatar
0 votes
1 answer
120 views

Javascript keyboard event keys aren't accurate with my keyboard layout

here is my issue: I want to know which key got typed whenever I type something on a page and window.addEventListener("keydown", function(event) { console.log(event.key); }); works fine ...
  • 37
1 vote
0 answers
405 views

AppleScript Key code Application isn't running (-600)

I am having a problem with running key code 123 (Left Arrow). Whenever I try to run it, it works fine for few times then I get System Events got an error: Application isn't running (-600), and it ...
  • 21
1 vote
1 answer
156 views

How to reset a custom dropdown to display the menu after escape event attached?

I have a custom dropdown menu. I've been able to handle most of the accessibility except for one area. When the menu is open and I hit the escape key, I'm unable bring that menu back if I navigate ...
  • 2,915
1 vote
1 answer
180 views

How to handle alt+p keyboardEvent on macOS browsers

I'ld like to listen the following keyboardEvent : alt + p if (event.altKey && event.key === "p") { doThis(stuff) } Problem is that in OSX (alt+p) === "π" so I wrote ...
  • 11
1 vote
1 answer
98 views

how to define event for keyPressed/keyCode...?

A freshman here that's stuck and confused on an assignment.. I'm surely doing it wrong because I get error on keyPressed as event is not define, with the code below. How do I define event in this ...
  • 13
2 votes
2 answers
1k views

What physical key maps to keycode 108 (VK_SEPARATOR)?

Virtual Keycode 108 (VK_SEPARATOR 0x6c) is defined as the "Separator" key. My UK keyboard doesn't have this physical key. It has two "/" keys but these are mapped to VK_OEM_2 0xBF ...

1
2 3 4 5
17