1,464 questions
0
votes
1
answer
559
views
PyQt5 - Double press same keyboard key
I am handling multiple key presses by subclassing QMainWindow and overriding the keyPressEvent and keyReleaseEvent functions, and then updating a dictionary if the key is down or not...
def ...
1
vote
0
answers
55
views
Respond to volume buttons when phone is locked
I wrote an app which starts record audio in response to holding volume up button on phone or headphone, I'm doing it inside dispatchKeyEvent method and it's fine
Problem is, I want to do it when the ...
0
votes
0
answers
425
views
onBackPressed sometimes or always called automaticaly when starting activity
i have problem with my app in some devices (HUAWEI P10 Lite, rockchip A95XR3). Maybe more in future.
According to users, when opening the Video Player Activity, the app immediately crashes.
I think, ...
4
votes
1
answer
2k
views
Hot to get key events for Blazor.Extensions.Canvas
I enjoy writing my very first Blazor app. I want to move 2D graphics on a canvas, I'm using the Blazor.Extensions.Canvas assembly. Unfortunately I'm not able to get key events from the canvas.
@page "...
1
vote
2
answers
259
views
Key Évents on textbox ,button and progressbar?
I have a textbox, a button, and a progressbar. I would like the keydown event of the textbox therefore the entry, is found using a button in the progressbar, in fact I would like the number entered in ...
1
vote
1
answer
466
views
How to handle Keyboard events in VSIX?
I am working on VSIX project where I need to detect Enter key OnKeyUp event. How can I implement this in a Text Adornment project? I Need to detect the event when someone press key for changing the ...
0
votes
1
answer
50
views
WindowsForms app - keyEvent doesn't work, where is the problem?
I have little problem with my windowsforms app - its a snake game
Everywhing is ok, but after click "Play Again" button app doesn't see any kay Event (I try debug and put break point in KeyIsDown(...
2
votes
1
answer
737
views
Change cursor shape on event key
I'm trying to change the cursor shape on key event:
When i press 'C', i want to display a LineCursor,
when i press 'S', i want to display a CrossCursor, and
when i press 'N', i want to display the ...
0
votes
1
answer
109
views
Key bindings for control release not working
I have a JPanel that I need to check for the control being pressed down so that the user can select multiple things on screen, i had the issues of using a key listener so after research i found that i ...
0
votes
1
answer
110
views
Override hardware volume buttons at lock-screen (device is awake)
I have searched for a solution on SO, and while this might seem to be a duplicate, most of the similar questions are asking how to detect hardware volume keys when the screen is Off. I have found ...
0
votes
0
answers
65
views
My JPanel is unable to listen for keyEvents?
I have built a snake game where a JPanel that implements a card layout manager is placed onto the JFrame. Three other JPanels are added to the card layout.
public void init () {
JOptionPane....
-1
votes
1
answer
68
views
How can I set right KeyboardListener into my TextField in javafx Application?
I decided to create application for me. I wanted to set keyboard listener in my text field. There are 5 windows in my simple application and in the everyone has handler. All handlers different. But I ...
1
vote
0
answers
84
views
How to simulate physical volume key pressed for all apps
I want to simulate the actual volume keypress in android.
I have an app that runs in background and observers touch event. And on touch event, it should turn up the volume for the rest of the apps(ie ...
0
votes
1
answer
173
views
How to get Key Press working on two file Javafx project
I've a "driver" file and a source file for the project I'm working on right now. In my driver file I add an EventHandle to me stage.
stage.addEventHandler(KeyEvent.KEY_TYPED, shape.getKeyHandler());
...
0
votes
1
answer
134
views
Player controlled JPanel object getting stuck in certain corners of JFrame
I'm currently trying to make a java based platformer as a trial-by-fire way of teaching myself Java Swing. I currently have a JPanel in a JFrame and it is controlled by w-a-s-d. I'm currently coding ...
8
votes
1
answer
1k
views
Android KeyEvent.getCharacters() or keyEvent.characters is deprecated
As per documentation from API 29, KeyEvent.getCharacters() is deprecated, but there is no alternative that I could find for same.
As per documentation it says "@deprecated no longer used by the input ...
0
votes
1
answer
53
views
The compiler is not recognizing my input for .getPoint
We areto create a plane and have its speed increase 5mph every time the user inputs the up arrow key and decrease 9mph when hitting the down key. It is supposed it report this back to the user in ...
3
votes
1
answer
769
views
JavaFx: TextField KeyEvents are not triggered
I am implmenting a cusom component where the user can type into a TextField and a TableView is pops up then the user can look for items in that table.
I have a problem with the standard KeyEvents of ...
2
votes
2
answers
95
views
How do I respond to two different KeyEvents Simultaneously?
So I am basically creating a platformer game in java. Here is a simple question. Can I respond to two different KeyEvents simultaneously? For example, I am pressing the right arrow key and my player ...
0
votes
0
answers
813
views
Display an Alert Dialog when the user press Home Button with Accessibility Service
I created an Acessibility Service to store in FireBase every message that the user send, when the user is using an specific app (Hangouts in this case).
I am trying to display an AlertDialog when ...
-1
votes
1
answer
137
views
How do I print the whole string in KeyListener?
After storing the string into nick I want to print the string, but when I print string it only prints the last character, not whole string. How do I print the whole string?
0
votes
1
answer
65
views
keyCode == KeyEvent.KEYCODE_BUTTON_Y freezing the focus and not able to navigate after that
For Nvidia joystick trying to associate this event to go to search button on the grid view, it is working but it is getting frozen and nothing is happening after that. Suggest me something
@Override
...
-1
votes
1
answer
312
views
Why JavaFX stucks when running a process?
I am building an application using JavaFX. Application does some CRUD operations with the MySQL Database. So currently, I have 2 functions.
User Registration.
Email Validation (Check if email already ...
0
votes
1
answer
268
views
Creating a text field that only accepts a single integer input
I'm trying to create a method that only allows me to type a single number into a text field however my current code does not work. It allows me to type letters in even though the KeyPressed method is ...
1
vote
1
answer
2k
views
Space Key Click Event in android
I want to get the space key event in an android keyboard.
I tried some codes from google searches. but nothing is working.
public boolean onKey(View v, int keyCode, KeyEvent event) {
if (...
1
vote
1
answer
1k
views
JavaFX--Key events are getting intererrupted by Buttons
I am a student in a second level OOP/Java programming class. We had an assignment to create a simple JavaFX interface that allows the user to draw in a pane using the arrow keys. It reminds me of an ...
0
votes
1
answer
552
views
overloaded dispatchKeyEvent method freezes app when adding some post-processing code inside it
I'm currently working on an app that uses a barcode scanner for scanning some bar codes. So, I'm capturing the data by overloading the dispatchKeyEvent method. Everything works fine, as long as I'm ...
-1
votes
1
answer
56
views
How to set KeyEvent to KeyCode.BACK_SAPCE in JavaFx?
I'm trying to set KeyEvent KeyCode to KeyCode.BACK_SAPCE if entered value is not a digit.
But I'm not able to achieve it
public void textFieldKeyReleased(KeyEvent e) {
if (!e.getCode()....
0
votes
1
answer
157
views
JavaFx KeyEvent on Rectangle doesn't work
I have a Rectangle on a GridPane and after adding KeyEvent, it doesn't fire.
this is my code:
Rectangle rectangle = new Rectangle();
rectangle.setX(500.0f);
rectangle.setY(200.0f);
...
0
votes
1
answer
658
views
invoke virtual method 'int android.view.KeyEvent.getAction()' on a null object referenceid.view.KeyEvnt.getAction()
I have this code:
public ClearableEditText(Context context, AttributeSet attrs) {
super(context, attrs);
setOnEditorActionListener((v, actionId, event) -> {
if (event.getAction() =...
1
vote
1
answer
700
views
How to send MotionEvents to Android?
I'm trying to develop a Virtual Gamepad but I'm facing lots of problems sending input and event to Android, especially with MotionEvents. I have a device rooted and the app stored in /system/app, ...
1
vote
1
answer
231
views
Simulate key strokes in HTML textbox in geckoWebBrowser
I am using the "geckoWebBrowser1" component. I have navigated to an URL that will show an login textbox with ID: login-email
Now I do successfully put "[email protected]" into that textbox.
...
1
vote
1
answer
391
views
Why do we use KeyEvent.VK_? instead of simply using the character
Suppose we want set a mnemonic for a menu item, and we want it be 'c'. I notice in almost all codes they write it as:
menuitem.setMnemonic(KeyEvent.VK_C);
I know that we can write it like this:
...
1
vote
1
answer
219
views
How to fix"Ignored keystrokes"
My problem is that after adding catching keys, my code began to work not quite correctly.
In more detail: The task of a program after pressing a key combination (in my case it is CTRL + q and CTRL + ...
0
votes
1
answer
42
views
receive call of onKey method by the wrong fragment
Situation *************:
I'm looking some intel about the onKey override method by fragment.
I have single activity several fragment structure. Only one fragment visible at time.
I show a new fragment ...
0
votes
1
answer
247
views
How to deal with all keyevents when added a view with WindowManager?
Problem is on a service view back button is giving me a response but Home and Recent Apps button is not triggering
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
switch (...
2
votes
0
answers
248
views
How to imitate mouse events with full functionality in Qt
I am trying to remote control a Qt application over UDP messages from my host computer.
Currently, the remote controlled computer runs a Qt application that receives messages and creates Mouse ...
0
votes
2
answers
2k
views
How to generate KeyEvents in QML application?
I am using PyQt5 together with QML to create an application. I need to be able to simulate keyboard board events either from PyQT to my QML objects or alternatively from QML itself.
I'm using a ...
0
votes
0
answers
996
views
Android KeyEvent Class not working ?Cannot resolve symbol 'KeyEvent'
when i am trying to insert key events in android import android.view.KeyEvent; is not working, got this Cannot resolve symbol 'KeyEvent' when import java lib.
import android.view.KeyEvent;
view....
0
votes
0
answers
731
views
How to log Keycode and unicode on Keyevent
I want to know the keycode for some chars like Divide symbol in mobile, Euro etc..
Updating the question I am able to print all key events using below method. But nothing happens when I type few ...
0
votes
1
answer
60
views
Order of execution of Code when a KeyEvent occures
Im trying to develope Snake in Java and Im using KeyListeners to get KeyEvents for the buttons w, a, s and d. I created a Class that implements KeyEvent and I added an Object of that Class to the ...
1
vote
0
answers
148
views
Which KeyEvent to use to navigate to next text field in Chrome browser on an Android device
I am working on a custom keyboard for an Android device and I am looking for a KeyEvent to navigate from one input field to another.
I already tried some of them (KeyEvent.NAVIGATE_NEXT, ...), but ...
0
votes
1
answer
272
views
Passing KeyEvent to a different component
I am trying to allow for a JTextArea to have focus but if the user enters keyboard input and control is not pressed then to forward that key event on to the command JTextField.
I tried to simply ...
0
votes
1
answer
45
views
Javascript start stopwatch after keyevent
I'am working on a game with the canvas element. The goal is that first time you press a key it start a stopwatch. It should end as soon as the gameoverscreen/winscreen appears.
After the ...
1
vote
0
answers
532
views
How to change a picture when a key is entered in Android Studio?
I have a bluetooth keyboard, and when the phone recieves a certain character from that keyboard (eg. 'A') I would like to change a picture on the app.
I'm brand new to Android Studio and I don't ...
2
votes
1
answer
365
views
KeyEvent code for hiding software keyboard?
When a software keyboard is opened on my virtual device, the back button changes function to hide the keyboard when pressed - it does not stay 'KEYCODE_BACK' like it does whilst the keyboard is hidden....
0
votes
2
answers
380
views
HTML Contenteditable: Limit edit operations and copy updated text
I have a contenteditable p element. I'd like to limit the possible edit operations to inserting and deleting commas. I also want to copy the updated contents to another div. These two goals seem to be ...
2
votes
0
answers
255
views
How can I test keyEvents in Xcode Playground?
I want to implement some keyboard actions into my custom view. The actual code is more complex, nut even in this simple setup I do not get that to work.
The code below is Swift 4 in an Xcode 9.2 ...
0
votes
1
answer
405
views
Binding wxEVT_CHAR_HOOK not working in wxWidgets 3.1.2
I'm trying to have a function be called every time a key is pressed. For some reason I can't bind the wxEVT_CHAR_HOOK event to a function.
There is no probelm with creating a button and binding the ...
1
vote
0
answers
36
views
Problem with keyEvent in Java FXML and Scene Builder
I want to make something happen on screen when i press som buttons. I know how events work but never worked with key Events in java. If someone can tell me why this code dont work, it would be great. :...