static Status EphyrKeyboardInit(KdKeyboardInfo * ki) { KeySymsRec keySyms; CARD8 modmap[MAP_LENGTH]; XkbControlsRec controls; ki->driverPrivate = (EphyrKbdPrivate *) calloc(sizeof(EphyrKbdPrivate), 1); if (hostx_load_keymap(&keySyms, modmap, &controls)) { XkbApplyMappingChange(ki->dixdev, &keySyms, keySyms.minKeyCode, keySyms.maxKeyCode - keySyms.minKeyCode + 1, modmap, serverClient); XkbDDXChangeControls(ki->dixdev, &controls, &controls); free(keySyms.map); } ki->minScanCode = keySyms.minKeyCode; ki->maxScanCode = keySyms.maxKeyCode; if (ki->name != NULL) { free(ki->name); } ki->name = strdup("Xephyr virtual keyboard"); ephyrKbd = ki; return Success; }
static Status EphyrKeyboardInit(KdKeyboardInfo * ki) { ki->driverPrivate = (EphyrKbdPrivate *) calloc(sizeof(EphyrKbdPrivate), 1); hostx_load_keymap(); if (!ephyrKeySyms.minKeyCode) { ErrorF("Couldn't load keymap from host\n"); return BadAlloc; } ki->minScanCode = ephyrKeySyms.minKeyCode; ki->maxScanCode = ephyrKeySyms.maxKeyCode; free(ki->name); ki->name = strdup("Xephyr virtual keyboard"); ephyrKbd = ki; return Success; }