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

KeyEventListener recognising UP and Delete key simultaneously in Java

I am writing a command line application in Java. Rather than using System.console(), I am writing a custom console, that will run within a JFrame. This is primarily to circumvent the fact that System.console() returns null from within an IDE like…
diestl
  • 2,020
  • 4
  • 23
  • 37
0
votes
1 answer

Perform an action when you press the physical menu button

I would like to do some action when you press the menu button, but it does not work. If we use KEYCODE_BACK instead of KEYCODE_MENU, it works. @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode ==…
Milton90
  • 547
  • 2
  • 7
  • 15
0
votes
1 answer

Extjs 3.4 get Key value on comboBox key events

I want to identify which key is pressed on keyUp keyDown or other event on combo box. I have set enableKeyEvents: true, in my config file and added event handler. this.a.on('keyup', this.onAKeyPress, this); and function onAKeyPress: function(e){ …
kuldarim
  • 1,096
  • 8
  • 21
  • 44
0
votes
2 answers

How to open a menu with keypresses?

I am currently trying to desing my first website just for me. I have a menu, which is hidden by default. When you press on a button in the Navbar, it opens fine. But I want to add the possibility to do this via keys too. M = Open Menu ; ESC =…
tranes
  • 3
  • 1
0
votes
1 answer

Android SearchView: search again when spyglass key is pressed

I am using a SearchView widget to search text in a ListView. When entering text a virtual keyboard opens. I want to repeat the search when the "spyglass key" is pressed. How can I intercept the virtual keyboard key events? Note: do not confuse the…
ilomambo
  • 8,290
  • 12
  • 57
  • 106
0
votes
1 answer

java jface triggering event when return/ enter is pressed

Thanks for any and all previous help that was given. What I'm trying to do is when the enter button is pressed that an event is triggered. Here is the code that I have written txtGolfName = new Text(container, SWT.BORDER); …
Keith Spriggs
  • 235
  • 1
  • 4
  • 10
0
votes
1 answer

Get all keys from KeyEvent to map

Is there a way to get all Keys from java.awt.event.KeyEvent to map? I tried using reflection like: for (Field f : KeyEvent.class.getDeclaredFields()) { try { map.put((int)f.getInt(f), f.getName()); …
formatc
  • 4,261
  • 7
  • 43
  • 81
0
votes
1 answer

Javascript key events IE, Safari

I'm trying to handle key events to a canvas. I've added a tabindex which allows the canvas to receive events. My problem is that keydown events aren't registering. They are still going to the document. I can get letter key events but not the…
Gambai
  • 651
  • 1
  • 7
  • 25
0
votes
4 answers

Exiting Application With Home Button press

I have an android application implementing facebook.It shows facebook login dialog(extends dialog) when click on a button from an activity. If we pressing home button after loading the facebook dialog, the application exits.But if we restart the…
Asha Soman
  • 302
  • 2
  • 6
  • 18
0
votes
2 answers

Key Shortcuts on a web page

Alright so for my website I'd like to enable keyboard shortcuts. When left or right button is pressed on the keyboard, it opens an URL. Also binding some other buttons too maybe. Any clue how I can go about doing this?
user1071461
0
votes
0 answers

Injecting key_events in one button click in android.

In my application i want to do the same functionality happening while invoking a set of KEY_EVENT with in a button click. Is that possible.
Kamalone
  • 4,045
  • 5
  • 40
  • 64
0
votes
1 answer

If statement using KeyCharaters

public static void displayInfo(KeyEvent e){ int id = e.getID(); String keyString; char c = e.getKeyChar(); keyString = ""+c; if (keyString=="w"){ System.out.print("FACE"); } } this is my code and for whatever reason it…
BaconMan97
  • 67
  • 1
  • 9
0
votes
2 answers

Sending a keypress over a client / server

I am creating an Android game and have come across a problem. It is a simple Pong style game where a bat is moved left or right to block a ball. However I am trying to control the bat via a UDP connection. I have my server set up on my Android code…
dgabriel
  • 11
  • 2
-1
votes
2 answers

Issue with selecting text using keys jquery

I need to highlight the selected text in a div using keys and mouse. Approach for select using mouse is as follows: html code:
In
Anushka
  • 7
  • 5
-1
votes
2 answers

How to get keyEvent to work in Java?

I'm completely new at programming Java. I can't get my keyEvents to wont work. I need this for a little game I'm making. Here is my code: package markusrytter.pingpong; import java.awt.Graphics; import java.awt.Graphics2D; import…
markus rytter
  • 140
  • 1
  • 3
  • 13
1 2 3
13
14