aspose file tools*
The moose likes Java in General and the fly likes How to disable keyboard input Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to disable keyboard input" Watch "How to disable keyboard input" New topic
Author

How to disable keyboard input

Marx Villegas
Ranch Hand

Joined: Mar 10, 2006
Posts: 94
Hi,
I'm developing a cybercafe management client/server application, and I have a very hard task in hand.
I need that clients machines, when unauthorized to be used, have both mouse and keyboard disabled, while the screen shows nothing but a "Welcome to the cyber - for navigating contact cyber operator", absolutely nothing else. Then when the operator authorizes the machine, OS is shown.
The idea is to make a multiplaform app for both client and server.

I already know how to freeze the screen, but when the user presses alt+ctrl+delete, or alt+tab, or the windows OS start key my magic window dissapears. I already implemented the KeyListener interface and captured and consumed all the keyboard events, and it still won't work.

Help me please, I'm kinda desperate
XM


When the compiler's not happy, ain't nobody happy...
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

You won't be able to do this in pure Java; you'll need to use heavy Windows native-code voodoo, especially to block Ctrl-Alt-Delete.


[Jess in Action][AskingGoodQuestions]
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
I thought it was supposed to be genuinely impossible to intercept Ctrl-Alt-Del in Windows. The idea is to prevent trojans. Don't take this as Gospel, though; I could be wrong.

You may have better luck with Alt-Tab.


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Marx Villegas
Ranch Hand

Joined: Mar 10, 2006
Posts: 94
Thanks a lot! I'll figure something else out
XM
Marx Villegas
Ranch Hand

Joined: Mar 10, 2006
Posts: 94
Guys,
It is possible to catch the ALT+CTRL+DEL and a whole bunch of windows OS's magical keystrokes: Microsoft Visual C++ makes it possible.
Do you think it is a good idea to use native methods in my java project?
I would do it all in java, but the ALT+CTRL+DEL enable/disable routines in C++. Is it possible? is it viable? Is it a good or bad idea?
Thanks
XM
[ June 30, 2006: Message edited by: Marx Villegas ]
Ken Blair
Ranch Hand

Joined: Jul 15, 2003
Posts: 1078
Given we have very limited information about the context and requirements it's hard to make such a sweeping judgement. It's certainly possible and probably beneficial. Instead of having 'native methods' you can use JNI instead. Write the bulk of the project in Java and call native programs where it's needed.
Marx Villegas
Ranch Hand

Joined: Mar 10, 2006
Posts: 94
Thank you Ken. I'm actually using JNI, and I've fought C++ all day long.
I'll get the code published as soon as I finish it.
Thank you all
Marx
Richard Green
Ranch Hand

Joined: Aug 25, 2005
Posts: 536
Why reinvent the wheel? You could find many opensource cybercafe softwares (written in java) at sourceforge.net


MCSD, SCJP, SCWCD, SCBCD, SCJD (in progress - URLybird 1.2.1)
sabin ran
Greenhorn

Joined: Aug 06, 2010
Posts: 22
hey can anybody help me? while searching for solution i end up here. i am trying to make screen locker within the college management system in java where only correct password will unlock it. please help
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14435
    
  23

The same thing that was true in 2006 is still true today: you cannot do this with pure Java; you'll need to program native code for your operating system to do this.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to disable keyboard input