<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Button release event?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/4441/button-release-event</link><description>Am I right in thinking that the button handler only causes an event for a button press(although I realize it is possible to configure the button such that a release is interpreted as a press), rather than a change of state?
I expect I can work around</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 12 Nov 2014 17:17:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/4441/button-release-event" /><item><title>RE: Button release event?</title><link>https://devzone.nordicsemi.com/thread/15775?ContentTypeID=1</link><pubDate>Wed, 12 Nov 2014 17:17:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8788a0c8-27c5-48ec-b402-6095c15cb351</guid><dc:creator>JohnBrown</dc:creator><description>&lt;p&gt;That&amp;#39;s great news, Håkon, and many thanks for the prompt answer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Button release event?</title><link>https://devzone.nordicsemi.com/thread/15774?ContentTypeID=1</link><pubDate>Wed, 12 Nov 2014 15:52:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:392f704c-56f0-402e-96d1-0418c2c62a48</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi John,&lt;/p&gt;
&lt;p&gt;From SDK v6.0 and newer, app_button will give you an event on both button press and release.
Here&amp;#39;s an example snippet:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void button_event_handler(uint8_t pin_no, uint8_t button_action)
{
    if (button_action == APP_BUTTON_PUSH)
    {
        switch (pin_no)
        {
			case MY_BUTTON:
				do_something_on_press();
				break;		
            default:
                APP_ERROR_HANDLER(pin_no);
                break;
        }
    }
    else if (button_action == APP_BUTTON_RELEASE)
    {
        switch (pin_no)
        {
			case MY_BUTTON:
				do_something_on_release();
				break;
            default:
                APP_ERROR_HANDLER(pin_no);
                break;
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Cheers,
Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>