<div>Hi,</div>
<div> </div>
<div>I am trying to run a small code to turn ON the CAPS LOCK on my keyboard. I have written a small code for this in xsetcapslock.c file.</div>
<div> </div>
<div>/************************************************************* Code Starts Here ****************************************/</div>
<div><font size="2">
<p>#include <X11/extensions/XTest.h></p>
<p>#include <X11/keysym.h></p>
<p>#include <unistd.h></p>
<p>int main(void)</p>
<p>{</p>
<p>Display* disp = XOpenDisplay(NULL);</p>
<p>if (disp == NULL) return 1;</p>
<p>XTestFakeKeyEvent(disp, XKeysymToKeycode(disp, XK_Caps_Lock), True, CurrentTime);</p>
<p>XTestFakeKeyEvent(disp, XKeysymToKeycode(disp, XK_Caps_Lock), False, CurrentTime);</p>
<p>XCloseDisplay(disp);</p>
<p>return 0;</p>
<p>}</p>
<div>/************************************************************* Code Ends Here ****************************************/</div></font><br clear="all">I am compiling the code as :</div>
<div><font size="2">
<p>gcc -I/usr/X11R6/include -L/usr/X11R6/lib -o xsetcapslock xsetcapslock.c -lX11 -lXtst</p></font></div>
<div></div>
<div>The normal behaviour of the binary as seen in the code, is to turn ON the Caps Lock feature and the CAPS LOCK LED on the keyboard by sending a fake key event of Caps Lock. This binary xsetcapslock works fine with Xorg-1.2.0 or Xorg 1.6.0, but with Xorg-1.5.1 the feature of CAPS LOCK is turned ON in my keyboard, but the LED for Caps Lock is not glowing.</div>

<div> </div>
<div>The problem is same for all the other LEDs, i.e., NUM LOCK and SCROLL LOCK. Is this a bug in Xorg-1.5.1 ? Please help.</div>
<div> </div>
<div>Thanks,</div>
<div><br>Siddharth Kapoor <br></div>