12 lines
7.5 KiB
HTML
12 lines
7.5 KiB
HTML
<html><head><meta http-equiv="X-UA-Compatible" content="IE=edge" /><link rel="shortcut icon" href="../icons/favicon.ico" /><link rel="stylesheet" type="text/css" href="../styles/branding.css" /><link rel="stylesheet" type="text/css" href="../styles/branding-en-US.css" /><script type="text/javascript" src="../scripts/branding.js"> </script><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>SpriteController.IsKeyPressed Method (Keys)</title><meta name="Language" content="en-us" /><meta name="Microsoft.Help.Id" content="M:SpriteLibrary.SpriteController.IsKeyPressed(System.Windows.Forms.Keys)" /><meta name="Description" content="Check to see if the given key is pressed. There is a small glitch with the key-pressed system. If the form loses focus, and someone releases a key, the key-up is never triggered." /><meta name="Microsoft.Help.ContentType" content="Reference" /><meta name="BrandingAware" content="true" /><meta name="container" content="SpriteLibrary" /><meta name="file" content="7fc92c27-7895-2b2c-d4f1-ac682eec7af5" /><meta name="guid" content="7fc92c27-7895-2b2c-d4f1-ac682eec7af5" /><link rel="stylesheet" type="text/css" href="../styles/branding-Website.css" /><script type="text/javascript" src="../scripts/jquery-1.11.0.min.js"></script><script type="text/javascript" src="../scripts/branding-Website.js"></script><script type="text/javascript" src="../scripts/clipboard.min.js"></script></head><body onload="OnLoad('cs')"><input type="hidden" id="userDataCache" class="userDataStyle" /><div class="pageHeader" id="PageHeader">SpriteLibrary<form id="SearchForm" method="get" action="#" onsubmit="javascript:TransferToSearchPage(); return false;"><input id="SearchTextBox" type="text" maxlength="200" /><button id="SearchButton" type="submit"></button></form></div><div class="pageBody"><div class="leftNav" id="leftNav"><div id="tocNav"><div class="toclevel0" data-toclevel="0"><a class="tocCollapsed" onclick="javascript: Toggle(this);" href="#!" /><a data-tochassubtree="true" href="6b7227c0-7a6a-6342-3b08-917c7de429cc.htm" title="SpriteLibrary" tocid="roottoc">SpriteLibrary</a></div><div class="toclevel0" data-toclevel="0"><a class="tocCollapsed" onclick="javascript: Toggle(this);" href="#!" /><a data-tochassubtree="true" href="6b7227c0-7a6a-6342-3b08-917c7de429cc.htm" title="SpriteLibrary" tocid="6b7227c0-7a6a-6342-3b08-917c7de429cc">SpriteLibrary</a></div><div class="toclevel0" data-toclevel="0"><a class="tocCollapsed" onclick="javascript: Toggle(this);" href="#!" /><a data-tochassubtree="true" href="07a473e4-4716-e5b9-c7d2-c4748265fc58.htm" title="SpriteController Class" tocid="07a473e4-4716-e5b9-c7d2-c4748265fc58">SpriteController Class</a></div><div class="toclevel0" data-toclevel="0"><a class="tocCollapsed" onclick="javascript: Toggle(this);" href="#!" /><a data-tochassubtree="true" href="2788d4d5-88bf-1154-dd17-8d4b99a79118.htm" title="SpriteController Methods" tocid="2788d4d5-88bf-1154-dd17-8d4b99a79118">SpriteController Methods</a></div><div class="toclevel1" data-toclevel="1" data-childrenloaded="true"><a class="tocExpanded" onclick="javascript: Toggle(this);" href="#!" /><a data-tochassubtree="true" href="50eae5e0-c59c-9d9c-d551-21dba8696ac9.htm" title="IsKeyPressed Method " tocid="50eae5e0-c59c-9d9c-d551-21dba8696ac9">IsKeyPressed Method </a></div><div class="toclevel2" data-toclevel="2"><a data-tochassubtree="false" href="bf10cc41-d9e2-52c5-0415-1083f0f55489.htm" title="IsKeyPressed Method " tocid="bf10cc41-d9e2-52c5-0415-1083f0f55489">IsKeyPressed Method </a></div><div class="toclevel2 current" data-toclevel="2"><a data-tochassubtree="false" href="7fc92c27-7895-2b2c-d4f1-ac682eec7af5.htm" title="IsKeyPressed Method (Keys)" tocid="7fc92c27-7895-2b2c-d4f1-ac682eec7af5">IsKeyPressed Method (Keys)</a></div></div><div id="tocResizableEW" onmousedown="OnMouseDown(event);"></div><div id="TocResize" class="tocResize"><img id="ResizeImageIncrease" src="../icons/TocOpen.gif" onclick="OnIncreaseToc()" alt="Click or drag to resize" title="Click or drag to resize" /><img id="ResizeImageReset" src="../icons/TocClose.gif" style="display:none" onclick="OnResetToc()" alt="Click or drag to resize" title="Click or drag to resize" /></div></div><div class="topicContent" id="TopicContent"><table class="titleTable"><tr><td class="titleColumn"><h1>SpriteController<span id="LST3899C3E3_0"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST3899C3E3_0?cpp=::|nu=.");</script>IsKeyPressed Method (Keys)</h1></td></tr></table><span class="introStyle"></span> <div class="summary">
|
||
Check to see if the given key is pressed. There is a small glitch with the
|
||
key-pressed system. If the form loses focus, and someone releases a key, the key-up is never
|
||
triggered. It is a good thing to ResetKeypressState() occasionally if you think your form may have
|
||
lost focus.
|
||
</div><p> </p>
|
||
<strong>Namespace:</strong>
|
||
<a href="6b7227c0-7a6a-6342-3b08-917c7de429cc.htm">SpriteLibrary</a><br />
|
||
<strong>Assembly:</strong>
|
||
SpriteLibrary (in SpriteLibrary.dll) Version: 1.0.0.5 (1.0.0.5)<div class="collapsibleAreaRegion"><span class="collapsibleRegionTitle" onclick="SectionExpandCollapse('ID1RB')" onkeypress="SectionExpandCollapse_CheckKey('ID1RB', event)" tabindex="0"><img id="ID1RBToggle" class="collapseToggle" src="../icons/SectionExpanded.png" />Syntax</span></div><div id="ID1RBSection" class="collapsibleSection"><div class="codeSnippetContainer"><div class="codeSnippetContainerTabs"><div id="ID0EACA_tab1" class="codeSnippetContainerTabSingle">C#</div></div><div class="codeSnippetContainerCodeContainer"><div class="codeSnippetToolBar"><div class="codeSnippetToolBarText"><a id="ID0EACA_copyCode" href="#" class="copyCodeSnippet" onclick="javascript:CopyToClipboard('ID0EACA');return false;" title="Copy">Copy</a></div></div><div id="ID0EACA_code_Div1" class="codeSnippetContainerCode" style="display: block"><pre xml:space="preserve"><span class="keyword">public</span> <span class="identifier">bool</span> <span class="identifier">IsKeyPressed</span>(
|
||
<span class="identifier">Keys</span> <span class="parameter">k</span>
|
||
)</pre></div></div></div><script type="text/javascript">AddLanguageTabSet("ID0EACA");</script><h4 class="subHeading">Parameters</h4><dl><dt><span class="parameter">k</span></dt><dd>Type: <a href="http://msdn2.microsoft.com/en-us/library/xy8ebtbf" target="_blank">System.Windows.Forms<span id="LST3899C3E3_1"></span><script type="text/javascript">AddLanguageSpecificTextSet("LST3899C3E3_1?cs=.|vb=.|cpp=::|nu=.|fs=.");</script>Keys</a><br />The key to check to see if it is pressed</dd></dl><h4 class="subHeading">Return Value</h4>Type: <a href="http://msdn2.microsoft.com/en-us/library/a28wyd50" target="_blank">Boolean</a><br />True if the key is pressed, false if that key is not pressed</div><div class="collapsibleAreaRegion" id="seeAlsoSection"><span class="collapsibleRegionTitle" onclick="SectionExpandCollapse('ID2RB')" onkeypress="SectionExpandCollapse_CheckKey('ID2RB', event)" tabindex="0"><img id="ID2RBToggle" class="collapseToggle" src="../icons/SectionExpanded.png" />See Also</span></div><div id="ID2RBSection" class="collapsibleSection"><h4 class="subHeading">Reference</h4><div class="seeAlsoStyle"><a href="07a473e4-4716-e5b9-c7d2-c4748265fc58.htm">SpriteController Class</a></div><div class="seeAlsoStyle"><a href="50eae5e0-c59c-9d9c-d551-21dba8696ac9.htm">IsKeyPressed Overload</a></div><div class="seeAlsoStyle"><a href="6b7227c0-7a6a-6342-3b08-917c7de429cc.htm">SpriteLibrary Namespace</a></div></div></div></div><div id="pageFooter" class="pageFooter"> </div></body></html> |