public function matchKey($key) { //Maps a keyboard key to a gameboy key. //Order: Right, Left, Up, Down, A, B, Select, Start $keyIndex = array_search($key, Settings::$keyboardButtonMap); if ($keyIndex === false) { return -1; } return $keyIndex; }