SuperDisk
SuperDisk

Reputation: 2840

Python3: Get keyboard input without effect from cursor blink rate

I am trying to find some sort of library or function so I can get fast keyboard input.

Right now, using the Conio.h input method, you can hold down a key, but you have to wait a half a second for it to start repeating, the same as in any text box. This seems to be dictated by the cursor repeat delay, shown here.

Cursor blink rate

Any way to get realtime keyboard input rather than having to suffer this small delay?

I've heard of pyHook but that doesn't work for Python 3(.2). Thanks!

Upvotes: 0

Views: 567

Answers (2)

SuperDisk
SuperDisk

Reputation: 2840

I eventually wrote a small DLL to use the Win32 function GetAsyncKeyState.

Upvotes: 0

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798606

You'll need to do it the hard way, creating your own window and then listening for keydown and keyup events, using a timer to trigger the "repeat" of the keypress.

Upvotes: 1

Related Questions