Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ XtCaseProc(3) — OSF1 1.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

XtConvertCase(1)

XtGetKeysymTable(1)

XtKeysymToKeycodeList(1)

XtRegisterCaseConverter(1)

XtSetKeyTranslator(1)

XtTranslateKeycode(1)

 

Name

XtCaseProc — prototype procedure called to convert the case of keysyms. 

Synopsis

typedef void (∗XtCaseProc) (Display∗, KeySym, KeySym ∗, KeySym ∗);

    Display ∗display
    KeySym  keysym;
    KeySym  ∗lower_return;
    KeySym  ∗upper_return;

Arguments

displayProvides the display connection for which the conversion is required. 

keysymSpecifies the keysym to convert. 

lower_return
Specifies the lower-case equivalent for the keysym.

upper_return
Specifies the upper-case equivalent for the keysym.

Description

To handle capitalization of nonstandard keysyms, the Intrinsics allow clients to register case conversion routines.  Case converter procedure pointers are of type XtCaseProc.  The case converter can be registered with XtRegisterCaseConverter. 

An XtCaseProc allows an application to specify its own upper-case and lower-case translations for keyboard keys. 

If there is no case distinction, the procedure should store the input keysym into both return values. 

Examples

Here is the default case converter from the R4 Intrinsics:

/∗ ARGSUSED ∗/
void _XtConvertCase(dpy, sym, lower, upper)
    Display ∗dpy;
    KeySym sym;
    KeySym ∗lower;
    KeySym ∗upper;
{
    ∗lower = sym;
    ∗upper = sym;
    switch(sym >> 8) {
        case 0:
            if ((sym >= XK_A) && (sym <= XK_Z))
                ∗lower += (XK_a - XK_A);
            else if ((sym >= XK_a) && (sym <= XK_z))
                ∗upper -= (XK_a - XK_A);
            else if ((sym >= XK_Agrave) && (sym <= XK_Odiaeresis))
                ∗lower += (XK_agrave - XK_Agrave);
            else if ((sym >= XK_agrave) && (sym <= XK_odiaeresis))
                ∗upper -= (XK_agrave - XK_Agrave);
            else if ((sym >= XK_Ooblique) && (sym <= XK_Thorn))
                ∗lower += (XK_oslash - XK_Ooblique);
            else if ((sym >= XK_oslash) && (sym <= XK_thorn))
                ∗upper -= (XK_oslash - XK_Ooblique);
            break;
        default:
            /∗ XXX do all other sets ∗/
            break;
    }
}

Changing the keyboard mapping is discussed in Chapter 13, Miscellaneous Toolkit Programming Techniques, in Volume Four, X Toolkit Intrinsics Programming Manual. 

See Also

XtConvertCase(1), XtGetKeysymTable(1), XtKeysymToKeycodeList(1), XtRegisterCaseConverter(1), XtSetKeyTranslator(1), XtTranslateKeycode(1). 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026