Page 1 of 1

intercept power button?

Posted: Tue May 08, 2012 12:05 pm
by platatomi
I am trying to find a way to intercept the pressing of the computer's power button to run my code.

So far I haven't been able to find any info about this, pointers are appreciated. My OS runs in long mode.

Re: intercept power button?

Posted: Tue May 08, 2012 12:11 pm
by turdus
platatomi wrote:I am trying to find a way to intercept the pressing of the computer's power button to run my code.

So far I haven't been able to find any info about this, pointers are appreciated. My OS runs in long mode.
Search wiki for ACPI. Could be a hard ride.

Re: intercept power button?

Posted: Tue May 08, 2012 12:19 pm
by mateuszb
You have to support ACPI. The easiest route is to integrate ACPICA.
There's a wiki page for that. It's a relatively easy thing to do. It took me a few hours to do it.
After you have it integrated, you can intercept power button events.