wrote detection code for cases where we have a key that belongs to another keyboard