# How to disable right-click / contect memu

**URL:** <https://discourse.nodered.org/t/how-to-disable-right-click-contect-memu/42484>\
**Category:** Dashboard\
**Created:** [11 March 2021 14:32 UTC](https://discourse.nodered.org/t/how-to-disable-right-click-contect-memu/42484 "2021-03-11T14:32:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jejmule](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jejmule/32/38667_2.png) [@jejmule](https://discourse.nodered.org/u/jejmule)\
**Post date:** [11 March 2021 14:32 UTC](https://discourse.nodered.org/t/how-to-disable-right-click-contect-memu/42484/1 "2021-03-11T14:32:30Z")

</div>

Hi,

I am developing a dashboard to control a treadmill. One function is to change the slope of the treadmill. I am using a customize button node to move up or down while the button is pressed.

I am using a touchscreen sometimes depending on how the button is pressed the right click is emulated and context menu is shown. My problem is that while the context menu is open my motor is still moving even if I do not longer press the button.

My app is a "kiosk" application, I would like to disable contextual menu for my entire dashboard. How can I do that.

Thank you in advance,  
Jérôme

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [11 March 2021 15:27 UTC](https://discourse.nodered.org/t/how-to-disable-right-click-contect-memu/42484/2 "2021-03-11T15:27:45Z")

</div>

You can add a ui\_template set to be part of the page head section containing

```auto
<script>
document.addEventListener('contextmenu', event => event.preventDefault());
</script>

```

---

<div class="post-metadata">

**Author:** ![jejmule](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jejmule/32/38667_2.png) [@jejmule](https://discourse.nodered.org/u/jejmule)\
**Post date:** [29 March 2021 07:52 UTC](https://discourse.nodered.org/t/how-to-disable-right-click-contect-memu/42484/3 "2021-03-29T07:52:30Z")

</div>

Thanks a lot, it works like a charm.  
Sorry for the late reply 😉

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [12 April 2021 07:52 UTC](https://discourse.nodered.org/t/how-to-disable-right-click-contect-memu/42484/4 "2021-04-12T07:52:42Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
