# Pointer Event Pressure Property Data Type

**URL:** <https://forum.inductiveautomation.com/t/pointer-event-pressure-property-data-type/61544>\
**Category:** Ignition\
**Tags:** ignition80, perspective\
**Created:** [July 6, 2022, 1:34am UTC](https://forum.inductiveautomation.com/t/pointer-event-pressure-property-data-type/61544 "2022-07-06T01:34:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![WillMT10](https://avatars.discourse-cdn.com/v4/letter/w/7feea3/32.png) [@WillMT10](https://forum.inductiveautomation.com/u/WillMT10)\
**Post date:** [July 6, 2022, 1:34am UTC](https://forum.inductiveautomation.com/t/pointer-event-pressure-property-data-type/61544/1 "2022-07-06T01:34:52Z")

</div>

I was trying to use the `event.pressure` property for an `onPointerDown` event and kept getting `0` as the returned value. After some testing I realized the documentation lists the pressure as type `int` and a quick `type(event.pressure)` check confirms it to be `<type 'long'>`. I’m assuming this should be a `float` or `double`?

Edit: This is version 8.1.18.

 ![pointer_pressure_type](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/b/5bd98784b86ab31000071856a3c6c8b48e5b3d95.png)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 6, 2022, 3:55pm UTC](https://forum.inductiveautomation.com/t/pointer-event-pressure-property-data-type/61544/2 "2022-07-06T15:55:24Z")

</div>

Hmm. The autocomplete is ‘wrong’ because the JS type is ‘number’ and there’s no direct analog for that in Python (JS numbers are effectively doubles, but more often than not used as integers).

That said, a quick test on my (non touchscreen) device gave me a float value for pressure when I clicked, so I don’t think the underlying mechanism is wrong here:

```json
{
    "altKey": false,
    "bubbles": true,
    "button": 0,
    "buttons": 1,
    "cancelable": true,
    "clientX": 512,
    "clientY": 163,
    "ctrlKey": false,
    "defaultPrevented": false,
    "detail": 0,
    "eventPhase": 3,
    "height": 1,
    "isPrimary": true,
    "isTrusted": true,
    "metaKey": false,
    "movementX": 0,
    "movementY": 0,
    "pageX": 512,
    "pageY": 163,
    "pointerId": 1,
    "pointerType": "mouse",
    "pressure": 0.5,
    "screenX": 960,
    "screenY": 247,
    "shiftKey": false,
    "tangentialPressure": 0,
    "tiltX": 0,
    "tiltY": 0,
    "timeStamp": 241849.3999999985,
    "twist": 0,
    "type": "pointerdown",
    "width": 1
}

```

Can you test on different hardware? Can you confirm that the `pressure` property is set on the websocket message sent from the frontend to the backend (via browser devtools, you can watch the traffic)?

---

<div class="post-metadata">

**Author:** ![WillMT10](https://avatars.discourse-cdn.com/v4/letter/w/7feea3/32.png) [@WillMT10](https://forum.inductiveautomation.com/u/WillMT10)\
**Post date:** [July 7, 2022, 3:00pm UTC](https://forum.inductiveautomation.com/t/pointer-event-pressure-property-data-type/61544/3 "2022-07-07T15:00:26Z")

</div>

I can confirm that I get the same `0.5` pressure value when I use a mouse or trackpad through Chrome/Safari on my Mac. Where I keep getting a value of `0` is on my iPad using standard touchscreen controls. I checked both in the Perspective app (v1.0.3-3) and in the Chrome app (103.0.5060.63).

Is there a simple way to monitor the web socket message from an iPad?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 7, 2022, 3:02pm UTC](https://forum.inductiveautomation.com/t/pointer-event-pressure-property-data-type/61544/4 "2022-07-07T15:02:14Z")

</div>

This all seems correct.

> For hardware that does not support pressure, such as a mouse, the value is `0.5` when the pointer is active buttons state and `0` otherwise.

The iPad doesn't support pressure unless you're using a stylus and even then I'm not sure about in the browser...

---

<div class="post-metadata">

**Author:** ![WillMT10](https://avatars.discourse-cdn.com/v4/letter/w/7feea3/32.png) [@WillMT10](https://forum.inductiveautomation.com/u/WillMT10)\
**Post date:** [July 7, 2022, 3:16pm UTC](https://forum.inductiveautomation.com/t/pointer-event-pressure-property-data-type/61544/5 "2022-07-07T15:16:59Z")

</div>

Oh interesting…in my mind I just assumed the iPad supported pressure.

I was hoping to use that as a way to prevent errant light touches from triggering events on components that do not have an associated `actionPerformed` event. Back to the drawing board.
