keyboard-input

How do I make python to wait for a pressed key

I want my script to wait until my users presses the any key. How do I do that? ...

Keyboard input with timeout in Python

How would you prompt the user for some input but timing out after N seconds? Google is pointing to a mail thread about it at http://mail.python.org/pipermail/python-list/2006-January/533215.html but it seems not to work. The statement in which the timeout happens, no matter whether it is a sys.input.readline or timer.sleep(), I always g...

Delphi: Can I differentiate between numpad's enter key and carriage return?

I've got a quaint little app that pops up an on screen numberpad/calculator written in Delphi. I'd like to make it so if you pressed 'enter' (on the number pad) you'd be pressing '=' and if you pressed 'return' (on the main keyboard) you'd be pressing 'OK'. There's an OK button who is the form's default guy which responds to hitting en...

Input from console window in game

when you want to input in console window and you hold a key down for a moment, the output is displayed but after a bit of some lag. for example, in any type of common text editors you would see the same result. is there anyway to get a direct input for console games? I'm currently using _getch() to read the keyboard input and _kbhit to ...

Using WINAPI ReadConsole

I am trying to use the WINAPI ReadConsole() to wait for any keypress at the end of my Win32 console application. CONSOLE_READCONSOLE_CONTROL tControl; char pStr[65536]; DWORD dwBufLen = 1; DWORD dwCtl; tControl_c.nLength = sizeof( CONSOLE_READCONSOLE_CONTROL ); tControl_c.nInitialChars = 0; tControl_c.dwControlKeyState = 0; tControl_c....

Stopping a ListBox from reacting to keystrokes without breaking InputGestures for CommandBindings

I want to disable the possibility to navigate a ListBox with the keyboard. My first thought was to set up a PreviewKeyDown handler like so: private void ListBox_PreviewKeyDown(object sender, KeyEventArgs e) { e.Handled = // some logic here ... } Unfortunately this also stops my CommandBindings which are declared in my main window ...

How intercept these two key: ":" and "." ?

I need to do something when a user push "." and something else when an user push ":" Is there a way to intercept these 2 key with javascript, jQuery or other ? ...