Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have a number of projects on NT 4.0 boxes where I would like to lockout the keyboard and mouse (for the whole machine) while the script runs, without adversely affecting other running windows (assuming of course they don't ask for input while the lockout is in place).

Does Win32:Console do this? I'm a little confused about the definition of a console. Can anybody help me out with a sample script so I can see how its done? I assume one would have to be logged in with administrator privilidges.

Supersearch was not fruitful. Any help from the gathered knowledge of the Monks would be very welcome.

drinkd

Replies are listed 'Best First'.
Re: Keyboard/Mouse lockout
by strat (Canon) on Dec 14, 2001 at 15:07 UTC
    I have never tried it yet, but some ideas:

    1. In NT-Reskit, isn't there a script to run a program as another user? Maybe this might be enough for you.

    2. It might be possible to write a program (e.g. with Tk), that stays on top all the time (binding all possible events to a method that puts it in front of all other windows, e.g. $toplevel->deiconify(); $toplevel->raise() If you remove the decoration (e.g. with $toplevel->overrideredirect(1); ), it couldn't be closed any more with the mouse. There's just the problem with alt+f4...

    Best regards,
    perl -e "print a|r,p|d=>b|p=>chr 3**2 .7=>t and t"

Re: Keyboard/Mouse lockout
by clintp (Curate) on Dec 13, 2001 at 23:29 UTC
    If you used Tk, you could have a global grab on a window that had your "Working..." message. I'd post code, but if I screwed it up testing it -- I'd be screwed.
Re: Keyboard/Mouse lockout
by drinkd (Pilgrim) on Dec 13, 2001 at 23:08 UTC
    Sorry for posting the above as AM. I didn't realize I wasn't logged in. I guess this is what the different color schemes are for, right?

    drinkd

Re: Keyboard/Mouse lockout
by demerphq (Chancellor) on Dec 13, 2001 at 23:27 UTC
    I dont think you can do this at all (irrespective of language) but Ill be watching this thread to see if I'm wrong.

    Oh, the grounds for me thinking this are that you _cant_ block/intercept Ctrl-Alt-Del, and that makes me think you cant block keyboard/mouse IO at all.

    Although I suppose it might be possible to intercept "normal" IO and then ignore it, but I'm still suspicious.

    /me prepares for a roasting... :-)

    Yves / DeMerphq
    --
    This space for rent.