mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 22:06:57 +08:00
115 lines
5.6 KiB
HTML
115 lines
5.6 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
<title>Reads mouse event</title>
|
|
</head>
|
|
<body class="docs"><div id="layout">
|
|
<div id="layout-content"><div id="function.ncurses-getmouse" class="refentry">
|
|
<div class="refnamediv">
|
|
<h1 class="refname">ncurses_getmouse</h1>
|
|
<p class="verinfo">(PHP 4 >= 4.2.0, PHP 5 < 5.3.0, PECL ncurses >= 1.0.0)</p><p class="refpurpose"><span class="refname">ncurses_getmouse</span> — <span class="dc-title">Reads mouse event</span></p>
|
|
|
|
</div>
|
|
<div class="refsect1 description" id="refsect1-function.ncurses-getmouse-description">
|
|
<h3 class="title">说明</h3>
|
|
<div class="methodsynopsis dc-description">
|
|
<span class="methodname"><strong>ncurses_getmouse</strong></span>
|
|
( <span class="methodparam"><span class="type">array</span> <code class="parameter reference">&$mevent</code></span>
|
|
) : <span class="type">bool</span></div>
|
|
|
|
<div class="warning"><strong class="warning">Warning</strong><p class="simpara">此函数是<em class="emphasis">实验性</em>的。此函数的表象,包括名称及其相关文档都可能在未来的
|
|
PHP 发布版本中未通知就被修改。使用本函数风险自担 。</p></div>
|
|
<p class="para">
|
|
<span class="function"><strong>ncurses_getmouse()</strong></span> reads mouse event out of
|
|
queue.
|
|
</p>
|
|
</div>
|
|
|
|
<div class="refsect1 parameters" id="refsect1-function.ncurses-getmouse-parameters">
|
|
<h3 class="title">参数</h3>
|
|
<p class="para">
|
|
<dl>
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">mevent</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
Event options will be delivered in this parameter which has to be an
|
|
array, passed by reference (see example below).
|
|
</p>
|
|
<p class="para">
|
|
On success an associative array with following keys will be delivered:
|
|
<ul class="itemizedlist">
|
|
<li class="listitem">
|
|
<p class="para">
|
|
"id" : Id to distinguish multiple devices
|
|
</p>
|
|
</li>
|
|
<li class="listitem">
|
|
<p class="para">
|
|
"x" : screen relative x-position in character cells
|
|
</p>
|
|
</li>
|
|
<li class="listitem">
|
|
<p class="para">
|
|
"y" : screen relative y-position in character cells
|
|
</p>
|
|
</li>
|
|
<li class="listitem">
|
|
<p class="para">
|
|
"z" : currently not supported
|
|
</p>
|
|
</li>
|
|
<li class="listitem">
|
|
<p class="para">
|
|
"mmask" : Mouse action
|
|
</p>
|
|
</li>
|
|
</ul>
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
|
|
</p>
|
|
</div>
|
|
|
|
<div class="refsect1 returnvalues" id="refsect1-function.ncurses-getmouse-returnvalues">
|
|
<h3 class="title">返回值</h3>
|
|
<p class="para">
|
|
Returns <strong><code>FALSE</code></strong> if a mouse event is actually visible in the given window,
|
|
otherwise returns <strong><code>TRUE</code></strong>.
|
|
</p>
|
|
</div>
|
|
|
|
<div class="refsect1 examples" id="refsect1-function.ncurses-getmouse-examples">
|
|
<h3 class="title">范例</h3>
|
|
<p class="para">
|
|
<div class="example" id="example-680">
|
|
<p><strong>Example #1 <span class="function"><strong>ncurses_getmouse()</strong></span> example</strong></p>
|
|
<div class="example-contents">
|
|
<div class="phpcode"><pre><span style="color: #000000">
|
|
<span style="color: #0000BB"><?php<br /></span><span style="color: #007700">switch (</span><span style="color: #0000BB">ncurses_getch</span><span style="color: #007700">()){<br /> case </span><span style="color: #0000BB">NCURSES_KEY_MOUSE</span><span style="color: #007700">:<br /> if (!</span><span style="color: #0000BB">ncurses_getmouse</span><span style="color: #007700">(</span><span style="color: #0000BB">$mevent</span><span style="color: #007700">)){<br /> if (</span><span style="color: #0000BB">$mevent</span><span style="color: #007700">[</span><span style="color: #DD0000">"mmask"</span><span style="color: #007700">] & </span><span style="color: #0000BB">NCURSES_MOUSE_BUTTON1_PRESSED</span><span style="color: #007700">){<br /> </span><span style="color: #0000BB">$mouse_x </span><span style="color: #007700">= </span><span style="color: #0000BB">$mevent</span><span style="color: #007700">[</span><span style="color: #DD0000">"x"</span><span style="color: #007700">]; </span><span style="color: #FF8000">// Save mouse position<br /> </span><span style="color: #0000BB">$mouse_y </span><span style="color: #007700">= </span><span style="color: #0000BB">$mevent</span><span style="color: #007700">[</span><span style="color: #DD0000">"y"</span><span style="color: #007700">];<br /> }<br /> }<br /> break;<br /><br /> default:<br /> </span><span style="color: #FF8000">/* .... */<br /></span><span style="color: #007700">}<br /></span><span style="color: #0000BB">?></span>
|
|
</span>
|
|
</pre></div>
|
|
</div>
|
|
|
|
</div>
|
|
</p>
|
|
</div>
|
|
|
|
<div class="refsect1 seealso" id="refsect1-function.ncurses-getmouse-seealso">
|
|
<h3 class="title">参见</h3>
|
|
<p class="para">
|
|
<ul class="simplelist">
|
|
<li class="member"><span class="function"><a href="ncurses_ungetmouse.html" class="function" rel="rdfs-seeAlso">ncurses_ungetmouse()</a> - Pushes mouse event to queue</span></li>
|
|
</ul>
|
|
</p>
|
|
</div>
|
|
|
|
</div></div></div></body></html> |