Is there a way to TOTALLY diable the Keyboard and Mouse for the whole operating system than re-able them with out re-booting. ( But i would have no problem if i am force to Re-Boot if all is not possible )

Do anyone have info about thiis. I did a search for diable but have not turned up anything as of yet.... Still searching...

I know how to do this for my own window but not the whole system. And i need to diable all until a block of code has finish running. I was trying to do it with the programan handle but had no success.

Thanks in advance
Posted on 2003-02-20 22:54:55 by cmax
Try to search for "disable" also :).
Posted on 2003-02-21 00:44:22 by gliptic
You would think that i would have figured that out by now.

Anyway what i am trying to do is write my own installer. Is there an example source anywhere in ASM. Or are there any ready made ASM installers around.
Posted on 2003-02-21 07:40:27 by cmax
I dont know how preaty it would be. But it should be possible to do what you want with SetWindowsHookEx, hook the KB and Mouse and in your call back proc, edit all the messages before they get sent to any apps. But that'll be slow and messy. other than that you are probably looking at rin0 which is beyond my presant horizon.... good luck
Posted on 2003-02-22 17:43:42 by dionysus
All I can tell you by now is that you can disable mouse and keyboard by
clicking "Start"|"Run..." and enter:

rundll32 mouse, disable

and

rundll32 keyboard, disable

Which obviously calls the DISABLE functions of the mouse.drv and
keyboard.drv ... unfortunately, you can't use ENABLE that way, since
it needs some parameter, obviously.

aweX <-
Posted on 2003-02-23 02:24:24 by aweX
I thought this thread had no more replys. What was said here is enough for me to work with.

Thanks Guys
Posted on 2003-03-07 01:24:20 by cmax
I only know how to disable Keyboard, I dont know about Mouse.



In al,0x21
xor al,2
Out 0x21,al

Posted on 2003-03-09 08:50:31 by realvampire
Thanks realvampire ,

This is Great. I think i can just hide the mouse with my expanded Window than i got to re-boot the machine anyway afterward.

Thanks again

PS: One question realvampire, for the record do you know how to bring it back without re-booting or do i have to re=boot.
Posted on 2003-03-12 18:57:37 by cmax
What record? Boot record? or what ?
Posted on 2003-03-12 19:54:44 by realvampire
I may have said that wrong. I wanted to know how to do these things and i do require to re-boot the machine but while i am here asking about it it could not hurt to find out if it can be done with out re-booting to get it the keyboard and mouse back. dionysus post about hooking may be the only way to do that.

I don't understand 16 bit code yet .... I don't know how to work your code. it seems that is a c code numbers not asm numbers. Did not just want to come back saying i did not understand that style of coding.
Posted on 2003-03-13 06:15:30 by cmax
I Understood about 16-Bit now. :)
Posted on 2003-03-13 06:20:16 by realvampire

All I can tell you by now is that you can disable mouse and keyboard by
clicking "Start"|"Run..." and enter:

rundll32 mouse, disable

and

rundll32 keyboard, disable

Which obviously calls the DISABLE functions of the mouse.drv and
keyboard.drv ... unfortunately, you can't use ENABLE that way, since
it needs some parameter, obviously.

aweX <-


what nasty knowledge...:cool:
Posted on 2003-03-14 06:12:07 by Homer


Disable_KeyBoard Proc

in al,0x21
xor al,2
out ox21,al

ret
Disable_KeyBoard endp

Enable_Key Proc

in al,0x21
test al,2
jnz brs
xor al,2
out 0x21,al

brs:
ret
Enable_Key endp



That might Help.
Posted on 2003-03-16 17:31:05 by realvampire
for what type of system does this keyboard disabler work on? for me it did nothing. I was still able to type as usual.
Posted on 2003-03-16 17:38:17 by Guy on ASM
It work for all system.
If you still able to type try this.



mov al,0xFFh
out al,0x21


Not just keyboard, also Timer and everything on IRQ 0~7 will be disable
Posted on 2003-03-16 18:13:20 by realvampire
i just stumbled on this api, maybe it's what you need (haven't tried it tho)

BlockInput Function

The BlockInput function blocks keyboard and mouse input events from reaching applications.

Syntax

BOOL BlockInput(
BOOL fBlockIt
);

Parameters

fBlockIt
Specifies the function's purpose. If this parameter is TRUE, keyboard and mouse input events are blocked. If this parameter is FALSE, keyboard and mouse events are unblocked. Note that only the thread that blocked input can successfully unblock input.

Return Value

If the function succeeds, the return value is nonzero.

If input is already blocked, the return value is zero. To get extended error information, call GetLastError.



Remarks

When input is blocked, real physical input from the mouse or keyboard will not affect the input queue's synchronous key state (reported by GetKeyState and GetKeyboardState), nor will it affect the asynchronous key state (reported by GetAsyncKeyState). However, the thread that is blocking input can affect both of these key states by calling SendInput. No other thread can do this.

The system will unblock input in the following cases:


The thread that blocked input unexpectedly exits without calling BlockInput with fBlock set to FALSE. In this case, the system cleans up properly and re-enables input.
Windows 95/98/Me: The system displays the Close Program/Fault dialog box. This can occur if the thread faults or if the user presses CTRL+ALT+DEL.
Windows 2000/XP: The user presses CTRL+ALT+DEL or the system invokes the Hard System Error modal message box (for example, when a program faults or a device fails).

Function Information

Import library User32.lib
Minimum operating systems Included in Windows 98, Windows 2000
Posted on 2003-03-30 03:36:54 by Joshua