# onWheel event question

**URL:** <https://forum.inductiveautomation.com/t/onwheel-event-question/110269>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [August 29, 2025, 9:51am UTC](https://forum.inductiveautomation.com/t/onwheel-event-question/110269 "2025-08-29T09:51:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [August 29, 2025, 9:51am UTC](https://forum.inductiveautomation.com/t/onwheel-event-question/110269/1 "2025-08-29T09:51:54Z")

</div>

Good morning,

I wonder how should be possible to know if I’m wheeling up or down.

If I run this script

```python
    
    deltaMode = 0
    deltaY = 2
    deltaX = 5
    deltaZ = 10
    
    system.perspective.print(deltaX)
    system.perspective.print(deltaY)
    system.perspective.print(deltaZ)

```

I have these results in the browser

```python
5
2
10
5
2
10

```

In the first case I scroll up the wheel, in the second I scroll down.

---

<div class="post-metadata">

**Author:** ![Cose\_Peter1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cose_peter1/32/79174_2.png) [@Cose\_Peter1](https://forum.inductiveautomation.com/u/Cose_Peter1)\
**Post date:** [August 29, 2025, 11:09am UTC](https://forum.inductiveautomation.com/t/onwheel-event-question/110269/2 "2025-08-29T11:09:16Z")

</div>

On what event are you running the provided script?

---

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [August 29, 2025, 11:15am UTC](https://forum.inductiveautomation.com/t/onwheel-event-question/110269/3 "2025-08-29T11:15:03Z")

</div>

> [@Cose\_Peter1](#):
>
> event are you running the provided script?

Actually I try running it on the main flex of a view.

---

<div class="post-metadata">

**Author:** ![Cose\_Peter1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cose_peter1/32/79174_2.png) [@Cose\_Peter1](https://forum.inductiveautomation.com/u/Cose_Peter1)\
**Post date:** [August 29, 2025, 11:24am UTC](https://forum.inductiveautomation.com/t/onwheel-event-question/110269/4 "2025-08-29T11:24:39Z")

</div>

I meant like on what event were you trying to run the script that you provided. i.e(onWheel, onClick)

I tried this in onWheel event:

```python

def runAction(self, event):
		
	verticalScroll = event.deltaY
	
	if verticalScroll > 0:
		system.perspective.print("Scroll Down")
	elif verticalScroll < 0:
		system.perspective.print("Scroll Up")

```

Hope this is what you are looking for.

---

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [August 29, 2025, 2:14pm UTC](https://forum.inductiveautomation.com/t/onwheel-event-question/110269/5 "2025-08-29T14:14:43Z")

</div>

Yes thank you, this is what I need.
