Implemented key detection