title: Is scan code the same on all keyboards
body: <p>I got problem when one of my customer complains about they use azerty keyboard and they can't use my product. So I decide to use scan code instead of virtual key. I found the function <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms646306(v=vs.85).aspx" rel="nofollow noreferrer">MapVirtualKey</a> is really useful for me to achieve that. But in some situation, I don't want to use MapVirtualKey function but use the number itself, like {if(isKeyDown[30])return 'A';} but I go around the internet and realize that some source tell that their keyboard scan code is not like mine, like in this image 
  <a href="https://i.stack.imgur.com/dg3up.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dg3up.gif" alt="Not like my keyboard"></a>
  I don't understand it, why it's different from my keyboard's scan code, and even different from this <a href="https://msdn.microsoft.com/en-us/library/aa299374(v=vs.60).aspx" rel="nofollow noreferrer">MS scan code table</a> </p>
  
  <p>So I really wonder, Is it safe to use</p>
  
  <pre><code>if (isDownNow[48])
      return 'B';
  </code></pre>
  
  <p>instead of</p>
  
  <pre><code>if (isDownNow[MapVirtualKey('B', MAPVK_VK_TO_VSC)])
      return 'B';
  </code></pre>
  
  <p>Thank you for reading :)</p>
  
  <p><strong>Edit:</strong>
  I think I have a solution for the problem above, instead of call MapVirtualKey every time, I will store the map in an array. But new problem comes up.
  I don't have a azerty keyboard so I can't test this, I only have a qwerty keyboard, so I got confuse on this problem: 
  I got this function to store my map.</p>
  
  <pre><code>void MapKeyData()
  {
   for (int i = 0; i &lt; KEYS_SIZE; i++)//KEYS_SIZE=255
     mapKey[i] = MapVirtualKey(i, MAPVK_VK_TO_VSC);//mapKey is unsigned char array
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/Ao0pO.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ao0pO.jpg" alt="qwerty vs azerty"></a>
  But I want the Z in normal keyboard (qwerty keyboard) map with the W in azerty keyboard. But as the function MapKeyData above, I think the Z in qwerty keyboard still map with the Z in azerty keyboard which is definitely not my purpose, I want to keep the keyboard layout, not the key itself. But as I said, I don't know if the scan code is the same on every keyboard as the first picture show that the keycode different from my scan code.</p>
  
  <p>Thank for reading :)</p>