import mousetrap from 'mousetrap' ; export type Handler = ( event : Event ) => void ; export const bindHoldCombination = ( combination , cb ) => { mousetrap . bindGlobal ( combination , cb ( true ) , 'keydown' ) ; mousetrap . bindGlobal ( combination , cb ( false ) , 'keyup' ) ; return ; } ; export const bindCombination = ( combination , cb ) => { mousetrap . bindGlobal ( combination , cb ) ; return ; } ; export const unbindHoldCombination = ( combination ) => { mousetrap . unbind ( combination , 'keydown' ) ; mousetrap . unbind ( combination , 'keyup' ) ; return ; } ; export const unbindCombination = ( combination ) => { mousetrap . unbind ( combination ) ; return ; } ;