title: Is JOYBUTTON_5 incorrectly defined in mmsystem.h?
body: <p>I'm currently writing some C++ code to detect gamepad button presses. I'm using the following code to define an array of possible button presses:</p>
  
  <pre><code>#include &lt;windows.h&gt;
  #include &lt;mmsystem.h&gt;
  
  this-&gt;buttons[0] = JOY_BUTTON1;
  this-&gt;buttons[1] = JOY_BUTTON2;
  ...
  this-&gt;buttons[31] = JOY_BUTTON32;
  </code></pre>
  
  <p>And then using something like the following to detect which button was pressed:</p>
  
  <pre><code>joyGetPosEx(this-&gt;joyStickId, &amp;info);
  
  buttonPressed = false;
  
  for(int i=0; i&lt;32; i++){
    if((info.dwButtons &amp; this-&gt;buttons[i]) == this-&gt;buttons[i]){
      buttonPressed = true;
      cout &lt;&lt; "button number " &lt;&lt; (i+1) &lt;&lt; "was pressed!" &lt;&lt; endl;
    }
  }
  
  if(buttonPressed === false){
    cout &lt;&lt; "could not detect button press, dwButtons was set to: " &lt;&lt; info.dwButtons &lt;&lt; endl;
  }
  </code></pre>
  
  <p>This works fine for gamepad buttons 1-4. However, buttons 5-32 do not work. For instance, when pressing button 5 on the gamepad, the program thinks <code>dwButtons</code> is set to 16. The <code>JOY_BUTTON5</code> as defined in <code>mmsystem.h</code> is 257. So it seems to me that JOY_BUTTON5 - 32 are defined incorrectly in mmsystem. Is that right, or am I missing something?</p>