Questions tagged [key-events]

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

A KeyEvent 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).

204 questions
0
votes
0 answers

Android, how to generate virtual 'back' key

Recently I ran into the same problem as here Spinner with custom adapter doesn't disappear on selection. All the part of selecting and return the selected item to the caller is solved. Now I just need to get rid of the Dropdown view. My solution…
EyeQ Tech
  • 7,198
  • 18
  • 72
  • 126
0
votes
0 answers

View losing ability to accept key events

I'm a little confused over how key events (back key, volume keys) relate to Views in android. Take for example the problem I currently have: Working OK Create Layout (for example, Relative layout) Add View to Layout (A GL SurfaceView) Run app and…
Zippy
  • 3,826
  • 5
  • 43
  • 96
0
votes
1 answer

Get the keyboard event in android

I am having webview,page having search functionality when user focus the view to serch android keyboard open and i want to handle ime options. In android keyboard i have ime option as "GO" button. I have search a lot for this,and tried lot…
user2644903
0
votes
1 answer

how to simulate long press using AndroidViewClient-5.5.1

i want to simulate long press on power key using AndroidViewClient , i could achieve this using monkeyrunner . code is as follows : from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice device =…
user
  • 65
  • 1
  • 11
0
votes
1 answer

Disable key events

Im making a quiz application, and when a team pushed their buttons (keyboard keys), i want my JFrame to stop listening to other pushes untill the next question or if the answer is wrong. How can i stop listening to key events? I tried setting the…
user3485470
  • 121
  • 5
  • 11
0
votes
1 answer

Forward all key events to parent JFrame

I need that all the key events (including Carriage Return, TAB, etc) generated by all child or grandchildren components of a JFrame, to be listened for a single method inside this JFrame. I have googled a lot, but I have not been able to find the…
Ferite
  • 131
  • 1
  • 3
  • 10
0
votes
1 answer

Java Key Events and Timer control

Im almost finished with this car project im working on but cant seem to get the key events to work. I think it has to do with my action listener with my timer but im not sure. When I press the up arrow key the timer delay is supposed to decrease and…
bkedge
  • 105
  • 1
  • 2
  • 10
0
votes
0 answers

Android :Injecting KeyEvents

I am working on a project which has two modules , server and client. Server will be running on OTT devices (Android based) as an background service and will be responsible to actuate/inject keyevents and client will be sending keyevents over…
r4jiv007
  • 2,974
  • 3
  • 29
  • 36
0
votes
2 answers

java Swing how consume document event

I want consume a DocumentEvent captured into insertUpdate method of a DocumentListener I don't see any way to prevent as a KeyEvent (e.consume()). I don't want use the key listener because can't prevent the clipboard events (Copy Paste). How I work…
josepmra
  • 617
  • 9
  • 25
0
votes
1 answer

ActionMap / InputMap to make JTextArea display "this text" when F2 is pressed

I've been trying to make a JTextArea display a certain String when F2 is pressed in a certain TextField, with no success as yet. Any help much appreciated. My code may reveal how little programming experience I have: final String ACTION_KEY = "this…
George Tomlinson
  • 1,871
  • 3
  • 17
  • 32
0
votes
2 answers

JavaScript: Capturing Onkeyup event only works one time

I am trying to write a web page that can catch onkeyup events. It uses document.write("..."); to print the keycode each time. However it only works once, the second time I use it, the window does not update. Here is the code: document.onkeyup =…
Mattias
  • 1,110
  • 1
  • 11
  • 26
0
votes
3 answers

How to display/update images after keystrokes in java in JFrame?

As a java non-expert, I would like to know how to change the code below to get it to work. Here is what I want to do When the java code is called args contains several image filenames I want to see the first image in this list Then when I press a…
Alex
  • 41,580
  • 88
  • 260
  • 469
0
votes
1 answer

I there any way to capture KEYCODE_BRIGHTNESS_DOWN event in background?

I am trying to create an application which need to capture event when KEYCODE_BRIGHTNESS_DOWN button pressed.Is there any way to achieve this via BroadcastReciever.
Akram
  • 7,548
  • 8
  • 45
  • 72
0
votes
2 answers

Is there a way to set underline to mnemonic character in native look and feel under Win 7?

My code: fileMenu = new JMenu("File"); fileMenu.setMnemonic(KeyEvent.VK_F); fileMenu.setDisplayedMnemonicIndex(0); Javadocs for AbstractButton.setDisplayedMnemonicIndex() say that Not all look and feels may support this. I set my look and…
ps-aux
  • 11,627
  • 25
  • 81
  • 128
0
votes
1 answer

How can I add a simple non-interactive gui to my python application?

I have written a little python utility that monitors my typing speed, using pyxhook to hook keyboard events, and a thread timer to update my words per minute number. Right now it just prints to the terminal every 2 seconds. How can I make this…
Brent
  • 16,259
  • 12
  • 42
  • 42