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
20
votes
4 answers

Detecting the user pressing F10 in WPF

My WPF application has behaviour triggered by the functions keys (F1-F12). My code is along these lines: private void Window_KeyDown(object sender, KeyEventArgs e) { switch (e.Key) { case Key.F1: ... case Key.F2: …
teedyay
  • 23,293
  • 19
  • 66
  • 73
19
votes
7 answers

How to listen for keyboard open/close in Javascript/Sencha?

I have a HTML5/Javascript (Sencha) app that I have packed into PhoneGap for iOS in XCode. One way or another, I want to be able to listen for the keyboard open/close events and do something accordingly. Is there any way to do this?
Groppe
  • 3,819
  • 12
  • 44
  • 68
19
votes
6 answers

Detect Ctrl + C and Ctrl + V in an input from browsers

I am using the direct following and I do not detect the copy and paste with the keys inside the input, would someone know how? Thank you! export class OnlyNumberDirective { // Allow decimal numbers. The \, is only allowed once to occur …
Mario Ramos García
  • 755
  • 3
  • 8
  • 20
18
votes
3 answers

Need to intercept HID Keyboard events (and then block them)

I've got a RFID USB device that registers as a HID device (A USB Keyboard more or less). I'm looking for a way to capture this input, and block/filter it before it hits the normal keyboard event handler (and outputs the 10 digit RFID code to the…
Litch
  • 686
  • 1
  • 7
  • 17
18
votes
2 answers

Detect keydown?

I would like to detect a keydown event in Rust and then check if a combination of keys is pressed, in order to do further actions based on that. So basically support keyboard shortcuts in my Rust application. I've looked at some crates for example…
frankenapps
  • 5,800
  • 6
  • 28
  • 69
18
votes
3 answers

Javascript, key press value is always one character behind the latest?

If I type 'St', by the time I press the t, if I output the input of textfield.value in the onkeypress/onkeydown functions, I only get 'S'. Why is this? How do I get rid of this lag?
Tom
  • 215
  • 1
  • 2
  • 5
18
votes
2 answers

Page-global keyboard events in Windows Store Apps

I'm working on a game, a Windows Store App based on WPF and written in C#. When the player presses the Esc key, I want to pause the game and show a menu (Continue, Quit etc.). Sounds simple. Sadly, it's not. The game takes place in a…
Sebastian Negraszus
  • 11,915
  • 7
  • 43
  • 70
18
votes
4 answers

How to prevent number input on keydown?

I want to prevent number input on keydown event on textfield and run custom handler function. Here are the issues e.target.value is useless since the key value is not projected into the target value yet e.keyCode for number depends on keyboard…
Jan Turoň
  • 31,451
  • 23
  • 125
  • 169
17
votes
4 answers

How to capture enter key being pressed on pages containing multiple forms?

I have inherited a web application where the usual ability to press return in any of the input fields has been disabled for the very good reason that the page contains multiple forms, and the application would not be able to determine (or, so I am…
MysticBrook
17
votes
2 answers

How do I listen to keyboard input in React Native

I have a Honeywell Scanner that outputs text when scanning bar codes. I can use it as a "keyboard" for text inputs, which comes in very handy because I don't have to interface anything. But it has the downside of having to focus an input and thus…
Lucas Bernardo
  • 519
  • 1
  • 4
  • 13
17
votes
2 answers

change keyboard layout with javascript

I have a html form. Users can fill in the form in both english and persian languages. but I have a captcha input that users should fill it in english. If the user's keyboard layout is persian what is typed in this field should change to english so…
hd.
  • 17,596
  • 46
  • 115
  • 165
16
votes
2 answers

How do I move a Three JS cube with keyboard input?

The following code is what I have written so far using three js to try to move or translate a rotating cube object up, down, left, and right with the WASD keys, and reset to the original position (middle of the screen) with the space bar. I am very…
Teej
  • 229
  • 2
  • 4
  • 12
16
votes
2 answers

How do I create a standalone exe with AutoHotkey?

I have created a script to remap the Windows Button to right-mouseclick. How can I create an executable AutoHotkey file that I can offer for download, that automatically runs only that script?
rubo77
  • 19,527
  • 31
  • 134
  • 226
15
votes
1 answer

Catching event when following a link

I am trying to track clicks on an external link (without using a "redirect page"). How can I capture an event when a user follows a link, regardless of whether the user: Left clicks on the link Right clicks on the link and open it in a new…
Martin Poulsen
  • 422
  • 4
  • 13
15
votes
7 answers

Check if a Key is Down with Qt

I am playing around with some graphics, and I have implemented simple camera movement with the arrow keys. My first approach was to override keyPressEvent to do something like this: switch(key) { case up: MoveCameraForward(step); break; case…
Armen Tsirunyan
  • 130,161
  • 59
  • 324
  • 434