Questions tagged [keyevent]

An event that is triggered when a key is pressed,released or remains pressed on a keyboard input device.

A KeyEvent is an event that is triggered when a key is pressed, released or remains pressed on a keyboard input device. The event can contain:

  • info about particular key that was pressed/released
  • how long the key was pressed
  • whether any modifier keys were also pressed (such as Ctrl or Alt).
  • type of event - press, release, other (for example character was typed, regardless whether key was pressed or released)

Some platforms/keyboards may generate auto-repeat key events - same character is typed repeatedly while key remain pressed

1258 questions
5
votes
2 answers

Stop Win+R from opening run tool

In my javafx program is a popup which lets user press keys and then it sets label accordingly. My problem is with key combinations that are shortcuts for underlying OS for example if user presses Win+R then Run.exe starts but my program should just…
griips21
  • 125
  • 1
  • 6
5
votes
1 answer

vue 2 trigger computed with chinese input issue

I'm using vue2 to delveop my project. I found that the computed property will only trigger when we keyup/keydown chinese input to a word. (ex: ㄨㄛˇ => 我 It will only trigger 1 times not 3 times when it format to a word) It's not like pure…
KevinHu
  • 991
  • 3
  • 10
  • 20
5
votes
1 answer

Android - Intercept Hardware KeyPress (PTT Button) when app is in background

I'm developing an Android app that intercepts the pressing hardware buttons and makes REST calls to their pressure. The button that I have to intercept is the Push to talk (PTT) button, so not a regular button, such as power button or volume…
Alberto Deidda
  • 506
  • 1
  • 4
  • 13
5
votes
2 answers

How can I detect the SPACE KeyEvent anywhere in my JavaFX app?

I want to detect a KeyEvent regardless of what element has focus in my JavaFX app - in particular, I want to detect the SPACE key. I tried to add a listener to the Scene that corresponds to my window: scene.setOnKeyPressed(ev -> { if…
Saturn
  • 17,888
  • 49
  • 145
  • 271
5
votes
2 answers

Managing the escape key to quit a program

I don't know how to implement the managing of the escape key to quit the program. I don't know either where to put it in my code, because if I put it in a method, how can it quit anywhere? This is my actual code : #include
Michael003
  • 420
  • 2
  • 6
  • 15
5
votes
2 answers

How to disable mnemonic for JavaFX MenuBar?

In my stage I have inserted a menubar at the top like usual for programs. I want to give the ALT key (together with arrow keys) some logic in another context within the stage. But everytime I press ALT and arrows I unintentionally navigate through…
Arceus
  • 520
  • 6
  • 16
5
votes
2 answers

JavaFX key press not captured

I am trying to capture key press events (page up and down) but there are no key events received at all. Here is the relevant code: Constructor: private MainLayout() { imageView = new ImageView(); root = new StackPane(); …
dermoritz
  • 12,519
  • 25
  • 97
  • 185
5
votes
1 answer

Enable Java Swing logging (key dispatch)

I need to debug key event dispatch in a Swing application. I thought the following would be sufficient: val eventLog = PlatformLogger.getLogger("java.awt.event.Component") eventLog.setLevel(PlatformLogger.Level.ALL) val focusLog =…
0__
  • 66,707
  • 21
  • 171
  • 266
5
votes
1 answer

How do I generate keyboard events that don't have key code in Java?

I'm using Robot class and KeyEvent key codes to generate all the other key events and they work fine, but I also need Hangul key(toggle Korean keyboard). Apparently KeyEvent does not have a key code for this key, so I'm stuck :( Is there a way to…
Jade
  • 51
  • 2
5
votes
1 answer

JavaFX : How to detect if a key is being held down?

I'm working with Timelines and was hoping to hook up some KeyPress events to the stage that could alter the way the timeline changes the properties over the course it runs. I know how to differentiate between what key was pressed and for what keys I…
Will
  • 3,413
  • 7
  • 50
  • 107
5
votes
1 answer

Disable Esc key on Kendo Window Popup

I am using KendoUI controls with JavaScript with MVC. I have a popup window create by "kendoWindow". its working fine, but when i press ESC key it will automatically close. I want to disable the ESC key so that window popup can be only closed by…
sagar43
  • 3,341
  • 3
  • 29
  • 49
5
votes
3 answers

Fire event after 2 seconds using javascript/jQuery

I have similar requirement like jquery-run-code-2-seconds-after-last-keypress. Now, when I use @brad code, it works fine when i do :- $('input.username').keypress(debounce(function (event) { console.log('Search keypress'); }, 250)); But not…
Shubh
  • 6,693
  • 9
  • 48
  • 83
5
votes
1 answer

How to bind multiple actions to a keyboard event

I am trying to make a chrome extension that modifies the text in an active text area of a Facebook chat window. But I want the change to take place only when the user presses the enter key so that the text doesn't change while it is still in the…
Annihilator8080
  • 2,019
  • 3
  • 21
  • 20
5
votes
1 answer

Sending KeyEvents to a Process

I am trying to send keyboard commands to a game emulator from my Java program, I know how to set up the process from processbuilder and run the process. However, I'm still having trouble with sending the process keyboard commands from my Robot. An…
Bskogen
  • 51
  • 3
5
votes
4 answers

Get key combinations

How can I get key combination of keys on keyboard E.G. (Ctrl+somekey, Alt+somekey) with Java? I use KeyEvent listener, MouseEvent listener for all keys on keyboard. I can catch all key event on keyboard by using that listener. But, I cannot catch…
Anonymous
  • 152
  • 1
  • 1
  • 11