Here is a solution for disabling event on some particular ocurrace. for example here, when user on anywhere on document and press key Up and Down then it will moves menu selection but if user is on contact for input element for writing text then it wil