keyevent

How to turn off auto selection in combobox while navigating in dropdown?

天涯浪子 提交于 2019-12-14 03:18:46
问题 the Title states my problem almost completely. I have some combo box classes which derive from JComboBox, additionally we use the PlasticUI from JGoodies. My Problem is that when I navigate through the available items in the drop down popup those items are automatically being selected. This only happens when I use the navigation keys, hovering with the mouse over the objects is fine. In my case this is pretty bad because it somehow provokes the lazy-loaded data in the object to be loaded and

Android: Is there a way to simulating D-Pad Events (API 10)?

谁说胖子不能爱 提交于 2019-12-14 00:23:41
问题 The problem is very simple. I have to simulate the dpad events (UP,DOWN,RIGHT,LEFT,CENTER) for navigate in my GUI that consists of a lot of buttons and other elements. With the simulator D-Pad I can without a line code navigate throw this GUI. But how can I do this programmatically? I have tried a lot with no success: KeyEvent event = new KeyEvent(KeyEvent.ACTION_DOWN,KeyEvent.KEYCODE_DPAD_LEFT); View.dispatchKeyEvent(event); Nothing happens (the focus should move one element to right) I have

how to make key press not pause? [duplicate]

回眸只為那壹抹淺笑 提交于 2019-12-13 23:04:13
问题 This question already has answers here : Java KeyListener stutters (3 answers) Closed 6 years ago . Okay, so I am making a 2D side scroller game for school. It is pretty much just like Mario (well, that is my hope for when I finish.) When I press the right arrow key to move my player along the map, he moves once, pauses, and then begins to smoothly move a lot. I think this is because of the pause that is in all apple laptops when you hold a key down, but I do not know how to get around this

Keyboard events java

本小妞迷上赌 提交于 2019-12-13 08:10:40
问题 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 and use http://horstmann.com/sjsu/graphics/ this basic graphics lib.I can't figure out keyboard input i want it so if you press an arrow the picture adds a small green square(I have a green.png).I can't figure out to use keyboard listeners.I get all

Android OnKeyListener not registering Enter and Search keys.

懵懂的女人 提交于 2019-12-13 07:17:57
问题 I am using a Popup window and within that window I have a search view. Upon clicking the search view the soft keyboard comes on screen. So I want whenever I press the search button or enter button from keybaord it will get the data from the search view and will show the relevant information. I am using an OnKeyListener to get the key but it is not registering the enter and search key presses. My code: searchview.setOnKeyListener(new OnKeyListener() { @Override public boolean onKey(View arg0,

KeyCodes for azerty keyboard in JAVA

牧云@^-^@ 提交于 2019-12-13 06:24:50
问题 So I'm fairly new to Java programming and I'm trying to figure out how keyEventListeners work in Java. I've managed to make a tiny program in which you steer a red square, but the only problem is, it only works on a QWERTY-keyboard. Here's the code that checks the keyCode: public void keyPressed(KeyEvent e){ int c = e.getKeyCode(); if(c == KeyEvent.VK_LEFT){ velX = -1; velY = 0; } if(c == KeyEvent.VK_UP){ velX = 0; velY = -1; } if(c == KeyEvent.VK_RIGHT){ velX = 1; velY = 0; } if(c ==

Why wont this KeyEvent work?

萝らか妹 提交于 2019-12-13 06:19:22
问题 I am making something in java that when the F1 key is hit a JDialog window to apear.My current code: public class Keyboard implements KeyListener { private boolean[] keys = new boolean[120]; public boolean up, down, left, right, assets; public void tick() { assets = keys[KeyEvent.VK_F1]; } public void keyPressed(KeyEvent e) { keys[e.getKeyCode()] = true; } public void keyReleased(KeyEvent e) { keys[e.getKeyCode()] = false; } public void keyTyped(KeyEvent e) { } } And in my main class under

JButton KeyPressed - Nothing Happens

别说谁变了你拦得住时间么 提交于 2019-12-13 04:01:34
问题 I'm trying to make it so that pressing the right arrow key does the same thing as pressing a JButton . I can bind the right arrow key to the button itself - but that means I have to have pressed the button before the right key works. Now I'm trying to see if binding to the actual JFrame is what I want, but I can't get anything to happen when I bind to the frame at all: private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { onButtonPress(); } private void formKeyPressed(java

How to prevent member QWidgets or QDialog objects taking over key events from QMainWindow once the dialog has been clicked by the mouse?

泄露秘密 提交于 2019-12-13 03:44:29
问题 So I have QMainWindow type class which described by the following code: class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); private: void closeEvent(QCloseEvent *);\ DimensionDialog *newResolution; Ui::MainWindow *ui; ImageInteraction *liveVideo; ImageInteraction *modifiedVideo; CameraControl *cameraControl; QPushButton *pushToTalk; QPushButton *audioSettingsSetup; AudioSettings *audioSettings; QPushButton *numberOfRunningThreads;

Delay between pressing a key and the key being read as held down

会有一股神秘感。 提交于 2019-12-13 01:27:20
问题 I have noticed that while holding a key down, there is a short delay between the key being read as being held down. What I mean is this; hold down any key and observe closely. The pattern goes like this: h.....hhhhhhhhhhhhhhhhhhhhhh where . symbolizes a pause. This is fine, because when we type, it would be harder trying to write a single letter e.g. 'i'. But what if we want to make a game? I mean, we wouldn't like the delay. This is exacly my problem. So now, let me show you my code: import