keylistener Questions

5

Solved

I have a subclass of JFrame that uses a class extended from JPanel public class HelloWorld extends JPanel implements KeyListener I add an object of HelloWorld to the frame - app.add(helloWorld);...
Samons asked 14/7, 2012 at 21:1

28

I am changing the value of an EditText on keyListener. But when I change the text the cursor is moving to the beginning of the EditText. I need the cursor to be at the end of the text. How to mov...
Provisory asked 2/6, 2011 at 16:32

2

Solved

I recently started playing around with Java FX, FXML, and scene builder, and I've been trying to add key listeners to one of the controllers for a scene. When I do this though, the key listeners do...
Micheal asked 26/9, 2014 at 13:33

7

Solved

Is there a way to do key listeners in python without a huge bloated module such as pygame? An example would be, when I pressed the a key it would print to the console The a key was pressed! ...
Hillaryhillbilly asked 12/8, 2012 at 1:20

2

Solved

I know how to use events to test when a key is pressed or not, but in C I never found out how to do that. What I want exactly is a "KeyListener" that listens for the Up, Down, Left and Ri...
Algor asked 3/10, 2012 at 13:12

5

I'm trying to make a program that can converts fahrenheit to celcius in java. In program i have 2 Labels and 1 TextField for input. I want to make convert temperature when user types the temperatur...
Neaten asked 13/1, 2013 at 23:33

3

Solved

I want to write a little game where I can move a ball on a JavaFX Panel using the W, A, S, D keys. I have a getPosX() and setPosX() but I don't know how to write a KeyListener which will e.g. calcu...
Younker asked 30/4, 2015 at 8:11

1

I am making a top down 2d survival game where the player must dodge projectiles from enemies in order to survive, but I've run into an issue that may, slightly influence the gameplay of my first re...
Midian asked 15/1, 2021 at 11:56

7

Solved

I'm making a small program in Java using the Robot class. The program takes over the mouse. while in the course of debugging if it starts acting in a way that I don't want it's hard to quit the pro...
Boyer asked 23/5, 2009 at 9:44

5

Solved

Can anybody provide me with the Key Code integer list for individual keys used on the Keyboard for the KeyEvent class in java? I want to create a dropdown list of all the keyboard keys for the use...
Messieurs asked 9/3, 2013 at 17:4

6

My son (aged 11) who is learning Java is going to enter a question and some code. He tells me he has not been able to find the answer to this question on the site. You will be reading my edited ver...
Hoag asked 23/2, 2014 at 15:7

6

I have editable JCombobox and I added keylistener for combobox editor component. When user press 'Enter key' and if there is no text on the editable combobox I need to display message box using JOp...
Zach asked 27/12, 2012 at 14:32

3

I have been using pynput library for monitoring the clicks of the mouse.The only problem I am facing is that the terminal does not terminate on pressing Ctrl+C. I need to use keyboard listener with...
Petrel asked 31/8, 2017 at 4:53

5

Solved

How can I detect the power button or lock screen button being pressed? When my game is paused in this way, it can cause the game to crash because I need to pause a thread when it happens.
Brendis asked 27/7, 2011 at 17:17

2

Solved

I have this html button: <button type='button' class="button-name" (click)="change($event)" [disabled]='disabledButton' > I have this in typescript: change(event: Event) { console.l...
Monadnock asked 19/6, 2019 at 6:19

4

Solved

I am trying to do something when one of the arrow keys are pressed using the KeyListener in my JPanel class. Here is my code: public class TestPanel extends JPanel implements KeyListener{ public...
Kiely asked 13/5, 2013 at 20:43

7

Solved

I'm learning Swing class now and everything about it. I've got this toy program I've been putting together that prompts for a name and then presents a JOptionPane with the message "You've entered (...
Sayyid asked 5/12, 2012 at 20:22

5

Solved

I know this/similar question has been asked before but the solution given is not working for me so I'm asking again. I tried the solution given in that answer but still my OnKeyListener is never be...
Fjeld asked 26/6, 2014 at 8:30

2

Solved

The following code is supposed to simply suppress any key press and add the pressed key to a div instead. This works fine on desktop, however on mobile (safari and chrome) event.key is undefined. ...
Journeyman asked 1/8, 2017 at 9:19

5

Solved

I'm looking for a KeyListener for a game I'm developing in JavaScript. I have no idea how this would work in real code but it would be something like this: if(keyPress == upKey) { playerSpriteX ...
Bottali asked 9/6, 2013 at 23:2

2

Solved

private void jTextField1KeyPressed(java.awt.event.KeyEvent evt) { //cant capture my TAB? System.out.print(evt.getKeyChar()); } What is the simplest way in an java gui to capture the tab key...
Seaton asked 25/11, 2011 at 23:53

6

Solved

How can I let my custom KeyListener listen for combinations of ALT (or CTRL for that matter) + more than one other key? Assume I have 11 different actions I want the application to do, depending o...
Inversion asked 21/10, 2011 at 15:14

4

Solved

I am currently trying to implement a keylistener in my program so that it does an action when I pressed an arrow key, the object in my program either moves left or right. Here is the moving method...
Steersman asked 4/6, 2012 at 5:0

4

Solved

I have a keylistener attached to my frame in java, i can detect key presses when I hit any key, a strange thing is happening however. My game is a minesweeper game, I have a restart button that bas...
Gujral asked 10/11, 2011 at 2:29

7

Solved

Inside the KeyTyped method, how do I tell if Backspace or Esc is being pressed?
Gaud asked 28/3, 2013 at 23:24

© 2022 - 2024 — McMap. All rights reserved.