Search DaTutorials:  
HOME
Php Tutorials
Articles
Basics
Date and Time
File Manipulations
Forms
Functions
General
Interactivity
MySql
Navigation
News,Shoutboxes and Blogs
Language Structure and Data Types
Searching
Security
String Manipulation
User Information and Stats
Search For a Tutorial
Php Reference

ncurses_getmouse

(PHP 4 >= 4.2.0, PHP 5)

ncurses_getmouse -- Reads mouse event

Description

bool ncurses_getmouse ( array mevent)

Warning

This function is EXPERIMENTAL. The behaviour of this function, the name of this function, and anything else documented about this function may change without notice in a future release of PHP. Use this function at your own risk.

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:

  • "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

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

See also ncurses_ungetmouse()



Copyright © 2001-2004 The PHP Group
All rights reserved.

     Samsung | Personal Loans | Car Insurance | Free Ringtones | Free Ringtones
Home     Link To Us     Ad With Us     Contact Us     Tell A Friend     Affiliates     Blog     MsOfficeHelp