Utilizing ecma6 javascript, the GlobalEventHandlers can be employed to identify keys and touch events. There are various handlers available for different types of events.
When a user interacts with an element through touch/key/click, it can be detected in multiple ways. Specifically, for your query, a touch/click event comprises of two distinct actions: ontouchstart and ontouchend.
This essentially implies that if ontouchend is not triggered, the user is continuously touching the element, which signifies a long touch/click.
The code snippet below demonstrates the use of onmouseover, onmouseleave, ontouchstart, and ontouchend events.
shot.onmouseover = (function(){
console.log("Mouse action started!")
})
shot.onmouseleave = (function(){
console.log("Mouse action terminated!")
})
shot.ontouchstart = (function(){
console.log("Touch action started!")
})
shot.ontouchend = (function(){
console.log("Touch action terminated!")
})
#shot {width:100%;min-height:300px;background:red}
<div id="shot">Touch </div>