UNPKG

ziko

Version:

A versatile JavaScript library offering a rich set of Hyperscript Based UI components, advanced mathematical utilities, interactivity ,animations, client side routing and more ...

14 lines (12 loc) 406 B
const useSuccesifKeys=(self,keys=[],callback=()=>{})=>{ self.cache.stream.enabled.down=true; const length=keys.length; const LastKeysDown=self.cache.stream.history.down.slice(-length).map(n=>n.key); if(keys.join("")===LastKeysDown.join("")){ self.event.preventDefault(); callback.call(self,self); } } export { useSuccesifKeys }