Questions tagged [keyboard-events]

An event that is triggered when a Key is pressed on a keyboard input device

A KeyboardEvent is an event that is triggered when a Key is pressed on a keyboard input device. The event will contain information relating to the particular key that was pressed, how long the key was pressed for, and whether any modifier keys were also pressed (such as Ctrl or Alt).

2201 questions
15
votes
12 answers

How to find the key code for a specific key

What's the easiest way to find the keycode for a specific key press? Are there any good online tools that just capture any key event and show the code? I want to try and find the key codes for special keys on a mobile device with a web browser, so…
Acorn
  • 49,061
  • 27
  • 133
  • 172
15
votes
2 answers

fabric.js canvas listen for keyboard events?

In my fabric application, I'm currently listening for certain key presses such as the delete key, and deleting any selected elements. My method of listening for key presses is: document.onkeydown = function(e) { if (46 === e.keyCode) { // 46 is…
WhiteHotLoveTiger
  • 2,088
  • 3
  • 30
  • 41
15
votes
5 answers

How to detect in Javascript when the ALT key is pressed?

We are creating a web user interface that looks like a desktop window. Now we need to handle the Alt key. When Alt key is pressed the focus goes to the upper menu. In Javascript, how to get the event for Alt key when ONLY Alt key is pressed? I need…
Riera
  • 369
  • 1
  • 2
  • 12
14
votes
4 answers

Listening to keyboard events without trapping them?

I'm writing an command-line application which listens for Control key release events in X Windows and alerts another process when it detects them. Being new to GNU/Linux, I'd prefer avoiding to fumble with GCC and therefore I'm looking for a…
14
votes
2 answers

How to handle arrow key event in Cocoa app?

How to handle arrow key event in Cocoa app?
eonil
  • 83,476
  • 81
  • 317
  • 516
14
votes
3 answers

How to detect key presses in flutter without a RawKeyboardListener

I'm trying to detect key presses like "Enter", "Delete" and "Backspace" within flutter. My issue with using a RawKeyboardListener is that it takes focus away from any child widgets. For example RawKeyboardListener( focusNode: _focusNode, onKey:…
Lachlan
  • 415
  • 5
  • 12
14
votes
3 answers

Double Tap Button issue when keyBoard opens React native

I know there are already so many queries on this topic, I have tried every step but still won't be able to fix the issue. Here is the code : render() { const {sContainer, sSearchBar} = styles; if…
user2028
  • 163
  • 4
  • 15
  • 40
14
votes
4 answers

Vue v-model input change mobile chrome not work

If i open https://v2.vuejs.org/v2/guide/forms.html#Text and edit text - no effect on typing text in mobile chrome. @keyup @input @keypress - v-model does not change when I'm typing

Edited:…

ebyratu
  • 311
  • 1
  • 3
  • 13
14
votes
5 answers

How to get a combination of keys in c#

How can I capture Ctrl + Alt + K + P keys on a C# form? thanks
Ristovak
  • 491
  • 1
  • 5
  • 10
14
votes
4 answers

How to detect arrow keys using JavaScript on iPad with Bluetooth keyboard

I cannot find a way to detect arrow keys in a text field in Safari and Chrome on an iPad when a bluetooth keyboard is used. Using this test HTML and JavaScript, touch the input field to give it focus. Using the arrow keys nothing happens, but type…
Sean N.
  • 963
  • 2
  • 10
  • 23
14
votes
3 answers

Global keyboard hook with WH_KEYBOARD_LL and keybd_event (windows)

I am trying to write a simple global keyboard hook program to redirect some keys. For example, when the program is executed, I press 'a' on the keyboard, the program can disable it and simulate a 'b' click. I do not need a graphic ui, just a…
user1722361
  • 377
  • 1
  • 4
  • 14
14
votes
2 answers

Detect pressed modifier keys without triggering keyboard or mouse events

My app changes its state when a person holds modifier keys (Shift, Alt, Ctrl). I track modifier keys using keydown/keyup events: var altPressed; window.onkeydown = window.onkeyup = function(e) { altPressed = e.altKey; } Keyboard events don’t…
NVI
  • 14,907
  • 16
  • 65
  • 104
13
votes
3 answers

Close Modal Popup using Esc key on keyboard

I need to close the modal also using the "ESC" key, at the moment it is closing the "CLOSE" and "CONFIRM" button. i'm using reactstrap, react hooks. keyboard {show} and handleClose it didn't work. Here is the code: const DeleteUserModal = props =>…
13
votes
2 answers

Conflict when simultaneously using keyboard events for scrolling and CSS scroll snapping

You can horizontally scroll my demo page by pressing Space Bar, Page Up / Page Down and Left Arrow / Right Arrow keys. You can also snap scroll with a mouse or trackpad. But only one or the other works. Is there a way that keyboard events and CSS…
Tzar
  • 5,132
  • 4
  • 23
  • 57
13
votes
7 answers

Godot Keyboard Events

I am studying the Godot Engine and GDScript and I searched on the internet about keyboard events, but I didn't understand. Is there something in Godot like: on_key_down("keycode")?
user193464
  • 380
  • 1
  • 6
  • 25