1,464 questions
1
vote
1
answer
104
views
How to distinguish between OS-triggered vs app-simulated input events in Android?
I’m working on an Android project where I need to handle user input events (KeyEvent, MotionEvent) consistently.
Sometimes these events come from real user input (keyboard/touch), and other times I ...
0
votes
3
answers
93
views
How to use a key event without pressing a key every time?
I am building a simple game where the ground moves when a user pressed a space bar once. My problem is that the ground does not move if I do not press a space bar.
I want the ground to move from the ...
1
vote
3
answers
358
views
How could I detect key events in the terminal using C?
My operating system is Arch Linux and my desktop environment uses Wayland. I've been trying to make a small renderer in the terminal which moves the camera around using WASD. I've disabled canonical ...
0
votes
1
answer
180
views
Sending key events (INJECT) in my Android app without root access
I'm working on an Android app that needs to send key events (simulate keyboard input) using the INJECT permission. However, when trying to do so, I receive an error indicating that my app doesn't have ...
0
votes
0
answers
42
views
Firebase Console: Unable to Access Explorations Data
I use the following code to report key events and custom definitions.
Bundle bundle = new Bundle();
bundle.putString("CustomLog", "TEST" + System.currentTimeMillis());
...
3
votes
2
answers
98
views
Issue with java.awt.Robot KeyEvent for Special Characters (e.g., : and /)
Description:
Hello everyone,
I'm working on a Java application where I use the java.awt.Robot class to simulate keyboard input. It works fine for most characters, but I'm encountering an issue when ...
0
votes
1
answer
51
views
Recognize the exact process that sent the keystroke in Python
I'm trying to build a program that recognizes keystrokes and also the exact process that sent it, so the source.
For example, if I press the character 'g' on my keyboard, it should recognize the ...
0
votes
0
answers
46
views
How can we dynamically configure the Firebase keys through FirebaseOptions instead of putting the google-services.json file into the project?
I want to configure Firebase dynamically so that anyone who uses my project can use the configurations in their own google-services.json files. Here's what I've done: I put the google-services.json ...
0
votes
0
answers
48
views
Timer for reproduces movement
I’m trying to program the game "Gravity Guys", in this game the player runs forward and can change the gravity only when it touches surface. There is an enemy player following him and if he ...
0
votes
0
answers
61
views
Java KeyEvent and ArrayList Issue
I am writing code for a personal project that takes data from a CSV file, and passes it to an editable JCombobox that then displays names of airports.
Having done that - I want to write the quality of ...
0
votes
1
answer
24
views
How to get correct accents char within javascript on Ubuntu?
Surprisingly, this simply code:
<!DOCTYPE html>
<html>
<body>
<h1> Keyboard input test</h1>
<script>
document.addEventListener('keydown', function(event) {
...
1
vote
3
answers
278
views
Check if "shortcut" key is pressed on action event
I'm trying to detect when a button's action is triggered (which could be through clicking or something else like the keyboard) while the "shortcut" key is pressed. I couldn't find a way to ...
0
votes
0
answers
53
views
Scenebuilder onKeyPressed not calling method in controller
In my implementation, I utilize the onKeyPressed event to invoke the letterTyped function within the Pane situated at the top of the FXML file. Whenever a key is typed, my expectation is to have the ...
2
votes
1
answer
251
views
How to completely hide the keyboard/infrared scanner/keyevent
I am developing a project for a Portable data terminal, which is a smartphone with Android OS and a built-in infrared scanner. The IR scanner works as follows: the scanned data (for example, the ...
1
vote
1
answer
59
views
Why are my KeyCode/KeyEvent functions returning either as an invalid character or "UNDEFINDED"? (JavaFX) [closed]
I am very new to JavaFX, and I am trying to work with KeyEvents and KeyCodes. Researching on how to use these properly, I looked at this webpage for how to do that.
I (somewhat) copied it's code to ...
0
votes
0
answers
165
views
Backspace key does not trigger any event in a virtual keyboard on an embedded device
When I run my Qt application on a desktop, the virtual keyboard works fine, but when I run it on an embedded Linux device, the backspace key doesn't work at all.
I have installed an event filter to ...
0
votes
0
answers
73
views
No key / motion events triggered from connected game controller in Android Activity
I am developing a game for Android. Want to add game controller support.I read documentation how to add it. https://developer.android.com/develop/ui/views/touch-and-input/game-controllers, but nothing ...
0
votes
1
answer
94
views
Rotating an Animated Image on Key
I am having a problem with rotating an animated image on key. I do not quite understand big-bang functions and have lost hope.
This is my code:
(require 2htdp/image)
(require 2htdp/universe)
;; Found ...
1
vote
1
answer
209
views
Ctrl+Shift+End android input keyevent
I would like to select all the text to the end by adb
input keyevent --longpress 114
input keyevent --longpress 59
input keyevent 93
To select all text to the end but it didn't work.
Maybe Ctrl+Shift+...
1
vote
0
answers
208
views
Flutter: Inconsistent KeyEvent Behavior with Barcode Scanners on Different Android Devices
I am facing an issue with inconsistent KeyEvents while using barcode scanners on two different Android devices. The first device is a Cipherlab scanner running Android 9, and the second one is a Zebra ...
1
vote
1
answer
1k
views
Flutter Focus onKeyEvent triggers for both key down and up
The Focus widget in Flutter can detect and handle KeyEvents. However, it will trigger on both key down and up events (so it calls its assigned callback twice for each press). Given a KeyEvent, how can ...
0
votes
1
answer
250
views
How can I disable keyboard input while a timer is running?
In my code, when detecting an arrow key the character will move accordingly. This is done through a Timer and TimerTask to schedule "movements" of the character. However, when another key is ...
0
votes
0
answers
26
views
How to get the contenteditable target of a keyup event caught by a parent element in shadow root?
I created a shadow root in the content script of a Chrome extension, and in the shadow root I created a container with id 'container' containing three elements, namely 'parent-1', 'parent-2', and '...
-1
votes
1
answer
73
views
How to act only on first KeyEvent
I'm working on an app, where I show a question and a person can answer by using the arrow keys for yes/no, which loads a new question and so on. This works well, but I'm trying to implement a ...
0
votes
0
answers
96
views
JavaFX: How do I write a KeyEvent handler for movement that isn't in the initial scene?
I'm trying to learn JavaFX by making a Pong game. I want my third scene to have KeyEvents for paddle movement, but everything I find has it in the initial scene and I can't figure out how to utilize ...
0
votes
1
answer
176
views
Why KeyEvent getCharacter returns a string not a character
Based on my understanding, the getCharacter() method of KeyEvent should return a char type.
For example, if I have to check if the typed key is a digit, I can just use Character.isDigit(e.getCharacter(...
0
votes
1
answer
292
views
How can I apply a transformation several times on a vispy mesh object?
I am trying to rotate a cube by pressing 'z' on my keyboard using vispy.
However, I would like that cube to rotate everytime I press 'z', which is not the case right now : it only rotates the first ...
1
vote
0
answers
64
views
Javascript, Compose Key and Linux
The intended application is a simple typing practice program, for reference.
At present, things work fine in Windows, I've not tried on macos,
but under Linux I can't handle source texts with accents.
...
1
vote
2
answers
78
views
Can't add onkeydown attribute to dynamically created input
HTML:
<form id="form">
<div class="form-group" id="df2">
<input type="text" class="form-control" name="atribut[]" ...
1
vote
1
answer
5k
views
How to add a keydown Event Listener for a react functional component
I'm trying to 'move' in my 10x10 grid by updating the activeCellId state. However none of the methods I tried works. This is my code.
const GridCells: React.FC = () => {
const gridArray = [......
0
votes
1
answer
216
views
How to stop regex from picking up character matches when Ctrl, Shift, etc. are pressed?
I was tasked with making a code that picks up when a key is pressed and counts the number of characters typed. I decided to use var regex=/[a-zA-Z0-9]/;, but to my surprise, when I pressed Enter, ...
1
vote
0
answers
70
views
How to use PC keyboard during Remote Screen Sharing using Android app?
We have a remote screen sharing option in our android app for Android TV devices. We use OEM API to trigger some of the key and button events by passing the constants defined in the android.view....
0
votes
1
answer
463
views
How to stop the music when the s key is pressed?
My program plays music when I press the space bar. How to stop music when the s key is pressed?
import pygame, sys
from pygame.locals import QUIT
def main():
pygame.init()
#Intalise
...
1
vote
1
answer
44
views
How to delay with use of keyevent?
I want that when I press and hold space button that the spaceship's bullets shoot every 2 seconds. Now if I press and hold space button the spaceship shoots lots of bullets in one line. How can I fix ...
0
votes
3
answers
278
views
Is it possable to send keydown event and key up event?
is there a way to send a key down and key up event in Lua? Is it possible? (This is my first time asking a question here, I'm so nervous '~')
I want it to help you auto-press the key without you ...
0
votes
2
answers
322
views
CGEventPost doesnt work in compiled mode on MacOS 12.6 but works in interpreted mode
I'm trying to programmaticaly send a custom key event (function keys, media keys) but it only works in interpreted mode, not in compiled code.
I tried using the following answer:
emulate media key ...
0
votes
0
answers
40
views
How to communicate between two different applications (Web Application and Console Application) using Ctr+c , Ctr+v , Entre [duplicate]
I have two application one is a web application and the onther one is a console application,
the Console application generates a Data and that Data must be transfered to the webapplication, i tried to ...
8
votes
1
answer
2k
views
Listen to Keyboard Events in Flutter for IOS
I am trying to build logic based on detecting user keyboard events (e.g., when a user presses the backspace in a textfield). This seems to work on my builds for Android devices, but is not working for ...
0
votes
1
answer
239
views
Android EditText COMMA or DOT key event
How can I detect comma or dot key event for a editText? I've tried using setOnKeyListener, but setOnKeyListener can detect digits, delete, done buttons not detecting comma and dot. I want to detect ...
0
votes
0
answers
74
views
Key Event does not detect when i press a key [duplicate]
Why doesn't in detect my pressed Key? Nothing happens. The program doesn't tell me when i press w and it doesn't stop when i press escape.
main class:
package awd;
import java.awt.*;
import java.awt....
1
vote
0
answers
236
views
adb shell keyeven 279 check_output returns none
I've made a similar question, but was explained bad. I deleted it and I'm making this one.
Basically my task is to press a button on an android emulator, this button will copy a text, I need this text ...
1
vote
0
answers
27
views
Predressed key detection using Python
Can the ability to detect keys that have been pressed due to software, hardware, drivers, etc. be used as specific modules or implemented with Python?
ex)
import @@@
@@@.pressed_key()
>>> [&...
1
vote
1
answer
1k
views
Implemented a QKeyEvent but how does the keyPressEvent() gets called
keypress.h
#ifndef KEYPRESS_H
#define KEYPRESS_H
#include <QObject>
#include <QKeyEvent>
class keypress : public QObject {
Q_OBJECT public:
explicit keypress(QObject *parent = ...
2
votes
0
answers
477
views
React Native Expo - How to get Zebra Scanner pressed keyboard value without text input
I'm trying to develop React Native Expo app on Zebra Scanner OS android. I want to listen pressed F Keys or any physical keyboard events on main screen without text input. So far I tried couple of npm ...
0
votes
1
answer
105
views
appJar keyboard events while the window is not focused - Python
I'm trying to write some code that checks if any keys are pressed while we have a GUI with appJar and it's not focused. So if the "v" key is pressed it will write something to the console ...
0
votes
1
answer
184
views
Detect shift + copy keystrokes in javascript
i'd like to handle keystroke combination of shift + copy. what i am doing is checking if keystrokes shift + cmd + c are all keydown, which is effectively shift + copy.
var keyPressed = {};
window....
2
votes
4
answers
3k
views
adding a keyboard shortcut to your button in vuejs
I have a button that does something when clicking on it with mouse. I want the same method to also be triggered when pressing on your keyboard's up arrow key.
<button @click="doSomething()&...
-1
votes
2
answers
535
views
How to validate or sanitize arabic number input-data?
My task is to allow users to type arabic text in my input field, however they are unable to do so due to a function named isNumber() in the code. Without the isNumber() function, the users are able to ...
0
votes
1
answer
49
views
Key compination at pygame
I'm using this python code https://gist.github.com/seankmartin/f660eff4787b586f94d5f678932bcd27#file-keyboardpress-py to get time for keyboard events. It's working well, but I need to get KEYDOWN and ...
-2
votes
1
answer
186
views
Keyboard on view event is not working by Kotlin
Coding is easy for Keyboard event handling by Kotlin if write the following code
override fun onKeyUp(keyCode: Int, event: KeyEvent): Boolean {
return when (keyCode) {
KeyEvent....