Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 10-27-2014, 01:53 AM
Zaaka Zaaka is offline
Senior Member
 
Join Date: Aug 2002
Location: Teesside, UK
Posts: 217
Default Disable Laptop Keyboard

Hi all, Is it possible to disable a laptops keyboard (progmatically), but leave a USB connected keyboard active? Mouse still needs to be active.

Any help/code will be greatly appreciated.
Reply With Quote
  #2  
Old 10-27-2014, 07:38 AM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 5,060
Default

You have to disable the mouse too:

http://www.swissdelphicenter.ch/en/showcode.php?id=312


See:

http://www.swissdelphicenter.ch/en/showcode.php?id=1722
__________________
Regards,
Abdulaziz Jasser
Reply With Quote
  #3  
Old 10-27-2014, 07:27 PM
kolbasz kolbasz is offline
Senior Member
 
Join Date: Nov 2013
Posts: 841
Default

You will find the following functions in User32.dll:
GetRawInputDeviceList
RegisterRawInputDevices
GetRegisteredRawInputDevices

So it is possible to register different keyboards and monitor received messages, however to disable the built in keyboard you need a device driver. But even with a device driver, I think is not a good idea to disable the main keyboard, because you will render your laptop inoperable without an external keyboard.
If you are still interested in how to register raw input devices, here is a delphi unit(see attachment)
Attached Files
File Type: zip cnRawinput.zip (4.6 KB, 2 views)
Reply With Quote
Reply

Tags
delphi, disable, keyboard, xe6

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 12:45 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.