• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Can I catch CTRL+ALT+DEL in java ?

 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was trying to write a java program that will sense automatically the press of CTRL+ALT+DEL

Like I want to create a file through my java program ,that how many times the CTRL+ALT+DEL was pressed and the time diference
between them .

can anyboby help on this .
 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check the following thread.
 
Bartender
Posts: 2777
134
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think that can be done.
 
Sheriff
Posts: 22053
113
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree. Windows catches several key strokes before they are sent to applications. Ctrl+Alt+Del is one of those; even VMware cannot disallow Windows handling it. (That's what you get when the VMware virtual machine is running in full-screen mode )
 
salvin francis
Bartender
Posts: 2777
134
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I doubt it has anything to do with the os.
I feel its an interrupt key sequence that is set in ROM BIOS,
Windows merely senses this interrupt, so does linux.
 
Rob Spoor
Sheriff
Posts: 22053
113
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not the ROM BIOS, it's the keyboard / keyboard port on the motherboard. The BIOS has its own keyboard drivers for handling several keystrokes (like those needed to enter the BIOS). That's why Ctrl+Alt+Del reboots your PC when you're still in the BIOS post screen but it will show a screen in Windows (and reboot in Windows 95/98 if pressed twice). In Linux you can specify what to do when you press Ctrl+Alt+Del.

In short, the operating system (BIOS is also an operating system; that's what the OS stands for) handles keyboard interrupts it receives through the keyboard driver, and decides what to do with them. The only way to catch Ctrl+Alt+Del in Java is intercept the interrupts inside the keyboard driver before Windows / Linux gets them. I don't know if that's even possible, but if it is you will have to use a lot of JNI.
 
Make yourself as serene as a flower, as a tree. And on wednesdays, as serene as this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic