1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>SFML - Simple and Fast Multimedia Library</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="tabs.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="logo">
<img src="./logo.jpg" width="770" height="200" title="SFML home" alt="SFML logo" />
</div>
<!-- Generated by Doxygen 1.5.8 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.htm"><span>Main Page</span></a></li>
<li><a href="namespaces.htm"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.htm"><span>Classes</span></a></li>
<li><a href="files.htm"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.htm"><span>Class List</span></a></li>
<li><a href="classes.htm"><span>Class Index</span></a></li>
<li><a href="hierarchy.htm"><span>Class Hierarchy</span></a></li>
<li><a href="functions.htm"><span>Class Members</span></a></li>
</ul>
</div>
<div class="navpath"><b>sf</b>::<a class="el" href="classsf_1_1Input.htm">Input</a>
</div>
</div>
<div class="contents">
<h1>sf::Input Class Reference</h1><!-- doxytag: class="sf::Input" --><!-- doxytag: inherits="sf::WindowListener,sf::NonCopyable" --><a class="el" href="classsf_1_1Input.htm" title="Input handles real-time input from keyboard and mouse.">Input</a> handles real-time input from keyboard and mouse.
<a href="#_details">More...</a>
<p>
<code>#include <<a class="el" href="Input_8hpp-source.htm">Input.hpp</a>></code>
<p>
<div class="dynheader">
Inheritance diagram for sf::Input:</div>
<div class="dynsection">
<p><center><img src="classsf_1_1Input.png" usemap="#sf::Input_map" border="0" alt=""></center>
<map name="sf::Input_map">
<area href="classsf_1_1WindowListener.htm" alt="sf::WindowListener" shape="rect" coords="0,0,117,24">
<area href="structsf_1_1NonCopyable.htm" alt="sf::NonCopyable" shape="rect" coords="127,0,244,24">
</map>
</div>
<p>
<a href="classsf_1_1Input-members.htm">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Input.htm#35393e09fc92f7523e52af1c203b958f">Input</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. <a href="#35393e09fc92f7523e52af1c203b958f"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Input.htm#5312ed524e1f2837aa4597978553876a">IsKeyDown</a> (<a class="el" href="namespacesf_1_1Key.htm#d32ed01d3448273340bd25af5cdd9c81">Key::Code</a> KeyCode) const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the state of a key. <a href="#5312ed524e1f2837aa4597978553876a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Input.htm#28c36d05d76f2263faf803e29ffa9dea">IsMouseButtonDown</a> (Mouse::Button Button) const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the state of a mouse button. <a href="#28c36d05d76f2263faf803e29ffa9dea"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Input.htm#715d9533617ef9fc25152ebd6b7ece08">IsJoystickButtonDown</a> (unsigned int JoyId, unsigned int Button) const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the state of a joystick button. <a href="#715d9533617ef9fc25152ebd6b7ece08"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Input.htm#2100db642800d4d3e21579c72bed99b3">GetMouseX</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the mouse X position. <a href="#2100db642800d4d3e21579c72bed99b3"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Input.htm#fe8a8e65be0a5840de9865054aaa5796">GetMouseY</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the mouse Y position. <a href="#fe8a8e65be0a5840de9865054aaa5796"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">float </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Input.htm#4edf71238ae3d311c4b6e5e6895c6896">GetJoystickAxis</a> (unsigned int JoyId, Joy::Axis Axis) const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get a joystick axis position. <a href="#4edf71238ae3d311c4b6e5e6895c6896"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<a class="el" href="classsf_1_1Input.htm" title="Input handles real-time input from keyboard and mouse.">Input</a> handles real-time input from keyboard and mouse.
<p>
Use it instead of events to handle continuous moves and more game-friendly inputs
<p>Definition at line <a class="el" href="Input_8hpp-source.htm#l00044">44</a> of file <a class="el" href="Input_8hpp-source.htm">Input.hpp</a>.</p>
<hr><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" name="35393e09fc92f7523e52af1c203b958f"></a><!-- doxytag: member="sf::Input::Input" ref="35393e09fc92f7523e52af1c203b958f" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">sf::Input::Input </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Default constructor.
<p>
<p>Definition at line <a class="el" href="Input_8cpp-source.htm#l00036">36</a> of file <a class="el" href="Input_8cpp-source.htm">Input.cpp</a>.</p>
</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="4edf71238ae3d311c4b6e5e6895c6896"></a><!-- doxytag: member="sf::Input::GetJoystickAxis" ref="4edf71238ae3d311c4b6e5e6895c6896" args="(unsigned int JoyId, Joy::Axis Axis) const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">float sf::Input::GetJoystickAxis </td>
<td>(</td>
<td class="paramtype">unsigned int </td>
<td class="paramname"> <em>JoyId</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Joy::Axis </td>
<td class="paramname"> <em>Axis</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Get a joystick axis position.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>JoyId</em> </td><td>: Identifier of the joystick to check (0 or 1) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Axis</em> </td><td>: Axis to get</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Current axis position, in the range [-100, 100] (except for POV, which is [0, 360]) </dd></dl>
<p>Definition at line <a class="el" href="Input_8cpp-source.htm#l00095">95</a> of file <a class="el" href="Input_8cpp-source.htm">Input.cpp</a>.</p>
</div>
</div><p>
<a class="anchor" name="2100db642800d4d3e21579c72bed99b3"></a><!-- doxytag: member="sf::Input::GetMouseX" ref="2100db642800d4d3e21579c72bed99b3" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int sf::Input::GetMouseX </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Get the mouse X position.
<p>
Get the mouse left position.<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Current mouse left position, relative to owner window </dd></dl>
<p>Definition at line <a class="el" href="Input_8cpp-source.htm#l00077">77</a> of file <a class="el" href="Input_8cpp-source.htm">Input.cpp</a>.</p>
</div>
</div><p>
<a class="anchor" name="fe8a8e65be0a5840de9865054aaa5796"></a><!-- doxytag: member="sf::Input::GetMouseY" ref="fe8a8e65be0a5840de9865054aaa5796" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int sf::Input::GetMouseY </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Get the mouse Y position.
<p>
Get the mouse top position.<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Current mouse top position, relative to owner window </dd></dl>
<p>Definition at line <a class="el" href="Input_8cpp-source.htm#l00086">86</a> of file <a class="el" href="Input_8cpp-source.htm">Input.cpp</a>.</p>
</div>
</div><p>
<a class="anchor" name="715d9533617ef9fc25152ebd6b7ece08"></a><!-- doxytag: member="sf::Input::IsJoystickButtonDown" ref="715d9533617ef9fc25152ebd6b7ece08" args="(unsigned int JoyId, unsigned int Button) const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool sf::Input::IsJoystickButtonDown </td>
<td>(</td>
<td class="paramtype">unsigned int </td>
<td class="paramname"> <em>JoyId</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned int </td>
<td class="paramname"> <em>Button</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Get the state of a joystick button.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>JoyId</em> </td><td>: Identifier of the joystick to check (0 or 1) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>Button</em> </td><td>: Button to check</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>True if button is down, false if button is up </dd></dl>
<p>Definition at line <a class="el" href="Input_8cpp-source.htm#l00065">65</a> of file <a class="el" href="Input_8cpp-source.htm">Input.cpp</a>.</p>
</div>
</div><p>
<a class="anchor" name="5312ed524e1f2837aa4597978553876a"></a><!-- doxytag: member="sf::Input::IsKeyDown" ref="5312ed524e1f2837aa4597978553876a" args="(Key::Code KeyCode) const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool sf::Input::IsKeyDown </td>
<td>(</td>
<td class="paramtype"><a class="el" href="namespacesf_1_1Key.htm#d32ed01d3448273340bd25af5cdd9c81">Key::Code</a> </td>
<td class="paramname"> <em>KeyCode</em> </td>
<td> ) </td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Get the state of a key.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>KeyCode</em> </td><td>: <a class="el" href="namespacesf_1_1Key.htm" title="Definition of key codes for keyboard events.">Key</a> to check</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>True if key is down, false if key is up </dd></dl>
<p>Definition at line <a class="el" href="Input_8cpp-source.htm#l00047">47</a> of file <a class="el" href="Input_8cpp-source.htm">Input.cpp</a>.</p>
</div>
</div><p>
<a class="anchor" name="28c36d05d76f2263faf803e29ffa9dea"></a><!-- doxytag: member="sf::Input::IsMouseButtonDown" ref="28c36d05d76f2263faf803e29ffa9dea" args="(Mouse::Button Button) const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool sf::Input::IsMouseButtonDown </td>
<td>(</td>
<td class="paramtype">Mouse::Button </td>
<td class="paramname"> <em>Button</em> </td>
<td> ) </td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Get the state of a mouse button.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>Button</em> </td><td>: Button to check</td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>True if button is down, false if button is up </dd></dl>
<p>Definition at line <a class="el" href="Input_8cpp-source.htm#l00056">56</a> of file <a class="el" href="Input_8cpp-source.htm">Input.cpp</a>.</p>
</div>
</div><p>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="Input_8hpp-source.htm">Input.hpp</a><li><a class="el" href="Input_8cpp-source.htm">Input.cpp</a></ul>
</div>
<p id="footer">
:: Copyright © 2007-2008 Laurent Gomila, all rights reserved ::
Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen 1.5.2</a> ::
</p>
</body>
</html>
|