---
# System prepended metadata

title: Event source
tags: [zeta-dom]

---

---
tags: zeta-dom
---

Zeta DOM » [Events](/UoWLMJmFREyF6wtAwfN7xw)

# Event source

When binding a UI event through `zeta.dom.on`, the event argument also contains a property `source`, indicating what triggered the UI event.

Possible source values are:

| Source   | Description |
| -------- | ----------- |
| script   |             |
| mouse    |             |
| keyboard |             |
| touch    |             |
| input    |             |
| cut      |             |
| copy     |             |
| paste    |             |
| drop     |             |


It is particularly useful for `textInput` and `click` event because they have multiple physical source.

```typescript
zeta.dom.on('click', (e) {
    if (e.source === 'touch') {
        // do something
    } else {
        // do something different
    }
});
```

### `ZetaEventSource`
### `getEventSource`
### `prepEventSource`
### `setLastEventSource`
