1,464 questions
2
votes
3
answers
872
views
How to send an KeyEvent to JFrame Component?
So im trying to send an KeyEvent to the JFrame component. Like when u press a key while the window is focused normally it sends an KeyEvent to the JFrame and triggers something. But how can i simulate ...
0
votes
0
answers
127
views
JFXDialog close on KeyCode.Enter, MouseEvent.Click
When i call JFXDialog, the dialog appear with message and button, all beautiful, than i can close it by pressing the button, but i can not close it by using key event on KeyCode.Enter
JFXDialog is ...
0
votes
1
answer
134
views
Event listener not working when called outside of a recurring function, but being declared over and over again when declared inside of one?
I am making sort of a "catch the egg in the basket" game, and my controls using arrow keys, run by event listeners, will get progressively more sensitive as there are more and more event ...
0
votes
1
answer
400
views
JavaFX: Select a single line of text in a textarea where .getCaretPosition()
Platform: Intellij IDEA
Language: JavaFX
I would like to be able to select a line of text where the cursor lies. Similar to SQL Developer, I have a textarea that allows multiples lines of input or ...
0
votes
1
answer
262
views
Java smooth movement with KeyEvents in breakout
I'm currently learning Java through Stanford's Programming Methodology (2008) course. I'm trying to create the game Breakout and am trying to currently animate the paddle, which is a GRect type object....
-1
votes
1
answer
1k
views
Testing if a key is pressed in python
I would like to start a python script by using the keyboard shortcut Ctrl+Shift+H.
When the script starts, the keys Ctrl and Shift may still be pressed (depending on how quickly I remove my fingers).
...
3
votes
1
answer
467
views
Test if a key is pressed in Julia
I would like to start a julia script by using the keyboard shortcut Ctrl+Shift+H.
When the script starts, the keys Ctrl and Shift may still be pressed (depending on how quickly I remove my fingers).
I ...
3
votes
1
answer
453
views
Writing a Android System app that uses KeyEvents to insert text into a text field. But Extended unicode characters are not printable
So I could use a combination of CTL+ for control characters , SHIFT+ for Upper case letters like A ,B and characters like !,{ (i.e Basic Latin and punctuation characters) .
However I am not able to ...
-1
votes
2
answers
64
views
The image not showing up in JFrame after adding the movement
I am trying to make a PacMan alternative with a tiger chasing bagels (don't ask why). I'm on the first stage still, trying to make the tiger move around the JFrame. However, now that I implemented the ...
0
votes
1
answer
65
views
How to disable custom Shortkeys only when user is typing in some component and enable it again when focus is not on editable component in java?
I am using following code to set shortcut keys for my JFrame.
KeyboardFocusManager keyManager;
keyManager=KeyboardFocusManager.getCurrentKeyboardFocusManager();
keyManager.addKeyEventDispatcher(new ...
1
vote
0
answers
208
views
KeyEvents not taking space after the text in android
I am using react-native-keyevent to capture input events through the android app. I'm trying to capture ASDERFF|ERRTO| | using events. I'm able to get only ASDERFF|ERRTO| remaining spaces and the ...
0
votes
1
answer
793
views
Can you configure key event handling in Qt Designer (PyQt5)?
I just discovered Qt Designer today and it's rather wonderful.
But I'm a keyboard fanatic and don't want to be forced to use the mouse any more than is strictly necessary, or at the very least I want ...
0
votes
1
answer
723
views
JavaScript key holding down and release
I can control my bot through web. These are its url-
forward- https://172.0.0.1/forward
backward- https://172.0.0.1/backward
left- https://172.0.0.1/left
right- https://172.0.0.1/right
stop- ...
1
vote
1
answer
98
views
Checking for key down on menu bar application
I am writing a MacOS Menu Bar Application which uses a popover. I have relied on a number of tutorials to get things going.
Very briefly, the code looks something like this:
class AppDelegate: ...
0
votes
1
answer
461
views
wxWidgets pprogrammaticaly move to next input control
I originally had code that set the focus to the first widget in a dialog, in the onInit method. But there were problems with it: if I pressed TAB, indeed focus moved to next control (wxTextCtrl), ...
1
vote
1
answer
93
views
Missing Character For KeyEvent
When using the KeyTyped method for the KeyListener, sometimes I get "missing characters". I'll show the code I use to get them, then ask my question.
public class KeyInput implements ...
0
votes
4
answers
3k
views
Prevent more than one space between words
I have a function that prevents people putting numbers or any symbol but letters onkeypress into a text box due to ongoing problems with data entry.
<td><input type="text" name=&...
0
votes
1
answer
56
views
How to set SHIFT state of Google SIP from an Android Application
I am working on a specific requirement where I need to set the SHIFT state of the Google SIP from the Android Application. My question is, is there any API available for Google SIP (GBoard) which can ...
0
votes
0
answers
91
views
Android API v28, KeyEvent 82 not responding?
This is throwing me off a little bit. I am working on a small plugin for Home Assistant that works as a remote for my Android TV box (Nvidia SheildTV). I am sending commands via adb. I am attempting ...
7
votes
0
answers
3k
views
How to detect and override media button key events on bluetooth headset?
Okay so I know many similar questions have been asked but nothing is working so far. I have tried all the mediaSessionCompat methods and callbacks but to no luck. I have gone through the documentation ...
-1
votes
1
answer
209
views
Casting Textbox KeyEventArgs
I am trying to get KeyUp events for textBox control at runtime but I am struggling to cast correctly. The code below compiles and I can see the event info when I add a Watch/Inspect ...
-1
votes
1
answer
89
views
Best Practice for Text and list box input
I have a lengthy form containing multiply text boxes and list boxes in order to gather data.
There is a logical sequence to the controls and the tab indexes are set to lead the user through.
My ...
1
vote
0
answers
65
views
Suppress the default input of a key in Android
I have an edittext where I'm trying to over ride the default input of physical keys to replace with custom input for each key. My code works fine to add the input that I want, but I cannot seem to ...
4
votes
3
answers
13k
views
Trying to dispatch keypress event in React
I have a component with an input element and I would like to trigger a "tab" keypress event on that input element in order to jump to the next input element whenever a certain set of logic ...
0
votes
1
answer
323
views
How to add a key shortcut in JavaFX?
New user: studying Java since January, I am using NetBeans right now, if I write this simple idea of shortcut I get tons of errors.
Scene root = new Scene(layout ,Screen.getPrimary().getBounds()....
0
votes
2
answers
332
views
I want my object to flow! The Keyboard Delay - Java
I don't know which component should I use to create a moving square on my JPanel. So I decided to use another JPanel to make an object. My first goal was moving the object but you know the games, when ...
0
votes
0
answers
163
views
get char of VK_ key
In a method i'm receiving vk_key's as just a int, nothing more is provided.
I need to forward this, which looks like:
parent.postEvent(new KeyEvent(null, parent.millis(), KeyEvent.TYPE, modiefiers, ...
1
vote
0
answers
362
views
How to get Key value if input data are event.code and current keyboard layout
I want to implement my own virtual keyboard which constructed in dynamic way.
I'd like to use event.code as key selector.
To make it supporting different system languages I need to prepare data maps ...
0
votes
4
answers
892
views
Convert Java KeyListener implementation to Kotlin
I've written the following KeyListener in Java.
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
public class KeyHandler implements KeyListener{
@Override
public void ...
3
votes
2
answers
3k
views
Send ENTER key event through Android AccessibilityService
I am trying to navigate to a URL in a browser through the AccessibilityService. I am able to find the URL bar and enter a URL into the EditText, but I can't find a way to press enter to actually go ...
3
votes
1
answer
2k
views
Where to assign KeyEvent in Controller class in JavaFX
I'm trying to assign a Keyboard event to a specific keypress on a specific scene. This scene is loaded when a button is clicked on a previous scene.
My problem is: where would I assign this event to ...
2
votes
2
answers
117
views
HTML input field need to take characters from beginning when full
I need a text box which when maxlength is reached, need to position cursor to beginning and on key input needs to replace the characters as keys are pressed. My sample code is below. I can get cursor ...
0
votes
1
answer
77
views
Some key events prevent others from firing
First, here's the live application I'm working on as a study: turbo_synth
I'm making it using VueJS, however, I believe the issue is unrelated to Vue.
The issue:
It all works fine and dandy, except ...
0
votes
1
answer
2k
views
keyboard EventListener in javascript
can anyone explain me how the argument e is captured and passed as a function callback which displays the keyboardEvent Object in console.
Same this can be acheived by using
() => console.log(...
0
votes
1
answer
806
views
JavaFX how to use AnimationTimer in separate class?
I've seen many examples that write AnimationTimer and KeyListener in Main class but not seen in another class.
I've tried How to write a KeyListener for JavaFX in "VolleyController", but I ...
0
votes
0
answers
26
views
How to get r.KeyPress to recognize double letters? [duplicate]
I am trying to write a fairly simple script to simulate keypresses repeatedly. KeyPress works, but for some reason, it won't recognize double letters, nor will it allow a loop, be it do-while, if-then,...
3
votes
0
answers
342
views
How to press right shift in java?
My program can't press right shift.
I try to use java robot for this, but my method feintOne() only twice press left shift.
At the same time, the program can determine which of the Shift was pressed ...
1
vote
1
answer
481
views
How do you use a keylistener?
It seems I can't make my program to notice the fact that I'm pressing a button. I've seen at a lot of tutorials and images and I think this code should work but it just won't. Can anybody help me?
...
0
votes
0
answers
61
views
SlickGrid keyboard navigation on headers
Is there a way to do SlickGrid keyboard navigation on frozen headers? I have a slick grid spreadsheet and can use the keyboard arrows inside the context. Now I want to use the keyboard arrows inside ...
1
vote
1
answer
597
views
keylistener is not responding to any keys?
I am trying to code a simple keyevent for a player movement script that would respond the the "w" key. I hope to eventually make it do something like move the character but for now im just trying to ...
0
votes
0
answers
25
views
Java: allow standard text operations in KeyEvent [duplicate]
I'm writing custom processKeyEvent(KeyEvent e).
First of all I want only digits to be processed, so my function looks like this:
@Override
public void processKeyEvent(KeyEvent e) {
if (Character....
0
votes
1
answer
2k
views
Robotgo cannot listen to more than one event
I'm using robotgo to listen to keyboard events. I would like to add my own functions for every key pressed but I am unable to get it to trigger for more than 1 key.
So the main function looks like ...
0
votes
0
answers
103
views
How can I press several keys at the same time?JavaFX
How can I press several keys at the same time?
and the action was performed for each key
that is, I want to hold down a few keys on the keyboard so that the keys on the piano fall simultaneously
I ...
0
votes
1
answer
80
views
Run the JButton when a KeyEvent has been pressed
frame.addKeyListener(new java.awt.event.KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
System.out.println("Key typed = " + e.getKeyChar());
if(e....
0
votes
1
answer
390
views
Android 10 adb shell input keyevent returns 0
I'm trying to use ADB shell input keyevent 1000 to test my custom hardware device in android 10, but it returns 0 in ADB log.
Secondly, I found ADB shell input keyevent 288 returns keycode 288, ADB ...
3
votes
1
answer
1k
views
Material UI Popover - keydown event simulation issue
The task is to navigate in a dropdown list via arrow keys instead of TAB/TAB+SHIFT. One of the ideas was to replace key down events of arrow keys to simulate TAB/TAB+SHIFT key down. My approach comes ...
0
votes
0
answers
141
views
Preventing a KeyEvent system close highlighting an app
I currently have an app using a remote keyboard that when the 0 button is pressed it closes out the app. However when the app closes it highlights the first app on the home screen. Is there a way to ...
0
votes
1
answer
74
views
Command Bindings don't work with 2nd window/ view
I have a WPF-Application with two windows as Views (MVVM). With the first one binding of commands works out quite fine though with the 2nd view commands don't trigger (both windows access the same ...
0
votes
1
answer
271
views
What API level is needed to get KEYCODE_HOME KeyEvent in AccessibilityService?
Pressing the physical home buttons of two test devices results in getting the KEYCODE_HOME KeyEvent in my AccessibilityService only on one of the devices. Same manufacturer, different model, different ...
0
votes
0
answers
21
views
Keep simulated Keypress inside application (java)
I am developing an extension for a java Program to automate a task.
For that I need to simulate Keyevents that stay inside the Application.
If I use the Java.awt.robot Api the keyevent is sent to ...