2 * virtkeyslib.h - Definitions for the virtkeys library.
3 * Copyright (c) 2000, Merle F. McClelland for CompanionLink
5 * See the files COPYRIGHT and LICENSE for distribution information.
7 * Note that these routines are somewhat oriented to a virtual keyboard
8 * design, but are also intended to support handwriting input windows
9 * that have very similar needs.
14 #include <sys/param.h>
23 enum keyType { regularKey, shiftKey, capsKey, controlKey, metaKey, altKey, specialCharKey, numKeyTypes };
25 enum modifierMode { unshiftedMode, shiftedMode, unshiftedSpecialCharMode, shiftedSpecialCharMode, numModes };
27 enum keyDirection { keyDown, keyUp, keyDownUp };
32 enum keyDirection direction; // Indicates key down, key up, or down/up
35 #define MAXKEYCODES 10
36 #define MAXLABELLEN 10
38 struct keyDescriptionEntry
45 // The following array is not used for the modifier keys Shift, Caps, and SpecialChar, as pressing
46 // these keys do not actually send key codes.
48 struct keycodeEntry outputSequence[numModes][MAXKEYCODES]; // Terminated with 0
49 void *objectData; // Can be used to hold a pointer to data associated with the key
50 char *label[numModes];
52 int regularCAPS; // Indicates that the key, in regular mode, responds to the CAPS lock modifier
53 int specialCAPS; // Indicates that the key, in special mode, responds to the CAPS lock modifier
56 #define MAXLINECHARS 300
62 int setupKeyboardVariables(Display *dpy);
64 int lookupKeyCodeSequence(KeySym ks, struct keycodeEntry *keycodeEntryTable, char **labelBuffer);
66 int loadKeySymTable();
68 // Routines to manage and use the XTest extension
74 // And these routines actually send sequences of keycodes and up/down indicators via the XTest extension
76 void sendKeySequence(struct keycodeEntry *entries, int controlMode, int metaMode, int altMode, int shiftMode);
79 void sendKey(KeyCode character, enum keyDirection keydirection);