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
0
votes
2 answers

ActionListener from JTextArea Java

I'm new to Java, and trying to figure out one last thing for my program. This is the program that I have coded and with the layout it is perfectly fine no problem at all. Now my program suppose highlight the buttons whenever to press it on the…
Ali
  • 9,997
  • 20
  • 70
  • 105
0
votes
1 answer

Where to determine what key was pressed

For example I have two type of keys that I need to handle in different ways. So, I should determine what type of pressed key is. I can separate keys in signal level, that is determine what key was pressed and emit appropriate signal: void…
YAPPO
  • 173
  • 1
  • 13
0
votes
2 answers

how to add a datagrid row on key down event?

I have a datagrid with one row intially. When I click on the first row, i.e on key down event, I want another row to be added. Earlier I had a button, on clicking which I added the row. But now I want the row to be added automatically once I click…
Angeline
  • 2,369
  • 22
  • 68
  • 107
0
votes
2 answers

Page up / down KeyEvent not being triggered on Google TV

I have an activity in GTV with a layout containing a horizontal ScrollView inside a vertical ScrollView. The horizontal ScrollView contains lots of buttons, arranged in rows using nested vertical and horizontal linear layouts. (In case you are…
0
votes
0 answers

Send keystroke to not focused display

I'm trying to send key events to a display event if it is not in the foreground. At the moment i'm doing the following: Display *d_; d_ = XOpenDisplay(NULL); system(QString("xdotool key…
Josch
  • 121
  • 1
  • 3
  • 9
0
votes
1 answer

Where does an event go when injecting it into /dev/input/eventx?

I think I have read all post related with my query, some of them helped but I still can´t find the correct approach. Im trying to develope an app which has to inject touch events into the system. As I was reading if you dont have system signature…
Carlos Morera
  • 377
  • 4
  • 12
0
votes
3 answers

Android OnKeyListener not registering Enter and Search keys.

I am using a Popup window and within that window I have a search view. Upon clicking the search view the soft keyboard comes on screen. So I want whenever I press the search button or enter button from keybaord it will get the data from the search…
Ravi
  • 2,277
  • 3
  • 22
  • 37
0
votes
1 answer

How to start a game animation with spacebar?

I am developing a small game applet and I would like for it to wait until the user presses spacebar to start, however I am not sure what the best approach for this would be. Here I have written a SSCCE of a moving…
phcoding
  • 608
  • 4
  • 16
0
votes
1 answer

make on/off console program by key press

I write simple console application and I want to control it by key press There is my code: #include "stdafx.h" #include int i = 1; BOOL WINAPI ConsoleHandlerRoutine(DWORD dwCtrlType) { if (dwCtrlType == CTRL_CLOSE_EVENT) { …
Klasik
  • 872
  • 1
  • 9
  • 29
0
votes
1 answer

Displaying keypress count in JTextField or Jbutton

I'm having trouble displaying the amount of times a key has been pressed and display the number in a JTextField or JButton. Could anyone give me a hand with that? I already have the KeyEvent.VK_NUMPAD3 displayed, it just seems to be the…
Delish
  • 77
  • 1
  • 12
0
votes
1 answer

OnKeyListener OnKey repeats action

I'm trying to modify the action when the user clicks the "DEL" key (on the screen keyboard), here's the code ed.setOnKeyListener(new View.OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { …
0
votes
2 answers

How to restrict KeyEvent capture speed

I'm making a fairly basic top down 2D shooting game (think Space Invaders) but I'm having an issue with KeyEvent processing too many events per second. I have this: if (e.getKeyCode() == KeyEvent.VK_SPACE){ shoot(); } shoot() creates a bullet…
karoma
  • 1,548
  • 5
  • 24
  • 43
0
votes
1 answer

Can't receive keyboard input in Java

I am trying to get some basic keyboard input functionality like the arrow keys. However, nothing i try seems to work, i've been using the KeyListener interface, the JPanel that checks for input gets the focus, and there seem to be no errors. …
0
votes
4 answers

Check if a menu item event if coming from a click or shortcut

Is there anyway to check if a menu item event is coming from a click in the menu or from a short cut key being pressed? I've tried adding event handlers to the key press and key down events, however these events aren't being "fired" when it's a…
GraeningM
  • 78
  • 7
0
votes
1 answer

JComboBox KeyReleased event not working

I'm using a JComboBox to search a query from a sql DB. I want to search query when a letter is typed. I'm using net beans IDE. Here is the automated code. srch.addKeyListener(new java.awt.event.KeyAdapter() { public void…
Hasi007
  • 146
  • 2
  • 14