title: Create an On-screen Keyboard
body: <p>I use PostMessage to simulate keystrokes in a program that is in the background. It work fine except for characters that need shift on the physical keyboard. How do I simulate shift? "</p>
  
  <p>The code I use is roughly:</p>
  
  <pre><code> VK vk = VkKeyScanEx (c, GetKeyboardLayout (0));
  
   AttachThreadInput (_attachedThredId, _attachedProcessId, true);
   PostMessage       (_window, WM_KEYDOWN, vk.key, 0x1);
   PostMessage       (_window, WM_KEYUP,   vk.key, 0xC0010001);
   AttachThreadInput (_attachedThredId, _attachedProcessId, false);
  </code></pre>
  
  <p>How should I handle Extended part of VK?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>I'm trying to create an on-screen keyboard. Each button on the on-screen keyboard simulates a sequence of keystrokes. The receiver is an old program that performs different tasks depending on the keyboard sequence that is performed.
  Keyboard sequences is as follows</p>
  
  <ul>
  <li>{ESC}NN{ESC}NN</li>
  <li>{ESC}NN</li>
  <li>½NN</li>
  <li>§NN</li>
  </ul>
  
  <p>where {ESC} simulate pressing the Esc key, NN are hex values and §/½ get the program to listen.</p>
  
  <p>Normally we have special physical keyboard to control the program, but they are expensive. So in a test environment where we do not always have the physical keyboards, we have to enter these codes manually</p>