API to disable keyboard

  • Thread starter Thread starter EricB
  • Start date Start date
E

EricB

Does anyone knows whether there exists
a Windows API that disables a keyboard?

TIA.

Eric.
 
I don't know of an API to disable the keyboard. However, you may be able to
intercept keyboard entries and then ignore them. What are you trying to
accomplish?
 
Eric,

Private Declare Function BlockInput Lib "user32" (ByVal fBlock As Long) As
Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Public Sub BlockIt(lPeriod As Long)
'Blocks keyboard and mouse input events from reaching applications.
DoEvents 'Complete any pending operations first.

BlockInput True 'Block mouse and keyboard input.
Sleep lPeriod 'Wait <lPeriod>/1000 seconds before unblocking it.
BlockInput False 'Unblock the mouse and keyboard input.
End Sub

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html
 

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

Similar Threads


Back
Top