# Double click button

You may wish to detect 'double-click' or 'triple-click' on buttons. This would be useful for showing special menus (layers) - or sending commands that need a little more security.

To detect 'multiple-clicks' we use 'Event handler - preprocessor'.

In this simple guide we want to control a variable called "ShowMenu". It has just two options: off / on.  
We create a behavior on a button - It must be double-clicked in order to set "ShowMenu" to 'on'

##### Create button behavior

• right-click desired button and select 'Create behavior'  
\- Parameter: Var:ShowMenu  
\- Settings template: \[leave blank\]

##### Create Event handler

• click 'Show more' &gt; locate Event handler section &gt; enter name "DblPress" and click 'Create' &gt; click new Event handler to open it  
\- Handler type: Binary  
\- Set values: 'on'

[![behavior.png](https://wiki.skaarhoj.com/uploads/images/gallery/2023-07/scaled-1680-/behavior.png)](https://wiki.skaarhoj.com/uploads/images/gallery/2023-07/behavior.png)

##### Create preprocessor (from binary)

• Locate the Event Preprocessor section &gt; next to From binary &gt; click '+' to create &gt; click it to edit  
• select 'Default' &gt; click '+' to create &gt; click 'ActDown' to open settings  
\- Repeat: Delayed &lt;-- start a timer  
\- Repeat delay: 300 &lt;-- timer lenght in milleseconds  
\- Burst count: 2 &lt;-- number of required button presses to proceed with output trigger  
\- Output trigger: ActDown

[![preprocessor.png](https://wiki.skaarhoj.com/uploads/images/gallery/2023-07/scaled-1680-/preprocessor.png)](https://wiki.skaarhoj.com/uploads/images/gallery/2023-07/preprocessor.png)

With the above, you must press button 2 times within 300ms for the action to proceed (ie. set ShowMenu to 'on')