this mustn't set the time (of key events) !! b/c we have the kernel set it. mmc_xf86PostKbdEvent translates the usb codes ? or simply avoids the other translations ?
reading the events. & translating codes.
find_keyboard_event_file
and
CARD32 last_keyboard_read_time = 0; in /p/xfree-4.3.99.901-r4/work/xc/programs/Xserver/dix/events.c should be fixed!
todo:
GetTimeInMillis ... (in dix) ... dispatch.c UpdateCurrentTime(If)
My idea is that after each GetTimeInMillis we have to look at all input devices.
UpdateCurrentTime -> ProcessInputEvents -> xf86eqProcessInputEvents(); ??
(defvar emacs-wiki-mode-ffap-outline-path
;; Need smarter defaults here! Suggestions welcome. '("/x/cvs/xfree/patched/"))
(defun ffap-emacs-wiki-mode (name) (ffap-locate-file name t ffap-outline-path)) (aput 'ffap-alist 'emacs-wiki-mode 'ffap-emacs-wiki-mode)
programs/Xserver/hw/xfree86/doc/DESIGN
from Main programs/Xserver/dix/main.c
-> InitInput followed by InitAndStartDevices()
-> programs/Xserver/hw/xfree86/common/xf86Init.c
dunno why InitOutput is used to collect even input modules
char * identifier; char * driver; pointer commonOptions; pointer extraOptions; } IDevRec, IDevPtr;
so, IDevPtr must be produced before. in fact! programs/Xserver/hw/xfree86/common/xf86Helper.c
xf86InputDriverList
flags: XI86_KEYBOARD_CAPABLE XI86_CORE_KEYBOARD
pInfo->flags & XI86_CORE_KEYBOARD only one!!
xf86Info.inputPending = NULL;
pInfo = pDrv->PreInit(pDrv, pDev, 0);
after xf86InputDevs
/ Call the PreInit function for each input device instance. / "keyboard" special handling!
KbdDevPtr pKbd = pInfo->private;
pKbd->KbdInit = KbdInit; pKbd->KbdOn = KbdOn; pKbd->KbdOff = KbdOff; pKbd->Bell = SoundBell; pKbd->SetLeds = SetKbdLeds; pKbd->GetLeds = GetKbdLeds; pKbd->SetKbdRepeat = SetKbdRepeat; pKbd->KbdGetMapping = KbdGetMapping; pKbd->SpecialKey = SpecialKey;
pKbd->RemapScanCode = NULL; pKbd->GetSpecialKey = GetSpecialKey;
pKbd->OpenKeyboard = OpenKeyboard; pKbd->vtSwitchSupported = FALSE;
pKbd->private = xcalloc(sizeof(LnxKbdPrivRec), 1);
first take:
programs/Xserver/xkb/xkb.c /p/xfree-4.3.99.901-r4/work/xc/programs/Xserver/xkb/xkb.c
move the std_kbd into kbd.c or standalone evdev.c ??
-> AllSockets
i tried AddMonitoredDevice i had to add it into hw/xfree86/loader/dixsym.c as SYMFUNC(AddMonitoredDevice)
but evdev doesn't raise...
<- XFD_COPYSET(&AllSockets, &LastSelectMask);
Because * hw/xfree86/common/xf86Init.c runs
RegisterBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA, xf86Wakeup, NULL);
( RegisterBlockAndWakeupHandlers in dix/dixutils.c)
we run:
-> xf86Wakeup in
-> runs xf86InputDevs ..... ???
IFF pinfo->fd !!! pInfo->read_input(pInfo); ....
and also runs
-> InputHandlers iff ih->fd ...
xf86AllocateInput
xf86AddInputHandler(int fd, InputHandlerProc proc, pointer data)
it only communicates via ->deviceProc (DeviceProc)
xf86AddInputDriver
leds beeps kbdon/of GetSpecialKey
hw/xfree86/os-support/xf86OSKbd.h
hw/xfree86/os-support/shared/at_scancode.c
ATScancode: /* mmc: this is a sort of my plugin: it is fed scancodes and sometimes returns
* another one. i.e. it keeps a state (queue). For evdev kernel does it. /
called via pKbd->RemapScanCode from PostKbdEvent
alternatively (that means when we use CustomKeycodes for example) pKbd->scancodeMap is a table: it's used only in BSD
** step: special action keys:
->GetSpecialKey again: function or a table.
specialkey and then call xf86CommonSpecialKey(specialkey, ...)
and also (local) ->SpecialKey
global:
linux: ->vtSwitchSupported ?? only on console! if the keyboard is a separate device ...??
!xf86Info.vtSysreq ??? f1 & if enabled! alt & sysreq, f1
fixme: i hope keyc->state is not maintainde by xkb??? upper end!
in the end xf86PostKeyboardEvent
i should test, if "keyboard" (the legacy built-in driver) needs it.
| specialkeys handling : only if: if (noXkbExtension | specialkey == KEY_BackSpace) i added 1! |
|---|
-> xf86AddInputDriver(&KEYBOARD, module, 0);
preinit
linux: pKbd->KbdInit
pKbd->KbdGetMapping
it seems it uses xf86InputDevs
while kbd.c uses InputHandlers. i don't know why?
A: evdev handles mouse. and xf86InputDevs are called w/ SIGIO masked!
evdev calls: InitKeyClassDeviceStruct
kbd -> XkbInitKeyboardDeviceStruct
-> InitKeyboardDeviceStruct -> InitKeyClassDeviceStruct & InitFocusClassDeviceStruct & InitKbdFeedbackClassDeviceStruct
(device, pKeySyms, pModifiers, bellProc, controlProc)
ProcGrabKeyboard -> GrabDevice
calls dev->ActivateGrab with time = ClientTimeToServerTime(ctime); which is ActivateKeyboardGrab
this -> CheckGrabForSyncs -> ComputeFreezes
-> FreezeThaw
->
ProcGrabKeyboard lower_bound_time: returning 0 GrabDevice: grab time: 3530871973 ProcGrabKeyboard failing: b/c GrabInvalidTime ProcUngrabKeyboard ProcUngrabKeyboard: grab time: 3530872200