From: Michael Linfield Date: 2009-07-07T14:22:51+09:00 Subject: Speeding up virtual keycode scanning Here is the problem: GetAsyncKeyState = Win32API.new('user32','GetAsyncKeyState', ['i'], 'i') while true keys.each {|k, v| print k.upcase if GetAsyncKeyState.call(v) & 0x01 == 1 && GetAsyncKeyState.call(0x10) & 0x01 == 1} keys.each {|k, v| print k.downcase if GetAsyncKeyState.call(v) & 0x01 == 1} end ##keys represents a hash of scan code to virtual keycode conversions. The problem occurs by running this in a console... pressing "a" too quickly results in no secondary "a". In short... it doesn't pick up all the keyboard input unless you type at 1 letter per 3 seconds. Almost like it is cycling through the virtual keycodes and doesn't get back around to "a" in time. Any way to speed this up? Regards, - Mac -- Posted via http://www.ruby-forum.com/.