change keyboard control only when container has focus

otherwise it would hijack the keyboard arrows and space