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

How to transfer key event inside loop

I have a problem. In my program i have 2 classes: MainFrame public class MainFrame extends javax.swing.JFrame { Logika logika; . . . private void przyciskKeyPressed(java.awt.event.KeyEvent evt) { // TODO add your…
user1736332
  • 693
  • 4
  • 11
  • 22
0
votes
2 answers

How block key "esc" on RichFacesPleaseWaitBox?

I have an implementation of "RichFacesPleaseWaitBox" in my application, but has a problem. When the user initiates any action, the status starts, displaying the modal "Waiting." When the action finishes execution, the status ends, hiding the modal…
fhgomes_ti
  • 165
  • 2
  • 15
0
votes
1 answer

JavaFX KeyEvent processing in Modal Window / Dialog

I'm trying to have my dialog accept for the defaultButton and to execute the cancelButton. I have some code like this: dialog1 = new…
likethesky
  • 846
  • 3
  • 12
  • 28
0
votes
2 answers

Generating a QMouseEvent manually within the keyPressEvent in Qt

I have overridden the contentsMousePressEvent in my listview like this. void AppListView::contentsMousePressEvent(QMouseEvent *e) { AppGenericListView::contentsMousePressEvent(e); if (e->button() == Qt::RightButton) emit…
shan
  • 1,164
  • 4
  • 14
  • 30
0
votes
2 answers

Starling keyevents

So anyone any idea why it does not working? I want to listen keyevents with my starling class, do I need to focus and if yes how can I do that? Here's a Main class, this is the document class: package { import flash.display.Sprite; import…
Ferenc Dajka
  • 1,052
  • 3
  • 17
  • 45
0
votes
3 answers

c# Textbox KeyEventArgs - each letter is checked multiple times

I am checking the keycode for a textbox, and I want a certain task to be performed when the user presses Enter. It has been working perfectly, but the task that I am trying to perform now, usually is done using a mouse click. So on the OK on that…
Thalia
  • 13,637
  • 22
  • 96
  • 190
0
votes
1 answer

keycode shortcut each function

I'm working yet on a small script to capture keyevents and easily bind functions on them. But I'm stuck for now! The problem is, that if I initalize more than one "eventhandler" it overides arguments from the first initialization. Thousands of words…
yckart
  • 32,460
  • 9
  • 122
  • 129
0
votes
2 answers

Clear a typed character during runtime in jTextField

private void jTextField1KeyPressed(java.awt.event.KeyEvent evt) { int x=evt.getKeyCode(); if(x>=96&&x<=105) { evt.setKeyCode(8);//Here 8 is used for Backspace key to remove the numeric character entered } Int This code i want the user not…
0
votes
1 answer

sendKeyDownUpSync doesn't work correctly

I've got some problem with sendKeyDownUpSync. I want to use it in my widget to control inbuilt music player. It works almost correctly. Almost because when i call function: public void previousTruck() { final Instrumentation inst = new…
PatLas
  • 179
  • 1
  • 5
  • 16
0
votes
2 answers

How to simulate keyboard input (including cursor movement) by programmatically generating KeyEvents

I am trying to simulate keyboard input by programmatically generating KeyEvent objects and pumping them to the event queue. This works fine except that when characters are being entered into a JTextField, for example, the cursor (caret?) does not…
0
votes
1 answer

How to detect pressed key on BlackBerry using JQuery Mobile?

I am using JQuery Mobile to developing my own app for BlackBerry based on WebWorks(HTML5,CSS3,JS) tecknologies. On my layout div i have 3 input elements. I am wont to detect BlackBerry enter key pressed in first input to focus on next input. How i…
virtyaluk
  • 145
  • 1
  • 12
0
votes
1 answer

How can I raise Keyboard events programmatically in my iOS application

I am working on Remote desktop project for iPad. I am struggling with how to raise keyboard keyevents programmatically.(Shift,Control,Command,etc) keys and how can I assign these keys to UIButton. which is designed in my ipad View. I have found the…
khaleel
  • 169
  • 1
  • 1
  • 7
0
votes
1 answer

Print string to Caret position in JEditorPane when Ctrl+C is pressed

I'm trying to print out a certain string to the current caret position in a JEditorPane when CTRL+C is pressed. I'm not sure how to handle two key events and print to current caret position. The APIs do not do a good job of describing them. I figure…
0
votes
1 answer

Moving an Object on Canvas

Currently im making a HTML5 Canvas Spaceship Game. But i've got a huge Problem: I created a Class for my Spaceship and i want to move it with the Arrow Keys. But for some Reason it won't move. The Chrome Inspector won't show any errors but the…
0
votes
1 answer

Listening for volume up and down key events have reversed effect on Acer Iconia 7" tablet

I'm capturing the VOLUME_UP and VOLUME_DOWN keys to increase respectively decrease a value in my app. I use the following code: @Override public boolean dispatchKeyEvent(KeyEvent event) { int action = event.getAction(); int keyCode =…
Johan Pelgrim
  • 6,033
  • 6
  • 37
  • 46