Questions tagged [keystrokes]
98 questions
3
votes
2 answers
Keystroke Fn (function) key in Applescript
Is there any way to keystroke the Fn key in apple script? Ideally I would like to be able to "press it" twice in order to launch voice typing.
Thanks in advance!

user2555399
- 199
- 1
- 3
- 8
3
votes
0 answers
Any way for a sandboxed OS X app to intercept keystrokes?
So I've used Dave Delong's brilliant code here to intercept keystrokes in OS X without my app needing to be in focus, unfortunately my app crashes when I try to sandbox it with the message 'deny hid-control' in the console.
A little bit of digging…

Christian A. Strømmen
- 3,181
- 2
- 25
- 46
3
votes
3 answers
key-bindings and holding down keys
I have created a key binding for a JTextArea Component. When invoked, it creates a new instance of itself and sets focus to it.
If you hold down the enter (which invokes key binding) my program will start spitting out bunch of JTextArea…

Karlovsky120
- 6,212
- 8
- 41
- 94
3
votes
2 answers
Calling a routine when up or down is pressed in a JTable
This code calls a routine when enter is pressed in a JTable (called gametable). It works well, but I would like the same Action to be called when moving up or down in the JTable without the need for pressing enter; I can't get it to work. I tried…

user1432365
- 103
- 1
- 1
- 7
2
votes
4 answers
Visual C# - simple program that can remember user inputs?
I am new to C# and am trying to get a good start.
I am able to make a simple form program with some buttons and stuff. But here is my question:
How - or what is best practice to store user inputs in a program?
Let's say that I create a simple…

user1281991
- 763
- 1
- 12
- 34
2
votes
4 answers
Key combination of characters (non-Ctrl or Alt) in Java
I'm doing a project that needs to detect if a certain key combination has been pressed. Any keys like Ctrl, Alt, A-Z and 0-9 can be used as key combination.
I've searched some codes using KeyStroke.getKeyStroke but it seems like it does not allow…

Jemp
- 351
- 3
- 7
- 18
2
votes
0 answers
Android Java code to mimic a 2 Keystroke sequence (to perform a device screenshot)
I have been trying to get a bitmap screenshot of a SurfaceView for days but the more I look into it, there doesn't seem to be a solution at present for Android OS 2.3.4 based OSs my device from HTC.
So on to Plan B, where I just found out another…

greghudd
- 21
- 3
2
votes
2 answers
How does a swing component makes a look up in its ActionMap from it's inputMap using the intermediate Object reference
I've been reading about registering the "Action" objects with multiple components, and I came across the recipe of registering (binding) an Action object to a Keystroke object.
In the pursuit I came across this piece of code:
InputMap imap =…

VaidAbhishek
- 5,895
- 7
- 43
- 59
2
votes
2 answers
Enable ckeditor keyboard shortcut for headings?
I want my editors to be able to use keyboard shortcuts for applying headings.
I've been experimenting with the "keystrokes" approach on the ckeditor site. It works for some things, but not the headings. For instance, the following applies an…

doub1ejack
- 10,627
- 20
- 66
- 125
2
votes
4 answers
Capturing a keystroke in C++
I have been doing some reading, and I see that I can use getch() to get a keystroke. What I have seen is that this is considered bad practice, however I have seen conflicting opinions. I am writing a console application for my class, and would…

Bear
- 486
- 2
- 8
- 16
2
votes
0 answers
send keys method cmd
I've been working on a batch file to perform several tasks and usually ask the user to enter 1, or 2 to choose between options.
This time, I'd like to use a different approach, keystrokes so that the user can select a choice by pressing the UP or…

Pedro Velez
- 21
- 4
2
votes
2 answers
Running keystrokes from program
I'm writing a program to automate an e-mail process and would like to know if there's a way to run keystrokes from within the program?
For example say I have this string:
str = "test"
And it gets copied to a file:
File.open('str.txt', 'w') { |s|…

13aal
- 1,634
- 1
- 21
- 47
2
votes
2 answers
How to capture and add keystrokes to a div element in realtime?
In the following code i'm trying to get the key presses and add it to my div element. For eg: if i'm pressing random keys such as "fhjbfwjbj" it should be added to the text in div. :