Slightly modified the input class to get pressed and released key & button events