We help IT Professionals succeed at work.

disable keyboard

DuriPro
DuriPro used Ask the Experts™
on
I use my laptop in a laptop holder with an external USB-keyboard. I sometimes lay my agenda on the laptop keyboard since that is not in use, but pressing the agenda (or other papers) will of course activate the keyboard with types characters I don't want.

I'm looking for a solution to disable my integrated laptop keyboard, and that keyboard only.

Is there a program available or does anyone know how to program that myself in Delphi ?

Thanks,
Arthur Habraken
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2013
Commented:
you can disable it from device manager
you can also make a macro ffor disabling, and one for enabling it back

Author

Commented:
I think it is not possible, at least not on my laptop. There is not something like a enable/disable option

The macro sounds interesting, but can you tell me how to do that ?

Commented:
a simple way to disable the laptop keyboard is to go to the device manager, go to update driver then install an incompatible keyboard driver instead of the standard driver then reboot. You will see that after reboot your laptop keyboard is no longer functioning thus solving the problem. Hope this helps.

I just tried this on my computer before sending it to you!
Top Expert 2013

Commented:
if you right click the keyboard>properties what do you you get?
for the macro, you first must havbe a solution to apply

Author

Commented:
Clicking the properties of the keyboard I get the Standard PS/2 Keyboard Properties with 4 tabs : General, Driver, Details, Resources.

The driver-tab contains a disable-button but it is grayed out
Commented:
yes sure, that must happen, but you must do the following
right click on keyboard, click update driver
select install from a list or specific location
then select don't search I will select the driver to install
remove the check from show compatible hardware
select something weired, I selected Philips USB Wireless Keyboard
then answer with yes
and reboot!
your keyboard is not working!

Author

Commented:
There must be a way to enable the 'disable'-button in thekeyboard properties, don't you think ?

Commented:
you may use a third party software also, I searched the internet and found the following
http://www.raymond.cc/blog/archives/2008/04/20/how-to-restrict-or-disable-keyboard-mouse-and-even-power-button/

it will lock every thing! I didn't tried it!
Top Expert 2013

Commented:
sorry - i meaan tto ask if you right klick the keyboard in device manager, do you have these options :
- update drivers
- uninstall    <-------can't you just uninstall it?
- search for modified devices
- properties

Commented:
try to;
RENAME from \windows\system32\drivers\kbdhid.sys TO \windows\system32\drivers\kbdhid.xxx
COPY from \windows\system32\drivers\kbdclass.sys TO  \windows\system32\drivers\kbdhid.sys

Restart computer.
Following code is used to disable mouse and keyboard events.
I'm not sure whether you USB keyboard would work after this or not.
atleast you can give try and can tailor it i guess so that works fine.

 procedure TForm1.Button1Click(Sender: TObject) ;
 
   function FuncAvail(dllName, funcName: string; var p: pointer): boolean;
   var
     lib: THandle;
   begin
     result := false;
     p := nil;
     if LoadLibrary(PChar(dllName)) = 0 then exit;
     lib := GetModuleHandle(PChar(dllName)) ;
     if lib <> 0 then
     begin
      p := GetProcAddress(lib, PChar(funcName)) ;
      if p <> nil then Result := true;
     end;
   end;
 
   var
     BlockInput : function(Block: BOOL): BOOL; stdcall;
 
   begin
    if FuncAvail('USER32.DLL', 'BlockInput', @BlockInput) then
    begin
     ShowMessage('Your Mouse and Keyboard will be blocked for 5 seconds!') ;
     BlockInput(true) ;
     Sleep(5000) ;
     BlockInput(false) ;
    end;
   end;
 
 end.
This question has been classified as abandoned and is being closed as part of the Cleanup Program.  See my comment at the end of the question for more details.