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
-1
votes
1 answer

Called window is unresponsive?

This bit of code calls two separate games when the respective key is pressed. the windows appear, but the user cannot play the game. The screen is unresponsive. How do i fix this? public void keyPressed(KeyEvent e) { if(e.getKeyCode()…
Imani Davis
  • 29
  • 1
  • 2
-1
votes
1 answer

JPanel not responding to KeyEvents

When I am using JFrame and I have a JPanel and some other component (like a JButton), I assign the wasd keys to the JFrame(KeyEvent), but the JPanel doesn't respond when I press a key. Only when the JPanel is the only component in the JFrame will…
user4196492
-1
votes
1 answer

Mac Safari "command + c" and jquery keypress

I'm trying to implement a feature to focus "Search" field if typed anywhere in the "body". Things are kind of working fine as you see form jsfiddle demo. But in MAC Safari maching if i type "Command + C" it will focus to the search field which…
tomalex
  • 1,233
  • 6
  • 17
  • 40
-1
votes
1 answer

Keyboard events java

I have recently started learning java.I want to make a game like https://sites.google.com/site/millseagles/home/Games/multiplayer/tron I have made it in c++ once using a simple graphics lib. I have the graphics part down i plan to use small images…
-1
votes
1 answer

How to get an event to occur if two different keys are pressed (HTML5 Javascript)

Basically I want my character to jump if I press any button on the keyboard, is there a way to make it do this using "case..." functions? Thank you Jordan
JordanK
  • 1
  • 1
-1
votes
3 answers

How to disable multitasking function on android while our app is running?

We would like to know, if there is a way to block "long pressed" home button function, that opens "appswitch/multitasking" dialog. Our app crashes, when we try to open multitasking on samsung galaxy s3 by holding the home button. Is there some way…
-1
votes
5 answers

Java Jframe is closing with all keyboard inputs

Jframe is closing to any input from keyboard just need it to close when user input escape key. Unable to find similar examples if known issue exist please provide link. package jframe_no_decoration; import java.awt.event.KeyAdapter; import…
Nathan Morales
  • 71
  • 1
  • 1
  • 6
-1
votes
1 answer

JavaFX KeyTypedEvent conflit with KeyPressed and KeyReleasedEvent

scene.setOnKeyPressed(new EventHandler() { @Override public void handle(KeyEvent ke) { if (ke.getCode() == KeyCode.SPACE) { System.out.println("space pressed"); } } …
gonnavis
  • 336
  • 1
  • 7
  • 16
-1
votes
1 answer

Why ProgressBar becomes null when i call a Fragment's method from FragmentActivity?

I am using dispatchKeyEvent in my FragmentActivity and calling one of my fragments method. Following is code I am using for my FragmentActivity: public class ViewPagerFragment extends FragmentActivity{ MyAdapter mAdapter; ViewPager mPager; …
-1
votes
1 answer

Key Events Issue in Swing while validation

When I tried to validating the text fields, in the empty text fields if I press,backspace or ctrl keys,It's giving the warning message which has to be actually given when entering the numbers instead alphabets. How to avoid these alerts? I am…
Mathu
  • 84
  • 1
  • 12
-1
votes
2 answers

how can I trigger a JList when press @ in a JTable's row in swing?

I need to trigger a JList with items when I press @ in a JTable's row in Swing, when the user selects an item the JList should disappear, anyone know how I can achieve this?
iberck
  • 2,372
  • 5
  • 31
  • 41
-1
votes
1 answer

Creating an event handler or a different event then the keydown on wpf c#

I mean that I need to create an event of keydown that gets Object sender, System.Windows.Forms.KeyEventArgs e and not Object sender, System.Windows.Input.KeyboardEventArgs e. The code I try: this.KeyDown = MainWindow_KeyDown; } public new…
AKO
  • 9
  • 3
-1
votes
1 answer

adobe reader control in a form application steal key events

In my form application i added an adobe reader control to show pdf files IN my application. I have a split panel, so on the left is a tree view with directories and files. And on the right side i have the adobe reader control. Works good. But i…
codeslave
  • 13
  • 6
-1
votes
1 answer

Change Windows Master Volume Java

im actually trying to figure out how i can set the System Master Volume in Windows 7/Vista. Using javax.sound wont work cause of the new line system of Windows. So i got 2 other options but dont know how to do this. First option is sending a Media…
-1
votes
2 answers

Using KeyListener for a Calculator in NetBeans

I have written a calculator in NetBeans and it functions perfectly. However, I have to actually click the buttons to insert numbers and am trying to remedy that with a KeyListener. I have all my numbers and function buttons set inside a JPanel named…
Nick
  • 1
  • 1
  • 3