public function execute(Application $app) { // Retrieve a character $chr = ncurses_getch(); // Exit on escape switch ($chr) { case NCURSES_KEY_LEFT: $x = $this->window->getX(); $y = $this->window->getY(); $this->window->move(--$x, $y); break; case NCURSES_KEY_RIGHT: $x = $this->window->getX(); $y = $this->window->getY(); $this->window->move(++$x, $y); break; case NCURSES_KEY_UP: $x = $this->window->getX(); $y = $this->window->getY(); $this->window->move($x, --$y); break; case NCURSES_KEY_DOWN: $x = $this->window->getX(); $y = $this->window->getY(); $this->window->move($x, ++$y); break; case 27: $app->quit(); break; } }