GetKeyboardState() problems/usage

Discussion in 'Ruby' started by Michael Linfield, Jul 9, 2009.

  1. 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
    --
    Posted via http://www.ruby-forum.com/.
     
    Michael Linfield, Jul 9, 2009
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. metfan
    Replies:
    2
    Views:
    4,855
    Robert Olofsson
    Oct 21, 2003
  2. Colin J. Williams

    Webchecker Usage - a problem with local usage

    Colin J. Williams, Feb 25, 2004, in forum: Python
    Replies:
    1
    Views:
    545
    Colin J. Williams
    Feb 26, 2004
  3. hvt
    Replies:
    0
    Views:
    1,215
  4. hvt
    Replies:
    0
    Views:
    1,487
  5. Krist
    Replies:
    8
    Views:
    6,532
    Arne Vajhøj
    Feb 10, 2010
Loading...

Share This Page