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

How to get current modifier states with FireMonkey on OSX?

With Delphi for Windows, I usually use this code: function isCtrlDown : Boolean; var ksCurrent : TKeyboardState; begin GetKeyboardState(ksCurrent); Result := ((ksCurrent[VK_CONTROL] and 128) <> 0); end; How can I achieve this with FireMonkey…
Whiler
  • 7,998
  • 4
  • 32
  • 56
5
votes
1 answer

Android onkey - dispatchKeyEvent not firing

well, I've tried all the solutions I could find on stackoverflow and in other places, but the end result hasn't changed one bit: the only key that triggers the onKey event or the dispatchKeyEvent is the enter key on the virtual keyboard, and only if…
4
votes
1 answer

Javascript bug? No space bar event when pressing up and left arrow keys

I'm developing a little game and I try to receive the key input from arrow up, down,left, right and space. On keyDown i set some booleans to true und on keyDown to false again. In the main loop I check those booleans, so the character can move in 1…
Dominic
  • 3,353
  • 36
  • 47
4
votes
1 answer

Running KeyEventDispacther the first time JDialog opens and removing it afterwards

I'm doing an application that must read some characters via keyboard and interpret them. To capture the keys, I open a JDialog and set a KeyEventDispatcher, so I can capture the characters in the dispatchKeyEvent method. In the JDialog there's a…
Luiz SSB
  • 149
  • 8
4
votes
3 answers

Move image using keyboard - Java

I wanted to move my image using keyboard arrow keys. when I pressed the arrow keys it moves accordingly to the direction. However, I need to click on the image before able to move it. May I know how to edit the code such that I do not need to click…
KYQ
  • 53
  • 5
  • 11
4
votes
3 answers

Is it possible to trigger a key event on the DOM Window with Javascript/JQuery

is it possible to trigger a key event on the DOMWindow or DOMDocument in javascript? Basically I am creating an browser extension to interact with a website and they have shortcut Key Events (similar to GMail) on performing specific actions. I have…
thiesdiggity
  • 1,897
  • 2
  • 18
  • 27
4
votes
6 answers

How to ignore the key press event in Swing?

I want to make the text field only accept numeric and backspace button from the user. I have added the function that use to check the keycode from the user, but I don't know how to stop the key press event if the keycode is not numeric. What code…
e-qi
  • 135
  • 2
  • 3
  • 13
4
votes
3 answers

Simulate a key held down in Java

I'm looking to simulate the action of holding a keyboard key down for a short period of time in Java. I would expect the following code to hold down the A key for 5 seconds, but it only presses it once (produces a single 'a', when testing in…
Ross
  • 3,709
  • 8
  • 35
  • 33
4
votes
2 answers

Grid 'keydown' event doesn't catch special keys like arrow keys or Enter or Tab

I have an issue with catching special keys on 'keydown' event.. but all works great if I use 'keyup' event, except I can't use it .. Seems some control catches that event and stops proceeding for others or ? and why ? Ext.onReady(function () { …
mastak
  • 1,397
  • 1
  • 14
  • 28
4
votes
0 answers

How to detect and override media button key events on bluetooth headset?

Okay so I know many similar questions have been asked but nothing is working so far. I have tried all the mediaSessionCompat methods and callbacks but to no luck. I have gone through the documentation but it is pretty vague especially regarding the…
4
votes
3 answers

KeyEvent special Keys (like mute)

I'm currently trying to create a little remote-app for Android to control a MediaPlayer (like Rythmbox) on my PC. Most media-players understand the special keys on my keyboard (like "play/pause" or "next/previous"). My idea is that the Android App…
Lukas Knuth
  • 25,449
  • 15
  • 83
  • 111
4
votes
1 answer

Hot to get key events for Blazor.Extensions.Canvas

I enjoy writing my very first Blazor app. I want to move 2D graphics on a canvas, I'm using the Blazor.Extensions.Canvas assembly. Unfortunately I'm not able to get key events from the canvas. @page "/pacman"
anhoppe
  • 4,287
  • 3
  • 46
  • 58
4
votes
3 answers

Detect Key in KeyUp event

I have a textbox on a form where I'm trying to detect the keys the user types in. The TextBox is multilined with wordwrap on. I don't want the user the press the enter key (as I want all text entered on ONE line, wrapped) so I used the following…
Harag
  • 1,532
  • 4
  • 19
  • 31
4
votes
2 answers

For Emacs, long journey for using CTRL key in Android

I need some help with Emacs. I'm running the Ubuntu in Froyo (Android 2.2) and connect with Android VNC Viewer. But in Android VNC Viewer, it is hard to use CTRL, ALT, left mouse, and right mouse buttons so I made several experiments. I tried to…
kim taeyun
  • 1,837
  • 2
  • 24
  • 49
4
votes
1 answer

The method nextPage() and previousPage() in PageController doesn't work sometimes

Here is my code: I response key event in Android MainActivity, and use BasicMessageChannel to post key message: public class MainActivity extends FlutterActivity { private static final String CHANNEL = "scroll"; private static final String KEY_LEFT…
coder.john
  • 1,235
  • 2
  • 12
  • 11