Contribute
Register

Getting power button to show Shut Down Dialog!

Status
Not open for further replies.
Joined
Jun 13, 2012
Messages
152
Motherboard
Lenovo Ideapad Y510P
CPU
i7 4700MQ
Graphics
HD4600
Mobile Phone
  1. Android
Hi everyone.

As I'm progressing fixing and customising my Lenovo Y510P hackintosh using yosemite, I wanted to try if I can get the power button to show Shut Down Dialog like this: http://km.support.apple.com/library/content/dam/edam/applecare/images/en_US/osx/shutdown_window.png

I found a keyboard key combination to show this which is (Ctrl + Insert) and thought to map the functionality to power key. The problem is I can't find anything regarding the power key. Karabiner doesn't recognise it, VoodooPS2Controller in debug mode doesn't recognise it, even trying ACPIDebug with "Add DSDT Debug Methods" and "Instrument EC queries" DSDT patches didn't recognise it.

Am I missing something here? thanks.
 
Hi everyone.

As I'm progressing fixing and customising my Lenovo Y510P hackintosh using yosemite, I wanted to try if I can get the power button to show Shut Down Dialog like this: http://km.support.apple.com/library/content/dam/edam/applecare/images/en_US/osx/shutdown_window.png

I found a keyboard key combination to show this which is (Ctrl + Insert) and thought to map the functionality to power key. The problem is I can't find anything regarding the power key. Karabiner doesn't recognise it, VoodooPS2Controller in debug mode doesn't recognise it, even trying ACPIDebug with "Add DSDT Debug Methods" and "Instrument EC queries" DSDT patches didn't recognise it.

Am I missing something here? thanks.

You can show the dialog by pressing Ctrl+Power Button.

The power button is special in ACPI. It is not a "keyboard key"...

The power button is likely working as Apple intended... (eg. the same as on a real Mac).
 
You can show the dialog by pressing Ctrl+Power Button.

The power button is special in ACPI. It is not a "keyboard key"...

The power button is likely working as Apple intended... (eg. the same as on a real Mac).

Thanks for the clarification but I really want to know more. The ACPI (as far as I understand) are tables defines the functionality of the computer and it depends mostly on bios not the OS itself. If the tables are incomplete, the OS might need to implement some code to insure no functionality is missing which I think Windows and Linux do to support varity of PC configurations. On the other hand, Apple supports limited number of their own hardware which means their ACPI tables are less crowded but insures full functionality for macs. To have OS X on our PCs we sometimes need to complete our bios ACPI tables to allow functionality needed in OS X but not in Windows or Linux.

Back on-topic, the power button is as you said a special key defined in ACPI (for our bios) but it's not related to OS X itself. In Windows, I'm able to customize what pressing this button would do which means Windows is able to override ACPI functionality for this special key. This leads to a question, why it's not possible (as I understood from your words) to override the same special key in our DSDT to customize it and force OS X to comply to the changes made?
 
Thanks for the clarification but I really want to know more. The ACPI (as far as I understand) are tables defines the functionality of the computer and it depends mostly on bios not the OS itself. If the tables are incomplete, the OS might need to implement some code to insure no functionality is missing which I think Windows and Linux do to support varity of PC configurations. On the other hand, Apple supports limited number of their own hardware which means their ACPI tables are less crowded but insures full functionality for macs. To have OS X on our PCs we sometimes need to complete our bios ACPI tables to allow functionality needed in OS X but not in Windows or Linux.

I think it is fair to say that Apple's ACPI implementation is less than 100% tested as they do not need to deal with the whole of the PC industry ACPI code... only the ACPI code in their own computers. So, there are portions which simply aren't implemented correctly in Apple's code. A good example of this is multi-byte EC registers (most prevalent in ACPI battery code). And then there are cases where Apple's code doesn't have the work-arounds implemented that may be required for DSDTs that may not comply to the ACPI spec, or may comply with an older spec not supported by Apple's code. And then there are still other cases where we exploit ACPI conventions only supported by Apple's ACPI implementation. _DSM injections are an example of this.

Patching PC ACPI files is about making it conform better to what Apple's code expects as well as filling in some missing details about the hardware (with _DSM injection) that Apple's firmware supplies (these details are outside the ACPI spec).

You can read about the ACPI spec here: http://acpi.info/spec.htm

Back on-topic, the power button is as you said a special key defined in ACPI (for our bios) but it's not related to OS X itself. In Windows, I'm able to customize what pressing this button would do which means Windows is able to override ACPI functionality for this special key. This leads to a question, why it's not possible (as I understood from your words) to override the same special key in our DSDT to customize it and force OS X to comply to the changes made?

The customization would have to take place in the OS not ACPI. The job of ACPI with regard to the power button is to tell the OS when it is pressed/released, but not what action to take when that event happens. The OS decides what to do with it. In OS X current versions, the power button, pressed by itself, results in S3 sleep.
 
First of all, thanks.

I think it is fair to say that Apple's ACPI implementation is less than 100% tested as they do not need to deal with the whole of the PC industry ACPI code... only the ACPI code in their own computers. So, there are portions which simply aren't implemented correctly in Apple's code. A good example of this is multi-byte EC registers (most prevalent in ACPI battery code). And then there are cases where Apple's code doesn't have the work-arounds implemented that may be required for DSDTs that may not comply to the ACPI spec, or may comply with an older spec not supported by Apple's code. And then there are still other cases where we exploit ACPI conventions only supported by Apple's ACPI implementation. _DSM injections are an example of this.

Patching PC ACPI files is about making it conform better to what Apple's code expects as well as filling in some missing details about the hardware (with _DSM injection) that Apple's firmware supplies (these details are outside the ACPI spec).

You can read about the ACPI spec here: http://acpi.info/spec.htm

I think I understand the basic idea. Though there are some advanced topics you mentioned but I'm willing to research around them sometime.

The customization would have to take place in the OS not ACPI. The job of ACPI with regard to the power button is to tell the OS when it is pressed/released, but not what action to take when that event happens. The OS decides what to do with it. In OS X current versions, the power button, pressed by itself, results in S3 sleep.

But it still doesn't go for S3 sleep when I press it, it doesn't function at all by itself. Which part of the OS would be responsible for the event for such button?
 
...

But it still doesn't go for S3 sleep when I press it, it doesn't function at all by itself. Which part of the OS would be responsible for the event for such button?

You have to press it for a certain period of time. Apple does this to avoid accidental presses on their own computers. I believe it is implemented in AppleAPCIButtons.kext (a PlugIn of AppleACPIPlatform.kext).
 
You have to press it for a certain period of time. Apple does this to avoid accidental presses on their own computers. I believe it is implemented in AppleAPCIButtons.kext (a PlugIn of AppleACPIPlatform.kext).

Yes I found as you said (and as stated on Apple website too) that pressing the power button for a moment then release will put system to sleep. Press and hold longer nearly 1.5 to 2 seconds then release will show the shut down dialog. This in addition to Control+Power will show it immediately (Control+Insert too). Not bad as long as many options exist so no importance of thinking about remapping.

Thanks.
 
Status
Not open for further replies.
Back
Top