Meaningless Drivel is fun!*
The moose likes Swing / AWT / SWT and the fly likes Alt + Tab, Ctl + Esc Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Alt + Tab, Ctl + Esc" Watch "Alt + Tab, Ctl + Esc" New topic
Author

Alt + Tab, Ctl + Esc

raj varma
Greenhorn

Joined: Jan 05, 2003
Posts: 28
In my full screen application, How do i stop user to doing Alt Tab or Ctl Esc to toggle the application.
I have tried consuming these events but alas.
As b4 applcation recognize these key typed event, Windows OS recognize them.
Anybody does have any idea to overcome this situation. Please Help
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

I don't even think I've seen a regular windows application that overrides these... ?!?!


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Yoo-Jin Lee
Ranch Hand

Joined: Nov 01, 2000
Posts: 119
Hi,
With Java 1.4, a new key board manager was created. It's very powerfull. Basically, you capture all the keyboard events and either take an action then pass on the event or else you can stop passing the key board event so no other listener will get a key event.
In the following example I capture Ctr+V.
ie.

[ April 03, 2003: Message edited by: Yoo-Jin Lee ]
Chantal Ackermann
Ranch Hand

Joined: Sep 28, 2000
Posts: 508
hi,
I would hope it can't be done. would be like the unrequested javascript popup windows. why annoying the user?
chantal
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Sorry... but this doesn't work... here's the code modified to listener for Alt-Tab and Ctrl-Esc. Since the Windows OS is actually listening to the keyboard and providing data to all other programs, I don't think you can override this in any way.

raj varma
Greenhorn

Joined: Jan 05, 2003
Posts: 28
Dear Natan this program also not capturing alt tab , Ctl Esc. code value has got either alt or cntl.It never prints "Captured alt tab" or "captured ctrl Esc". plz run program again with ur fuction with additional checks to get idea.

Originally posted by Nathan Pruett:
Sorry... but this doesn't work... here's the code modified to listener for Alt-Tab and Ctrl-Esc. Since the Windows OS is actually listening to the keyboard and providing data to all other programs, I don't think you can override this in any way.

Yoo-Jin Lee
Ranch Hand

Joined: Nov 01, 2000
Posts: 119
Hi,
Just a thought. If you can't consume these events in java it may be possible to use an activex control. That means you have to create or use someone's native windows tool to do this - if this is possible. I've never tried it myself. In any case why would you want to stop the user from toggling between applications? Seems to me you'd make the user angry by stopping them doing this?
-Yoo-Jin
raj varma
Greenhorn

Joined: Jan 05, 2003
Posts: 28
Hello Lee, Answer for ur question for annoying user is -
Full screen application is made for Cyber Cafe unless and untill user log's in it won;t allow user to access computer. After loggging in applcation, Minimize button which is provided in applcation is setEnabled.
Originally posted by Yoo-Jin Lee:
Hi,
Just a thought. If you can't consume these events in java it may be possible to use an activex control. That means you have to create or use someone's native windows tool to do this - if this is possible. I've never tried it myself. In any case why would you want to stop the user from toggling between applications? Seems to me you'd make the user angry by stopping them doing this?
-Yoo-Jin
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Sorry... I knew the modified code didn't work. I thought I mentioned that in the text of the post. Guess I should have made it more clear...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Alt + Tab, Ctl + Esc
 
Similar Threads
JTabbedPane Problem
Editing in Eclipse - shortcut to copy a line?
TabbedPane cycling
How to mask Alt + Tab and Alt + Esc
How to mask Alt + Tab and Alt + Esc