   Buffered Keyboard data (again)
  I don't know what happened to my last message so here it is again...HiI am trying to use buffered keyboard input but I can't seem to get any response when I press a key. I set up a program using immediate data beforehand and although that worked fine I had that problem that keypresses were getting registered more than once which isn't what I wanted...anyway I'm babbling now.I've pasted my code below - if anyone can tell me what I am doing wrong I'd be grateful...[EDIT - HAD TO REMOVE CODE DUE TO PROJECT REQUIREMENTS]Thanks in advance.Asim[edited by - asim on September 23, 2003 5:58:27 AM]
  Try initializing dwItems to 10 every time before you call GetDeviceData().;  I don''t think this is your problem but you seem to be repeatedly calling Aquire and Unaquire in your loop, are you sure this is a good practice? I think you only need to call them once at initialisation and once at destruction. ;  Thanks for the suggestion but it that didn''t work I can''t seem to work this out - I tried the debugger and found out that I couldn''t use the SetProperty function on an acquired device so I changed my code around but it still didn''t work. The debugger now tells me that the keyboard isn''t acquired when I use the GetDeviceData function. I''ve tested the result from the Acquire function just before the GetDeviceData call and it appears to acquire the keyboard fine.Somebody help me - I''ve tried bashing my head against the computer but that''s just giving me a headache. ;  Sorry the previous reply was in response to jacklin.Thank you bazee but that actually solved my problem! I have no idea why but everything works fine now.And just in a nick of time - I was about to throw the computer out of the window. ;  Actually having just checked, it appears that the program is now working because of what both jacklin and bazee said. Either solution by itself doesn''t work but put them both together and BAM - everything falls into place nicely! Thanks againAsim 