| 56 | // --------------------------------------------------------------------------- |
| 57 | |
| 58 | function adaptClickEvent(e: MouseEvent<HTMLDivElement>): WebClickEvent { |
| 59 | let stopped = false |
| 60 | const shim: WebClickEvent = { |
| 61 | x: e.clientX, |
| 62 | y: e.clientY, |
| 63 | button: e.button === 2 ? 'right' : e.button === 1 ? 'middle' : 'left', |
| 64 | stopImmediatePropagation() { |
| 65 | if (!stopped) { |
| 66 | stopped = true |
| 67 | e.stopPropagation() |
| 68 | } |
| 69 | }, |
| 70 | } |
| 71 | return shim |
| 72 | } |
| 73 | |
| 74 | function adaptFocusEvent(e: React.FocusEvent<HTMLDivElement>): WebFocusEvent { |
| 75 | return { |