GetKeyboardState() problems/usage

  • Thread starter Michael Linfield
  • Start date
M

Michael Linfield

What seems to be the correct means of using this function?

getState = Win32API.new('user32','GetKeyboardState',['P'],'N')

byteGrid = 0.chr * 256 #for the 256 virtual keycodes

now, using getState.call(byteGrid) changes some of the /000's to /001's
respectively.

However, how might one call back what virtual codes (keys) were
activated?
It'd be nice to have the functionality of getState(68) => 1 or something
of the sort... 68 representing "D" of course in ascii.

Any ideas?

Thanks,

- 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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top