mirror of
https://github.com/cupcakearmy/old.nicco.io.git
synced 2025-09-05 18:20:46 +00:00
check if mouse if set
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
|
||||
|
||||
|
||||
type Size = { width: number, height: number }
|
||||
export const useInnerWindowSize = (): Size => {
|
||||
const getCurrentSize = (): Size => ({
|
||||
@@ -19,7 +21,7 @@ export const useInnerWindowSize = (): Size => {
|
||||
}
|
||||
|
||||
export const useIsMousePresent = () => {
|
||||
let [present, setPresent] = useState<boolean>(false)
|
||||
let [present, setPresent] = useState<boolean>(!('ontouchstart' in window) && ('onmousemove' in window))
|
||||
|
||||
useEffect(() => {
|
||||
const enter = () => setPresent(true)
|
||||
|
Reference in New Issue
Block a user