Button Handler (key handling program)
Key handlers are implemented using the processing mechanism of the Gpiote(GPIO Task and Event) to prevent keystrokes from dithering. The timer is turned on in the Gpiote event handler.
After the timer expires, the button corresponding to the PIN is still valid (the button has been pressed), the key press event will be reported to the application.
When the timer is in the process of execution, and a new Gpiote event is generated, the timer will start again. Also in the App_button_init () macro definition. The number of Use_scheduler indicates whether to use scheduler (I do not know what the scheduler is for, and later study to say).
Note: The timer in the key handler uses the virtual timer (App_timer), not the peripheral timer (Rtc0,rt1,tim0, tim1, tim2, ), the user must ensure that the cache (queue" is large enough so that the talent remains in the Gpiote module of events (event)   app_timer_stop ()  /  app_timer_start () operation.
Even Scheduler not used. Also need to be in App_button.h includes App_scheduler.h, so when compiling. app_scheduler.h must be included in the compiler's path (include paths).  
in app_ble_hrs program, finally through Button_handler_ The P_btn->button_handler (p_btn->pin_no) call in the Execute function implements the processing of the keys.
Application of App_button in nrf51822