I have a boolean variable which is by default false. So now, I want the variable to become 'true' when a key is pressed and 'false' the key is released.
Example: When I press the shift key, the declared variable should return true and when I released it, the variable should return false.
I know Angular JS has two keyboard events (keydown and Keyup) but as long as I know, in most cases, they're only used with 'input' fields. So is there an alternative to utilize the methods without an input field?