On Thu, 2003-07-03 at 15:55, [EMAIL PROTECTED] wrote:
> Does anyone have a good way to disable the keyboard & mouse whilst an installation 
> is underway, I need to stop my users interferring whilst their machine is building.
> 
> I have tried with an autoit script that uses the internal command to lock out the 
> keyboard etc, but it 'pinches' the odd keystroke being sent by other scripts causing 
> them to fail.
> 
> Any ideas most welcome
HKEY_LOCAL_MACHINE/System/CurrentControlSet/services/Kbdclass/
HKEY_LOCAL_MACHINE/System/CurrentControlSet/services/Mouclass/

are the keys for enabling and disabling the keyboard and mouse. set the
value to REG_DWORD 4 to disable keyboard/mouse support and REG_DWORD 1
to enable ..

after setting the values you have to reboot the machine in order to
achieve the desired behaviour.
see attached part of a perl script.

wolfgang

-- 
Wolfgang Borst <[EMAIL PROTECTED]> GPG/PGP key 4107B17B
sub km_support
{
 my $enable = shift;
 my $rc=1;
 my %reg;
 use Win32::TieRegistry (Delimiter => '/', TiedHash => \%reg);

 my $k_key =
    'HKEY_LOCAL_MACHINE/System/CurrentControlSet/services/Kbdclass/';

 my $m_key =
    'HKEY_LOCAL_MACHINE/System/CurrentControlSet/services/Mouclass/';
 
 my $val;
 
 if($enable)
 {
  $val="0x0001";
 }
 else
 {
  $val="0x0004";
 }
 if ( ! ($reg{$k_key}->{'Start'} = [  $val , "REG_DWORD"] ) )
 {
  logfacility "Unable to set $k_key/Start to $val: $^E";
  $rc-=1;
 }
 if ( ! ($reg{$m_key}->{'Start'} = [ $val , "REG_DWORD"] ) )
 {
  logfacility "Unable to set $m_key/Start to $val: $^E";
  $rc-=1;
 }
 return $rc;
}

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to