SFML/bindings/ruby/sfml-window/doc/classes/SFML/Input.src/M000002.html

33 lines
1,007 B
HTML

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>isKeyDown (SFML::Input)</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
<pre>/* call-seq:
* input.isKeyDown( keycode ) -&gt; true or false
*
* Get the current state of a key (pressed or released).
*/
static VALUE Input_IsKeyDown( VALUE self, VALUE aKeyCode )
{
sf::Input *object = NULL;
Data_Get_Struct( self, sf::Input, object );
sf::Key::Code rawCode = static_cast&lt; sf::Key::Code &gt; ( NUM2INT( aKeyCode ) );
if( object-&gt;IsKeyDown( rawCode ) == true )
{
return Qtrue;
}
else
{
return Qfalse;
}
}</pre>
</body>
</html>