speeding up GetAsyncKeyState

  • Thread starter Michael Linfield
  • Start date
M

Michael Linfield

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

GetAsyncKeyState is representing Win32API.new('user32',
'GetAsyncKeyState', ['i'], 'i')

and keys represents a hash of scan code to virtual keycode conversions.

The problem occurs as seen 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.

Any way to speed this up?

Regards,

- Mac
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,821
Messages
2,569,748
Members
45,726
Latest member
RaleighAll

Latest Threads

Top