int XSetModifierMapping(display, modmap)
Display *display;
XModifierKeymap *modmap;
display | Specifies the connection to the X server. |
modmap | Specifies the XModifierKeymap structure. |
The modifiermap member of the XModifierKeymap structure contains eight sets of max_keypermod KeyCodes, one for each modifier in the order Shift, Lock, Control, Mod1, Mod2, Mod3, Mod4, and Mod5. Only nonzero KeyCodes have meaning in each set, and zero KeyCodes are ignored. In addition, all of the nonzero KeyCodes must be in the range specified by min_keycode and max_keycode in the Display structure, or a BadValue error results.
An X server can impose restrictions on how modifiers can be changed, for example, if certain keys do not generate up transitions in hardware, if auto-repeat cannot be disabled on certain keys, or if multiple modifier keys are not supported. If some such restriction is violated, the status reply is MappingFailed, and none of the modifiers are changed. If the new KeyCodes specified for a modifier differ from those currently defined and any (current or new) keys for that modifier are in the logically down state, XSetModifierMapping() returns MappingBusy, and none of the modifiers is changed.
XSetModifierMapping() can generate BadAlloc and BadValue errors.
BadAlloc | The server failed to allocate the requested source or server memory. |