1,464 questions
0
votes
0
answers
603
views
Java Get the last key pressed
I'm trying to make a hotkey to control some code but am struggling to access the last key that has been pressed on the keyboard.
I have this setup to save the key code from the last key press:
import ...
0
votes
1
answer
359
views
How to display specific gif based on key press event using Pyglet?
Code I got so far
import pyglet
from pyglet.window import key
animation = pyglet.image.load_animation('/home/arctic/Downloads/work/gif/ErrorToSurprised.gif')
animSprite = pyglet.sprite.Sprite(...
1
vote
1
answer
2k
views
Blazor modal dialog has not focus
I have a custom dialog in Blazor. It basically works fine but has some flaws:
When tabbing with keyboard focus jumps between controls on underlying page and not inside dialog.
When clicking Esc or ...
2
votes
1
answer
2k
views
What does VK stand for in Java's KeyEvent class?
I would like to know, what does VK stand for in java?
Here is an instance code in order to give you a brief idea where it is used:
public void keyPressed(KeyEvent e){ if (e.getKeyCode == KeyEvent....
0
votes
1
answer
520
views
Multiple key register event PyQT5
I have a program programming with Pyqt5 in which I would like to register some keys simoultaneously;for example, up+right to go to the upper diagonal.
The problem is that with the pressEvent only ...
-1
votes
1
answer
483
views
Edit text from a specific line at text area when a key is pressed using javafx?
So I'm working on building a text editor using java, javaFx, I have to open a file in the (Editor VBox) and put the lines in a double linked list, then edit, delete, overWrite a line etc.., I made a ...
3
votes
2
answers
2k
views
How to perform own action on a key press in UI5?
I don't know how to replace the F5 key action in SAPUI5.
I have a button "Refresh" which is reloading my business data in the UI and made some kind of manipulation before showing it on the ...
0
votes
1
answer
46
views
Is there any way to press ENTER by clicking jButton to pass a event to a jTextfield?
I have coded for multi Jtextfields in my project and used KeyPressed Events for each fields for Enter Key. Now I use a Touch Monitor.And now I want to Use a button and do the same thing by pressing ...
0
votes
1
answer
364
views
How can I change focus between components
I created A Jframe that consists of Jbutton (Ok),Jbutton(cancel) , Jtextfield and a Jtable .
I want when press on OK button , focus changes to Jtextfield, and when press a gain , focus change to ...
1
vote
1
answer
123
views
reveal.js keyboard mapping / java script key event codes ; don't add up
I don't understand how I get the "correct" key codes for configuring the keyboard map of reveal.js. Some integers work, like 27 for escape, others don't like I need Period (.) and F5 for a ...
0
votes
1
answer
208
views
JavaFX KeyEvent doesn't do anything
So I have a little program where you can fly your spaceship between planets and I want to use the arrow keys to rotate the ship. First I tried adding the key listener to the panel and the ship did ...
0
votes
1
answer
1k
views
When a key is pressed, the event occurs twice
When I press a key using keyEvent, then I call the function, it is below.
const GeneratedKey: FC<IGenerated> = (props) => {
const [keyBoard, setKeyBoard] = useState("")
...
1
vote
3
answers
485
views
javafx checkbox clicked while key pressed will not change state
I have a very simple problem, which I can't find in any other posts :
In javafx15 / java15.0.1, I am trying to click a Checkbox while pressing, for example, the CONTROL key... State is not changing.
I ...
0
votes
0
answers
113
views
Editable ComboBox cleared when i pressed space or arrow buttons - JavaFX
I am making a Editable ComboBox which show any values contain the input and it works fine.
But the problem is in the input field, whenever i typed Space or arrow buttons the input field keep reseting.
...
0
votes
1
answer
124
views
I want key `A` to be held for at least three seconds without a break. Make sure that is the case
I want key A to be held for at least three seconds without a break. If the key press is interrupted, the three-second period should apply again.
This is my previous program. Unfortunately, while the ...
0
votes
0
answers
2k
views
Android TV - Switch to HDMI input programatically
Is there a way to switch to an HDMI input programmatically on Android TV? I.e. a Smart TV, not a separate box.
What I was trying is to send a key event like this:
# `someButton` is a button on the `...
1
vote
0
answers
217
views
Espresso pressKey(KeyEvent.KEYCODE_CAPS_LOCK) not working
This works:
onView(withId(R.id.textView)).perform(replaceText("THI"))
onView(withId(R.id.textView)).perform(
doubleClick(),
pressKey(KeyEvent....
0
votes
1
answer
986
views
How to bind key "<" in tkinter?
My code:
from tkinter import *
import tkinter as tk
root = Tk()
def Hello():
print("You press '<' key")
root.bind("<", Hello)
root.mainloop()
But I receive error:
...
2
votes
2
answers
3k
views
Correctly binding the tab key in tkinter
I'm trying to override the standard behavior of the tab key inside the tkinter text widget. I was trying
from tkinter import *
def enter_return(event):
print("Return")
def enter_tab(...
1
vote
1
answer
250
views
Jump n Rows Up or Down in DataGridView on KeyDown or PreviewKeyDown Events
I have trouble implementing arrow key navigation of a DataGridView (no datasource used).
The DataGridView has 2 different type of items, most of the time every second item is of the first type, vice ...
0
votes
1
answer
122
views
Android dialog closes on any physical keypress
I have this dialog, with just a textView and no buttons. It displays some info and I need to change info on key press left and right. Unfortunately the dialog closes on any key.
This code in ...
0
votes
1
answer
2k
views
Simulate "shift" pressing key on checkbox to select multiple rows
I have the following input
<input type="checkbox" checked={isChecked}
onChange={handleOnChange}/>
and my function is this
const handleOnChange = () => {
let element:any = ...
0
votes
1
answer
72
views
Can't use KeyDownEvent after adding Button [duplicate]
I used Winform in C# Visual Studio. At first I had an OnKeyDown and it worked well. After this i added a button to the form. I dragged the button from the toolbox and doubleclicked on it. Then it ...
0
votes
2
answers
98
views
Move JButton every click (KeyEvent)
I was trying to create a simple game. For this, i created a JButton that moves down and up, but it only works one time when i click the Down and Up arrows. Can i make it moves every time I click these ...
0
votes
0
answers
36
views
getting ArrayIndexOutOfBoundsException when comparing char array to KeyEvent
I am building a JavaFX typing application and am trying to check if the user input matches the letters they need to type. I am doing this through a KeyEvent and comparing that individually to the ...
1
vote
1
answer
126
views
How to use event.code and event.button in if, else condition properly?
my goal is to build playing drums using vanilla Javascript, whole code worked perfectly when I was using only the keydown event, unfortunately, my drums have to play also on mouse 'click'.
When I ...
0
votes
1
answer
484
views
How to add key event listener to google docs
I am working on a chrome extension which disables backspace; it doesn't work in google docs.
https://github.com/tuminzee/disable-backspace
manifest.json
"name": "Disable Backspace&...
2
votes
1
answer
1k
views
KEYCODE_MEDIA_PLAY_PAUSE intercepted by Google Assistant
I wrote an Android app with a button that raises KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE to control third party media player apps. This works perfectly for several days or weeks, but then the key event ...
0
votes
1
answer
74
views
How to get a KeyStroke working for a JLabel like it does for JButton?
I have a login form like this image.
The login button it's a JLabel with an icon. I want to be able to press "ENTER" and login.
I've put the login logic into a method called doAction(); I ...
0
votes
3
answers
174
views
jQuery event trigger is not working on annotorious and seadragon
I am trying to get the down arrow keyup event to fire automagically using jQuery. The annotorious/seadragon combination has a listener that opens all preconfigured tags when I press the down arrow.
I ...
0
votes
1
answer
3k
views
Java TSM AdjustCapsLockLEDForKeyTransitionHandling
I am trying to capture up,down,right,left keys from KeyEvent, and I am getting following message when I press a key:
2021-06-05 00:46:11.176 java[47646:1823153] TSM ...
0
votes
1
answer
473
views
Matplotlib figure key_event connection after closing window in recreating loop
I have the following minimalistic code that works perfectly fine: a continuous while loop keeps plotting my data and if I press the escape key the plotting stops. Now, if one closes the matplotlib-...
1
vote
1
answer
1k
views
How to differentiate between @click and @keyup.enter in vue?
I have the following button:
<button @click="toggleModal" @keydown.enter="toggleModalWithFocusTrap">
It seems to me that in vue both events click and enter are equivalent. ...
3
votes
1
answer
11k
views
How do I solve AdjustCapsLockLEDForKeyTransitionHandling?
I am trying to use KeyListener to input information, such as using the arrow keys to move an object in a plane, but as soon as I press my first key, the error below is thrown:
2021-05-20 09:55:35.400 ...
0
votes
0
answers
114
views
How can I catch the key-double-click events in MFC?
My application is trying to detect when a user double clicks the back quote (`) key on the keyboard. How do I do it?
0
votes
1
answer
327
views
How to override ScrollPane’s default arrow key behavior
I want arrow keys in a ScrollPane to work in a way other than the default. Consuming arrow keys in a KeyPressed handler on the ScrollPane does not prevent them from being processed by he ScrollPane. ...
0
votes
1
answer
70
views
Custom JTextField bug when trying to process minus key
I made a custom JTextField to input numeric values. The class looks as follows:
import javax.swing.*;
import java.awt.*;
import java.awt.event.KeyEvent;
public class JNumberField extends JTextField {
...
0
votes
1
answer
5k
views
`e.getModifierState is not a function` error on triggered keyup event
I am trying to detect whether the client has their CapsLock enabled by temporarily creating a hidden input field, triggering a keyup event on that input, and then checking the boolean value of e....
0
votes
0
answers
239
views
Why does my KeyPressed event randomly stop working?
I am new to Java, and am trying to learn GUI basics by making a simple application.My application is just a simple button that, when clicked, changes its name to the number of times it has been ...
3
votes
0
answers
527
views
VBA Class Module to navigate Between ActiveX Controls on a Sheet by pressing TAB key
Trying to Accomplish: There are a few TextBoxes and ComboBoxes (ActiveX Controls) arranged in order on an Excel worksheet (Sheet1) like a UserForm. I would like to navigate between these controls by ...
5
votes
1
answer
1k
views
Adding a macOS app to the list of accessibility in privacy system preferences
I am working on a macOS app that is a background app and so I would like to perform a particular function when a keyboard key is pressed. I read from the apple documentation that ...
0
votes
1
answer
415
views
KeyPressed letter validation and KeyEvent combination input limit not working
I need to enter a name and the textfield should accept letters and until 100 characters only so I used KeyPressed and put a letter validation as well as the input number of characters limit but when I ...
1
vote
1
answer
1k
views
how to handle multiple KeyPress events
I need my win form - vb.net, to detect if Control + P is being pressed as well as Control + Shift + P as well as just the letter P being pressed.
i have ready how this should be done, and then wrote ...
1
vote
0
answers
204
views
command line - How to listen for keypresses whilst in a input command?
I'm writing a small CLI utility in python for a test here. It's an infinite while loop that keeps an input command running.
Every time a command is inputed, it is added to the commands list, which is ...
0
votes
0
answers
13
views
Character conversion
Using Java/Netbeans. I thought this would be simple but . . .
I have a JTextArea. When I type an 'x' or 'X' I want to display 'θ'. This was easy.
I want to add "CTL-x" to display lower 'x'...
0
votes
3
answers
48
views
execute() function is not being executed when called
I am trying to make a keymap for my keyboard to not use Microsofts useless IME keyboard.
So I wrote this python code with pynput.
But it doesn't seem to execute my execute() function
from pynput....
1
vote
1
answer
511
views
KeyListener does not recognize when a key is pressed
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
public class Tastatur implements KeyListener {
private boolean[] keys = new boolean[66568];
private boolean left, right,...
1
vote
0
answers
357
views
Problem in detecting bluetooth headset media button event by overriding onKeyDown() method in react-native
I am trying to build an application that records audio which is then sent to a Speech-to-Text API to receive its transcription.
I want that the application is able to interact with a Bluetooth headset/...
-2
votes
1
answer
347
views
Javascript: Stop until RETURN key is press
I'm newbie with javascript and I'm not able to figure out how to stop and wait until return key has been pressed.
Any help is appreciated.
Thanks in advance.
0
votes
1
answer
100
views
Scan for a sound on a specific process
I wonder if there is a way to scan in Java for a certain volume in a predefined process. If this volume exceeds a certain dB value, a certain KeyEvent or MouseEvent should be executed only on this ...