Is this possible to generate a new Zabbix event from a Ruby script? I was suggested to use [zabbix\_sender](http://www.zabbix.com/documentation/1.8/manpages/zabbix_sender) script, but I couldn't find any example.

Also, I couldn't find any API related to the [events](http://www.zabbix.com/documentation/1.8/api/event) creation.
['https://Stackoverflow.com/questions/11287899', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/398309/']
The correct answer based on the comments in the suggested answer:

```
e.offsetX = e.touches[0].pageX - e.touches[0].target.offsetLeft;     
e.offsetY = e.touches[0].pageY - e.touches[0].target.offsetTop;

```

This ignores any transformations such as rotations or scaling. Also be sure to check if there are any touches.
The page - offset / client approach did not work for me. There was still an offset. I found this other solution that works perfectly:

```
let r = canvas.getBoundingClientRect();

let x = e.touches[0].pageX - r.left;
let y = e.touches[0].pageY - r.top;

```