# Right mouse button function

**URL:** <https://forums.creativeclouddeveloper.com/t/right-mouse-button-function/8962>\
**Category:** Photoshop\
**Created:** [December 28, 2024, 8:07pm UTC](https://forums.creativeclouddeveloper.com/t/right-mouse-button-function/8962 "2024-12-28T20:07:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![haller](https://avatars.discourse-cdn.com/v4/letter/h/53a042/32.png) [@haller](https://forums.creativeclouddeveloper.com/u/haller)\
**Post date:** [December 28, 2024, 8:07pm UTC](https://forums.creativeclouddeveloper.com/t/right-mouse-button-function/8962/1 "2024-12-28T20:07:57Z")

</div>

I looked around a bit but couldn’t find anything on this topic. I wanted to use the right mouse button to assign a function. If anyone has any ideas they can share them.

---

<div class="post-metadata">

**Author:** ![AnthonyK](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@AnthonyK](https://forums.creativeclouddeveloper.com/u/AnthonyK)\
**Post date:** [December 29, 2024, 1:11am UTC](https://forums.creativeclouddeveloper.com/t/right-mouse-button-function/8962/2 "2024-12-29T01:11:22Z")

</div>

```auto
document.getElementById("myButton").addEventListener("contextmenu", async(event) => {
 //code for right-click goes here
 });

```

---

<div class="post-metadata">

**Author:** ![haller](https://avatars.discourse-cdn.com/v4/letter/h/53a042/32.png) [@haller](https://forums.creativeclouddeveloper.com/u/haller)\
**Post date:** [December 29, 2024, 11:17am UTC](https://forums.creativeclouddeveloper.com/t/right-mouse-button-function/8962/3 "2024-12-29T11:17:58Z")

</div>

AnthonyK  
Just what I was looking for  
thanks
