<?xml version="1.0" encoding='utf-8'?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1" title="Bit field - Page 12 - Wikipedia">
<p>
<a accesskey="1" href="page.php?w=Bit_field&amp;p=11">1.Previous</a><br />
<a accesskey="3" href="page.php?w=Bit_field&amp;p=13">3.Next</a>
</p>
<p>   KEY_A = 0b10000000};</p>

<p>// global stateuint8_t gameControllerStatus = 0;</p>

<p>// Sets the gameControllerStatus using ORvoid onKeyPressed(uint8_t key) {     gameControllerStatus |= key;}</p>

<p>// Clears the gameControllerStatus using AND and ~ (binary NOT)void onKeyReleased(uint8_t key) {     gameControllerStatus &= ~key;}</p>

<p>// Tests whether a bit is set using ANDuint8_t isPressed(uint8_t key) {     return gameControllerStatus & key; }</p>

<p><big>Rust</big></p>
<p>While <a href="page.php?w=Rust_%28programming_language%29">Rust</a> lacks</p><p>
<a accesskey="1" href="page.php?w=Bit_field&amp;p=11">1.Previous</a><br />
<a accesskey="3" href="page.php?w=Bit_field&amp;p=13">3.Next</a>
</p>

<do type="prev" label="Search">
        <go href="search.wml"/>
</do>

</card>
</wml>
