Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

How detect "Power" button pressing?
Started by bahmanbj Dec 04 2017 07:51 AM

2 replies to this topic
power button
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

bahmanbj

[GLOBAL: userInfoPane.html]
bahmanbj
  • Observer

  • 7 posts
  • Corona SDK

Hi to all,

How detect "Power" button pressing?

Thank you

 



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,838 posts
  • Corona Staff

I don't believe the power button can be directly detected, however, if your app is in the foreground, you will get a system even that your app is being suspended which you can detect. But you won't know if it's because the device went to sleep, was put to sleep via the power button or if the user switched to a different app.

 

https://docs.coronalabs.com/api/event/system/type.html

 

Rob



[TOPIC: post.html]
#3

bahmanbj

[GLOBAL: userInfoPane.html]
bahmanbj
  • Observer

  • 7 posts
  • Corona SDK

Thank you Rob.

I just want to pause a video streaming from Youtube, so I think it would help me.

Thanks




[topic_controls]
[/topic_controls]