intercept power button?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
platatomi
Posts: 5
Joined: Sun May 06, 2012 3:53 pm

intercept power button?

Post 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.
User avatar
turdus
Member
Member
Posts: 496
Joined: Tue Feb 08, 2011 1:58 pm

Re: intercept power button?

Post 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.
mateuszb
Member
Member
Posts: 32
Joined: Sun Jan 16, 2011 1:27 am

Re: intercept power button?

Post 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.
Post Reply