Questions tagged [keystroke]

The generic concept of capturing or generating a keystroke event in an application.

The generic concept of capturing or generating a keystroke event in an application.

May also refer to library-specific keystroke-capture code, for example questions relating to capturing keystrokes using jQuery.

531 questions
7
votes
1 answer

Hammerspoon: continuously send keystrokes to one application, while using others normally

Ok, so I have a script with Hammerspoon that executes key stokes for me. Simple example: hs.hotkey.bind({'cmd','alt','ctrl'}, "b", function() hs.eventtap.keyStroke({}, "Left", 200000) hs.eventtap.keyStroke({}, "Left", 200000) …
Ian
  • 85
  • 5
7
votes
2 answers

How to capture global keystrokes with PowerShell?

Can Powershell listen for and capture key presses? Is it possible to write a PowerShell script that, like AutoHotkey, sits in tray and waits until you press a predefined keyboard key to start execution? And possibly not return but fire every time…
J. Doe
  • 1,147
  • 1
  • 13
  • 21
7
votes
3 answers

How to define a shortcut for special keys in Java Swing, e.g. german umlaut key Ä?

How do I define a keyboard shortcut for top level special keys like german umlaut key Ä? I found a way to map unicode letters that are used for default american layout keys, see here. But the key event for the german umlaut key Ä…
jan
  • 2,741
  • 4
  • 35
  • 56
6
votes
1 answer

SendInput Not working for Games

I am using the following standard GenerateKey Code : void GenerateKey ( int vk , BOOL bExtended) { KEYBDINPUT kb={0}; INPUT Input={0}; // generate down if ( bExtended ) kb.dwFlags = KEYEVENTF_EXTENDEDKEY; kb.wVk = vk; …
Arnold
  • 61
  • 1
  • 2
6
votes
1 answer

Remembering and replaying keystrokes in C# : synchronisation issues

I am a speedrunner (somebody who likes to finish games in the fastest way possible) on PC games and I'd like to record my inputs while I play in order to automatically replay a run later. So I've created a little C# program to do that : basically,…
MetalFoxDoS
  • 399
  • 1
  • 2
  • 11
6
votes
2 answers

Cancel a keystroke in jQuery

Is is possible (cross-browser compatible) to CANCEL a keystroke after a user has made it (for example on a textbox) The code I currently use edits the textbox value after the keystroke has been displayed: $('.number').keypress(function() { …
Jimbo
  • 22,379
  • 42
  • 117
  • 159
6
votes
0 answers

WPF Global Hotkeys / Global Hook Keystrokes

First, I would like to know what is the difference between Global Hotkeys and Hook Global Keystrokes and using them as hotkeys? Second, I wan to use Global Hotkeys in my application, it will have 2 parts: 1. I will make a window that shows the user…
Ron
  • 3,975
  • 17
  • 80
  • 130
6
votes
8 answers

How to prevent a backspace key stroke in a TextBox?

I want to suppress a key stroke in a TextBox. To suppress all keystrokes other than Backspace, I use the following: private void KeyBox_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) { e.Handled = true; } However, I…
msbg
  • 4,852
  • 11
  • 44
  • 73
6
votes
4 answers

VBScript SendKeys CTRL+LWIN+TAB?

I am trying to write a simple script that will send the key combo of CTRL+WINDOWS KEY+TAB. The code below sends the keys CTRL+ALT+TAB Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.SendKeys "^%{TAB}" However when I try to replace…
daniel11
  • 2,027
  • 10
  • 38
  • 46
6
votes
2 answers

Java: Use keystroke with arrow key

I have some code that I need to modify. In the code, the original author uses KeyStroke.getKeyStroke to take user input. In this code, for example, he uses a instead of left arrow. I want to change this, but I don't know how. Here is the original…
hqt
  • 29,632
  • 51
  • 171
  • 250
5
votes
2 answers

Check whether key is pressed down in Windows console

Possible Duplicate: C++ console keyboard events I want a Windows console program to do something if a certain key is pressed down, something like while(1) { .... if(the key 'o' is pressed down) .... } but I don't know what to put…
Timothy
  • 51
  • 1
  • 1
  • 3
5
votes
1 answer

KeyGesture not accepting a Shift+Alphanumeric key combination

I'm attempting to execute some WPF commands with help of WPF KeyGesture class. Application works fine until I specify a key combination consisting of Shift modifier and an alphanumeric key. For example, following instantiation: new KeyGesture(Key.M,…
pbalaga
  • 2,018
  • 1
  • 21
  • 33
5
votes
2 answers

How to get the key TAB event on an input element?

I try to trigger a button when in an input field the return key has been hit. This works. But if I hit the tab key nothing is triggered because the TAB key event isn't captured. Fiddle example Here is my JQ code snippet for…
Bernhard Kraus
  • 329
  • 1
  • 3
  • 21
5
votes
4 answers

What does the 0x80 code mean when referring to keyboard controls

what does the 0x80 code mean when referring to the keyboard controls in C++ Windows environment? For example, if(GetKeyState('K') & 0x80) { //do something } Thanks everyone!
Paz
  • 51
  • 1
  • 1
  • 2
5
votes
3 answers

Detecting keystrokes in Julia

I have a piece of code in Julia in which a solver iterates many, many times as it seeks a solution to a very complex problem. At present, I have to provide a number of iterations for the code to do, set low enough that I don't have to wait hours for…
Glen O
  • 733
  • 3
  • 10
1 2
3
35 36