prevent right click on canvas work

This commit is contained in:
Sanster
2022-04-27 17:23:01 +08:00
parent 3580d4281f
commit 390933f0eb
2 changed files with 11 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
import { useEffect, useState } from 'react'
import { SyntheticEvent, useEffect, useState } from 'react'
export function dataURItoBlob(dataURI: string) {
const mime = dataURI.split(',')[0].split(':')[1].split(';')[0]
@@ -182,3 +182,8 @@ export function keepGUIAlive() {
})
}
}
export function isRightClick(ev: SyntheticEvent) {
const mouseEvent = ev.nativeEvent as MouseEvent
return mouseEvent.button === 2
}