Bug 13788 - XFree86 3.3.6: CAPS LOCK not modifying key events as it should
Summary: XFree86 3.3.6: CAPS LOCK not modifying key events as it should
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: XFree86 (Show other bugs)
(Show other bugs)
Version: 6.2
Hardware: i386 Linux
Target Milestone: ---
Assignee: Preston Brown
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2000-07-12 13:52 UTC by Thor Nolen
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-07-12 13:52:42 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Thor Nolen 2000-07-12 13:52:41 UTC
This is a bug in XFree86 3.3.6.  The following code shows that
XtTranslateKeycode is not taking account of the CapsLock key.
main(int argc, char *argv[])
    char *fallback[] = { (char *)NULL };
    Widget toplevel;
    Display *Display;
    XtAppContext app_con;
    XrmOptionDescRec Options[] = {};
    KeySym sym0, sym1, sym2, sym3;
    Modifiers mod0, mod1, mod2, mod3;
    KeyCode KeyA;
    int i, NumCodes;
    KeyCode *KeyCode;

    toplevel = XtAppInitialize(&app_con, "Test", Options,
       &argc, argv, fallback, NULL, 0);

    if(toplevel == NULL)
       fprintf(stderr, "Failed to initialize\n");
    Display = XtDisplay(toplevel);
    if(Display == NULL)
       fprintf(stderr, "Failed to set display\n");
    XtKeysymToKeycodeList(Display, (KeySym)0x41, &KeyCode, &NumCodes);
    for(i=0; i<NumCodes; i++)
       printf("Keycode for 'A' is 0x%x\n", KeyCode[i]);
    KeyA = KeyCode[0];
    XtTranslateKeycode(Display, KeyA, (Modifiers)0, &mod0, &sym0);
    XtTranslateKeycode(Display, KeyA, ShiftMask, &mod1, &sym1);
    XtTranslateKeycode(Display, KeyA, LockMask, &mod2, &sym2);
    XtTranslateKeycode(Display, KeyA, ShiftMask | LockMask, &mod3, &sym3);

    printf("Keysyms for 'A' are:\n"          "\tShift:\t\t%x  modifiers
          "\tLock:\t\t%x  modifiers returned=%d\n"
          "\tShift+Lock:\t%x  modifiers returned=%d\n",
          sym0, mod0, sym1, mod1, sym2, mod2, sym3, mod3);

Output is:

Keycode for 'A' is 0x26
Keysyms for 'A' are:
       Unmodified:       61  modifiers returned=1
       Shift:              41  modifiers returned=1
       Lock:              61  modifiers returned=1
       Shift+Lock:       41  modifiers returned=1

Note that the Lock key has no effect on the KeySym.

          "\tUnmodified:\t%x  modifiers returned=%d\n"

Comment 1 Preston Brown 2000-07-25 20:24:47 UTC
CapsLock doesn't modify the keysym, it changes the modifier bits (i.e. 0x2 for

Note You need to log in before you can comment on or make changes to this bug.