adding keylogging and debouncing methods to keydown and keyup