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
195
votes
15 answers

Jquery: how to trigger click event on pressing enter key

I need to execute a button click event upon pressing key enter. As it is at the moment the event is not firing. Please Help me with the syntax if possible. $(document).on("click", "input[name='butAssignProd']", function () { //all the…
Arianule
  • 8,811
  • 45
  • 116
  • 174
28
votes
11 answers

codemirror autocomplete after any keyup?

I'm working on trying to add a custom autocomplete, that I want to trigger whenever the user is typing (configurable of course). I've found a couple examples of autocomplete for codemirror: http://codemirror.net/demo/complete.html…
Kyle
  • 17,317
  • 32
  • 140
  • 246
23
votes
3 answers

How to handle "Go"/"Enter" keyboard button Ionic2

What is the event to handle "enter" or "go" keyboard key on an input? The input is not used within a form. So clicking on it will not "submit". I just need the event. (Running android + Ionic 2 on Beta 11)
rubmz
  • 1,947
  • 5
  • 27
  • 49
20
votes
4 answers

How to use Key Bindings instead of Key Listeners

I'm using KeyListeners in my code (game or otherwise) as the way for my on-screen objects to react to user key input. Here is my code: public class MyGame extends JFrame { static int up = KeyEvent.VK_UP; static int right =…
user1803551
  • 12,965
  • 5
  • 47
  • 74
12
votes
3 answers

QKeySequence to QKeyEvent

I'm in a situation whereby I am trying to read in a JSON config file which dictates what key commands map to given actions. For example: ... { "Action": "Quit", "Combo" : "CTRL+Q" }, ... Constructing a QKeySequence from the combo tag is…
Sonoman
  • 3,379
  • 9
  • 45
  • 61
11
votes
2 answers

Key bindings vs. key listeners in Java

I note that in Java / Swing there seem to be at least two different ways of handling key events: Key Bindings Key Listeners What are the advantages / disadvantages of each, and when should you prefer one rather than the other?
mikera
  • 105,238
  • 25
  • 256
  • 415
9
votes
4 answers

jQuery onkeyup method not defined

the onkeyup method is supposedly not defined, however, the method is auto-recommended to me by my ide. When I view the error in chrome dev tools I get the error Uncaught TypeError: Object [object Object] has no method 'onkeyup'. I am using the…
Julian
  • 325
  • 1
  • 3
  • 10
8
votes
1 answer

Send a key combination (meta key and keycode) via the Android API

I can't figure out how to send a combination of a meta key (e.g. CTRL) and a keycode (e.g. for RETURN) with Android (I am using API level 11 = version 3.0). The documentation of the class KeyEvent mentions constants like META_CTRL_ON and also…
Florian Wolters
  • 3,820
  • 5
  • 35
  • 55
8
votes
2 answers

How do you remove the Ctrl+C action on a JFileChooser?

I'm embedding a JFileChooser in my program in my own frame with other custom components in the frame. Here's a design of my app as it may help visualize my issues: If you can't tell, the lists directly under the JFrame titles are JFileChoosers. …
Daniel Kaplan
  • 62,768
  • 50
  • 234
  • 356
8
votes
2 answers

Android Key Handling (Framework)

There are some parts of the framework which are not quite clear to me yet. I am well known with the flow of an input event (Kernel -> Eventhub -> InputReader -> InputDispatcher -> ...). Situation (Requirements: Handle input keys without changing the…
DroidBender
  • 7,762
  • 4
  • 28
  • 37
8
votes
3 answers

Overlapping key events

I am working on a little HTML/JavaScript/CSS3 project for fun. I'm basically trying to make a wheel that rolls around in the browser window. To control the wheel I'm using keyup and keydown events for the cursor keys (left and right turn the wheel…
jrl589
  • 125
  • 7
7
votes
1 answer

codemirror search simulate CTRL+F keys with javascript

I'm trying to open the codemirror search dialog (normally activated by pressing CTRL+F) by pressing a button: I tried to use window.find() but it does not open the dialog, it only highlights the text in the editor... DEMO
neoDev
  • 2,879
  • 3
  • 33
  • 66
7
votes
2 answers

KeyPressed and mousePressed Event in an unfocused Component

What are several ways of detecting a key stroke without the need of focusing on the component that the event was implemented? Here's my idea on this: Even without focusing on myComponent, upon pressing a key, the action should take part. ** Same…
Michael 'Maik' Ardan
  • 4,213
  • 9
  • 37
  • 60
6
votes
3 answers

jQuery: keyup(): Update div with content from text area... line breaks?

I have posted a working version here: http://jsfiddle.net/JV2qW/2/ I have a textarea that updates (on keyup()) a div with the text that is being entered. Everything is working as it should, except the line breaks are not being recognized. the…
superUntitled
  • 22,351
  • 30
  • 83
  • 110
6
votes
2 answers

Receive Escape-Event in QLineEdit?

This is a bit of a beginners question but I don't find the solution. I'm using an own object that inherits from QLineEdit and reiceves numbers as input (which works smoothly now). Now I want to receive an event, when the user presses the…
Elmi
  • 5,899
  • 15
  • 72
  • 143
1
2 3
13 14