title: Sending KeyPress events in X11
body: <p>I have a program where for various reasons i need to send keypress events to various windows. What I am using at the moment</p>
  
  <pre><code>XEvent event;
  /* set some other stuff*/
  event.type = KeyPress;
  event.xkey.keycode     = XKeysymToKeycode(display,XStringToKeysym(curr_key));
  </code></pre>
  
  <p>works for lower case letters and numbers, but I need to modify this so that it is capable of sending the enter key and upper case letters.</p>