ncurses_getmouse

(PHP 4 = 4.2.0)

ncurses_getmouse -- マウスイベントを読みこむ

説明

bool ncurses_getmouse ( array mevent)

警告

この関数は、 実験的 なステータスにあります。これは、この関数の 動作、関数名、ここで書かれていること全てがPHPの将来のバージョンで予告 なく変更される可能性があることを意味します。注意を喚起するとともに自分 のリスクでこの関数を使用して下さい。

ncurses_getmouse() reads mouse event out of queue. Function ncurses_getmouse() will return ; FALSE if a mouse event is actually visible in the given window, otherwise it will return TRUE . Event options will be delivered in parameter mevent , which has to be an array, passed by reference (see example below). On success an associative array with following keys will be delivered:



例 1 ncurses_getmouse() example

switch (ncurses_getch){
  case NCURSES_KEY_MOUSE:
    if (!ncurses_getmouse( $mevent)){
      if ($mevent["mmask"]   NCURSES_MOUSE_BUTTON1_PRESSED){
        $mouse_x = $mevent["x"]; // Save mouse position
        $mouse_y = $mevent["y"];
      }
    }
  break;

  default:
    ....
}


See also: ncurses_ungetmouse()