Questions tagged [keyboard-events]
An event that is triggered when a Key is pressed on a keyboard input device
2,219
questions
1
vote
0
answers
33
views
edit datagridview cell to acept decimals number with dot separator
I want to edit a datagridview cell to be able to write decimals numbers but with only a dot for decimals separator, BUT if the user try to write a dot as a separator, I want to change the dot for a ...
0
votes
0
answers
20
views
HTMLAudioElement exclusively intercepts all keyboard events - how to override?
I have a very simple media player web-page with audio tag. It's necessary to provide a user with keyboard shortcuts, which would work consistently throughout the page, irrespective to what element is ...
0
votes
0
answers
33
views
How to move an HTML element diagonally (only with js if possible) [duplicate]
I want to move an img diagonally with js, right now i can only move up, down, left and right.
This is my code right now to move up, down, left and right
naveJugador (playerShip) the img i want to move
...
-2
votes
0
answers
29
views
Why does `xev` and `evtest` output different keycodes
I am using NixOS with wayland and inside a terminal I launched xev and evtest (USB Keyboard: Logitech MX Keys).
If I select the standard (English US) and press the A key.
xev reports keycode 38:
...
-1
votes
0
answers
14
views
Creating a React.js chat app; on iOS, clicking the chatbox shifts the header with the keyboard. Any solution for ios default browser behavior?
I'm developing a React.js web chat app and facing issues on iOS where clicking the chatbox triggers the keyboard, causing the header to move up and become hidden but it works fine in android. Any ...
0
votes
0
answers
26
views
How can I capture the same keyboard event from different threads using crossterm in rust?
I have a loop which spawns a set of threads. Each thread is listening to a different key. I want to do something in each thread based on the character pressed event.
This is the function I am using. (...
0
votes
0
answers
53
views
VS Code Integrated Terminal does not recognize mapped keys in Linux
I have Ubuntu22 with Wayland and VS Code v. 1.84.2.
I have mapped certain keys with the keyd tool (https://github.com/rvaiya/keyd, you can read more about my keyd configuration in https://www....
0
votes
1
answer
53
views
how to do character control on w a s d?
I made the mouse control, however, when I use onkeydown instead of onmousedown, the character moves for a few ms and stops, and when the button is released, the character gets into the idle animation.
...
0
votes
0
answers
12
views
Is there a way to limit Python's keyboard.add_hotkey() to trigger only once per keystroke?
import keyboard
def on_c_pressed():
print("C key was pressed")
keyboard.add_hotkey('c', on_c_pressed)
Current situation is that it fires rapidly as the keystroke is actuated and being ...
0
votes
0
answers
15
views
Keyboard event listener in React causing unnecessary re-render [duplicate]
The Keyboard listener used in my app is causing unnecessary re-renders. When I input values using button click everything works as expected. But with keypress, the value of the exp variable is set ...
0
votes
1
answer
57
views
Ctrl + ' (single quote) does not send a key sequence on keydown, and VSCode can't toggle line comment
I am trying to toggle line comment in VSCode, but the command isn't working. When the keyboard layout on Windows is Norwegian QWERTY, then the keyboard shortcut is mapped to ctrl+' (or ctrl+oem_2). ...
0
votes
1
answer
53
views
How do I use both keyboard return keys in python code, I can bind the main, but not the numeric return
...
PSG.theme('Dark Blue 3')
PSG.set_options(font='Arial, 14')
layout = [
[PSG.Text("What book ISBN would you like to find?"), PSG.In(key='bisbn')],
[PSG.Text(&...
0
votes
0
answers
21
views
X11 keycode vs keyboard mapping
I use Ubuntu 20.04 and QWERTY US layout. I have created a X11 application. When I press 'y' on the keyboard I get KeyPress event and XKeyEvent structure contains keycode '29'. I have always thought ...
0
votes
0
answers
32
views
Creating keyboard events that interact with different language input methods
I have a Mac app which needs to generate keystrokes and am doing this with CGEventCreateKeyboardEvent(), CGEventKeyboardSetUnicodeString() and CGEventPost(). This works fine with English, however if I ...
0
votes
0
answers
20
views
Tab button navigation feature is not working as expected in agGridReact table's row with multiple custom dropdown cell renderers
I am using custom dropdown cell renderers in ag-grid-react table (i.e. Autocomplete and few columns are editable).
here is reference columns
whenever I am trying to edit the column with help of tab ...
0
votes
0
answers
35
views
How to navigate between nodes in JavaFX?
I have a search box in my JavaFX application that searches content from a database and returns the details as nodes. I want to be able to go up and down between the returned nodes with the keyboard up ...
0
votes
1
answer
30
views
How to read a single CLI keypress from Python 3 on Unix without requiring ENTER or root privileges?
The problem described in the title is, apparently, incredibly hard. Every solution I have found for it (and there are dozens of them in SO alone) is inadequate for at least one of the following ...
0
votes
0
answers
31
views
Android WebView Capture Keyboard Enter and Close Keyboard
I have a WebView in my Android app. The WebView has a basic number input in it. Currently when you hit enter, the keyboard stays open and the calculations take place.
But the calculations get ...
0
votes
0
answers
21
views
Detect keyboard and mouse events when not on browser tab
I am building an web app in nextjs which capture screenshots of users who are working on a project (like upwork) where i want to calculate idle time of user. For this to work i want to detect the time ...
0
votes
1
answer
35
views
React native screen size changes and whole layout shrinks when keyboard pops up
this is normal layout
this is whats happening on keyboard pop up
this is the code for layout
import React, { useState, } from 'react'
import { useNavigation, } from '@react-navigation/native'
...
-1
votes
1
answer
38
views
Dispatching captured events works but not when I've created them myself (HumanBenchmark)
So I've been trying to get the highest possible score on the Typing test on HumanBenchmark but ran into some oddities when trying to dispatch custom keybaordEvents.
I only got it working if I captured ...
-1
votes
1
answer
43
views
How do I trigger the "Next" option between 4 input fields?
I have a simple web-app for inputting a few text fields and then outputting those fields into an image. Currently, the variables are set up to only take uppercase alpha (no punctuation or numbers) but ...
1
vote
1
answer
28
views
Pynput Listener is not calling on_press function
I'm using pynput.keyboard.Listener to listen for keyboard input. The function that is passed to its on_press or on_release arguments is never called after starting the Listener thread although the ...
1
vote
0
answers
62
views
How to move pixels at the same time in x86 assembly? [duplicate]
I have to make a tron like game with two players where one player moves with wasd keys and the other with arrow keys.
I have the following logic in the keyboard handling
move_players proc
...
0
votes
1
answer
38
views
Making Enter Work Like OK Click In C# WPF Project
I have an OnPreviewKeyDown method which executes an async method when the Enter key is pressed. When the user presses Enter, I try to move the focus away and execute the action (vm....
0
votes
1
answer
131
views
How to listen for key press in Flutter
I am trying to detect the physical key press of a button. This button is on a Scanner with Android installed on it, and the press is registered as a F16 key.
I am able to detect key presses but ONLY ...
0
votes
0
answers
53
views
InputBot binding not working when I have a Slint window running in a different thread
I'm using Slint to build a UI for my small Rust application and part of the functionality of the application is listening for global keyboard events so that the UI doesn't need to be in focus for it ...
0
votes
0
answers
72
views
ReactQuill + quill-mention tab key not behaving as expected
Preface: This question is related to a React component using ReactQuill & quill-mention, where the tab key doesn't behave as expected.
After pressing the tab key, the p element inside gets set to ...
4
votes
0
answers
28
views
Unable to handle(Keypress) modifier keys in android studio's emulator
I have an EditView in which I have set the below OnKeyListener to record the ctrl + left arrow key and ctrl + right arrow key.
val MyKeyListener: View.OnKeyListener
MyKeyListener = object ...
0
votes
1
answer
56
views
JavaScript presses Dead key twice, passes input validation allowing only numbers to be entered
Good morning everyone, I have the following function that validates that only numerical characters can be entered in a text input. The problem is that if I press the Dead key twice, '´ is entered in ...
0
votes
0
answers
24
views
Word Online, Chrome Extension dispatching keypress event issue
Here is my code for my extension. I would like to be able to type or edit the word page content from JS using either KeyboardEvent or execCommand, I feel, I'm very close as I can fire double-click ...
0
votes
1
answer
164
views
Solid.js textarea: detect key or access native keyboard event
Consider this snippet (playground):
<textarea onInput={event => {
console.log(event.key) // TypeScript error and undefined at runtime
setState(event.currentTarget.value)
}} />
I want to ...
0
votes
2
answers
59
views
Call a function on Keydown
On document ready, this function performNext calls fine:
$(document).ready(function() {
performNext();
});
performNext function hides a current fieldset and shows a next one, my question here is an ...
0
votes
0
answers
29
views
Smooth Grid Based Movement withJavascript
I am creating a grid-based movement RPG game that transitions from a 16-pixel tile to the next 16-pixel tile. The problem is that it is not smooth while switching keys and sometimes randomly slows ...
0
votes
0
answers
73
views
PyQt/PySide: Handle Barcode Reader Input
In my GUI (written in PySide 6), I want to allow user input through the keyboard (e.g., in a text field), and I want to handle input from a barcode reader (e.g., scanning of a barcode runs a bunch of ...
0
votes
2
answers
87
views
How can and where should I add an onKeyDown event Listener for my "Save Employee" button in ReactJS?
CodeSandbox Repo
I would like to listen to keyDown events, specifically, the key S so users can easily save a randomly generated employee conveniently instead of clicking the Save Employee button ...
4
votes
1
answer
108
views
JS IME composition and Mac accent menu handling in custom input field
Working on a project where handling various languages (Japanese, Chinese etc.) as well as handling different language directions (right-to-left, left-to-right and the combinations of the two) is ...
0
votes
2
answers
85
views
how to detect a Key Sequence in Javascript
i am writing an userscript that post in a forum each time a shortcut sequence is executed [ ctrl + enter ], but the function that i wrote excecutes both keydowns as separate events, and not a single ...
0
votes
2
answers
118
views
How to Show System Emoji Keyboard in Android?
I have task to select Emoji from System Emoji keyboard and show in EditTextView.
Tried below inputType:
android:inputType="textShortMessage|textAutoCorrect|textCapSentences|textMultiLine"
...
0
votes
1
answer
39
views
How do I use QTest::keyClick with control characters?
I am trying to simulate user input to close a window. I try to use QTest::keyClick(Qt::key::Key_F4, myWidget, Qt::KeyboardModifiers{ Qt::KeyboardModifier::AltModifier }); to simulate the user ...
0
votes
0
answers
32
views
Ctrl+Alt+Key combinations not received by TextInput
I dont receive keys with the mentioned modifiers. See the MWE below. How can I make these work? I am trying this on MacOS. Playing around with the keys shows that I receive release events only.
import ...
2
votes
1
answer
125
views
How can I let users interact with a toggle button using the spacebar and enter key?
I made a toggle button using the label of a checkbox after this example. Users should be able to control the toggle button with both their mouse/trackpad and their keyboard. Mouse/trackpad controls ...
0
votes
0
answers
54
views
VB.NET windows forms with function to blocks special keys, how to add an exit shortcut
With the following code I block the special keys like ctrl, alt, shift, etc.
Then in KeyboardCallback I added a case when F8 key is pressed to force-close the form. What if I want to make a more ...
0
votes
1
answer
37
views
stop focusin multiple times angular?
The issue I am facing is that focusin events get triggered again sometimes on keydown. I would like to stop triggering again the focusin event again on keydown . Do you know how it can be possible? I ...
1
vote
0
answers
103
views
How to listen to keyboard when app is in background in flutter
I'm trying to listen to keyboard keypress events when the app is in background. This snippet can only listen to keyboard when app is active.
var pressedKey = '';
int count = 0;
@override
void ...
0
votes
1
answer
47
views
How to heuristically discover Javascript input autocomplete key* events
I recently had a requirement to enforce Proper-Case in a HTML input field. CSS Text-Transform: Capitalize was 90% there but didn't down-case multiple caps. So I wrote the Javascript below.
To my ...
1
vote
0
answers
151
views
In Quill.js, I want Enter to submit messages and Shift + Enter to create a new line
I have a React app with Quill version 1.3.7.
For context/refresher: The default behaviour of Enter in a Quill text editor is to create a new line. I want to change that.
I wrote the below function so ...
0
votes
0
answers
38
views
How do I detect simultaneous key presses?
Context: I'm trying to make a python script that detects single key presses for WASD and simultaneous key presses for (w and a), (w and d), (s and a), (s and d). I'm using the pynput library and I've ...
5
votes
0
answers
788
views
IOS- Show keyboard on input focus
I have an input box in react, I have passed the focus prop to make the input focused when someone lands on the component.
On Android, it works well, it focuses the input and pops up the keyboard.
On ...
1
vote
4
answers
45
views
Javascript, keypress if i use it when i want user input to be added in a list only one character i.e., the latest pressed key shows up
i wanted to add a userinput in a todo list using keypress but only one character is taken by the input filed.
this is the code:
input.addEventListener("keypress", function(event){
...