first stab at keyboard pattern matching