X11 捕获键盘鼠标事件发送流程
XtVaAppInitialize -> 注册fallback_resources -> 根据注册名绑定函数地址 XtActionsRec actions[] char *fallback_resources[] = { "Vncviewer.title: TightVNC: %s", "Vncviewer.translations:\ <Enter>: SelectionToVNC()\\n\ <Leave>: SelectionFromVNC()", "*form.background: black", "*viewport.allowHoriz: True", "*viewport.allowVert: True", "*viewport.useBottom: True", "*viewport.useRight: True", "*viewport*Scrollbar*thumb: None", "*desktop.baseTranslations:\ <Key>F8: ShowPopup()\\n\ <ButtonPress>: SendRFBEvent()\\n\ <ButtonRelease>: SendRFBEvent()\\n\ <Motion>: SendRFBEvent()\\n\ <KeyPress>: SendRFBEvent()\\n\ <KeyRelease>: SendRFBEvent()", "*serverDialog.dialog.label: VNC server:", "*serverDialog.dialog.value:", "*serverDialog.dialog.value.translations: #override\\n\ <Key>Return: ServerDialogDone()", "*passwordDialog.dialog.label: Password:", "*passwordDialog.dialog.value:", "*passwordDialog.dialog.value.AsciiSink.echo: False", "*passwordDialog.dialog.value.translations: #override\\n\ <Key>Return: PasswordDialogDone()", NULL, } static XtActionsRec actions[] = { {"SendRFBEvent", SendRFBEvent}, {"ShowPopup", ShowPopup}, {"HidePopup", HidePopup}, {"ToggleFullScreen", ToggleFullScreen}, {"SetFullScreenState", SetFullScreenState}, {"SelectionFromVNC", SelectionFromVNC}, {"SelectionToVNC", SelectionToVNC}, {"ServerDialogDone", ServerDialogDone}, {"PasswordDialogDone", PasswordDialogDone}, {"Pause", Pause}, {"RunCommand", RunCommand}, {"Quit", Quit}, }; SendRFBEvent() //发送鼠标键盘粘贴事件 bool HandleRFBServerMessage() switch(msg.type) { case rfbSetColourMapEntries: case rbfFramebufferUpdate: case rfbEncodingCopyRect: case rfbEncodingRRE: case rfbEncodingCoRRE: case rfbEncodingHextitle: case rfbEncodingZlib: case rfbEncodingTight: case rfbBell: case rfbServerCutText: }