pull/3282/head
Steve Ruiz 2024-04-18 14:33:42 +01:00
rodzic e209256084
commit 009ecc2b5a
3 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -1,4 +1,5 @@
import React, { useMemo } from 'react'
import { RIGHT_MOUSE_BUTTON } from '../constants'
import {
preventDefault,
releasePointerCapture,
@ -19,7 +20,7 @@ export function useCanvasEvents() {
function onPointerDown(e: React.PointerEvent) {
if ((e as any).isKilled) return
if (e.button === 2) {
if (e.button === RIGHT_MOUSE_BUTTON) {
editor.dispatch({
type: 'pointer',
target: 'canvas',

Wyświetl plik

@ -1,4 +1,5 @@
import { useMemo } from 'react'
import { RIGHT_MOUSE_BUTTON } from '../constants'
import { TLSelectionHandle } from '../editor/types/selection-types'
import {
loopToHtmlElement,
@ -18,7 +19,7 @@ export function useSelectionEvents(handle: TLSelectionHandle) {
const onPointerDown: React.PointerEventHandler = (e) => {
if ((e as any).isKilled) return
if (e.button === 2) {
if (e.button === RIGHT_MOUSE_BUTTON) {
editor.dispatch({
type: 'pointer',
target: 'selection',

Wyświetl plik

@ -641,6 +641,7 @@ export function useNativeClipboardEvents() {
let disablingMiddleClickPaste = false
const pointerUpHandler = (e: PointerEvent) => {
if (e.button === 1) {
// middle mouse button
disablingMiddleClickPaste = true
requestAnimationFrame(() => {
disablingMiddleClickPaste = false