ncurses_getmouse

(PHP 4 >= 4.2.0, PHP 5 < 5.3.0, PECL ncurses >= 1.0.0)

ncurses_getmouseReads mouse event

설명

bool ncurses_getmouse ( array &$mevent )
Warning

이 함수는 실험적입니다. 이 함수의 작동, 함수의 이름, 그리고 관련된 모든 문서는 이후의 PHP 릴리즈에서 예고 없이 변경할 수 있습니다. 이 함수의 사용에 관한 것은 사용자 책임입니다.

ncurses_getmouse() reads mouse event out of queue.

인수

mevent

Event options will be delivered in this parameter which has to be an array, passed by reference (see example below).

On success an associative array with following keys will be delivered:

  • "id" : Id to distinguish multiple devices

  • "x" : screen relative x-position in character cells

  • "y" : screen relative y-position in character cells

  • "z" : currently not supported

  • "mmask" : Mouse action

반환값

Returns FALSE if a mouse event is actually visible in the given window, otherwise returns TRUE.

예제

Example #1 ncurses_getmouse() example

<?php
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:
    
/* .... */
}
?>

참고

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top