patacongo commented on pull request #1851: URL: https://github.com/apache/incubator-nuttx/pull/1851#issuecomment-695799871
The following is nonsensical: > Note that that thread could like in your featherwing driver logic. There is a function in nxterm_driver.c called nxterm_ioctl_tap() that permits the nxterm ioctl commands to be called from within the OS. You might even be able to come up with a solution that does not require a dedicated "listener" thread. Perhaps keyboard input could be handled on the work queue and nxterm_ioctl_tap() could be called directly. This makes sense because the featherwing is really an integrated solution, is it not? That is a really dumb idea, of course. Keyboard and mouse inputs are received by the application through window callbacks, just like with the X server. The listener needs to inject the keyboard input via nx_kbdin (libs/libnx/nx_kbdin.c) which sends a message to the NX server. The NX server will forward the keyboard input to the window that has focus. The Window application listens for NX server events by calling nx_eventhandler() (libs/libnx/nx_eventhandler) which, if the window has focus when the keypress is entered, forwards the keypress info to the registered window even handler. In apps/examples/nxterm, nxterm_listener.c is the thread that drivers nx_eventhandler(). The "normal" window NX keyboard callback is the function nxwndo_kbdin() in nxterm_wndo.c. It just writes the keyboard data to stdout. Stdin in and stdout were re-directed to the NxTerm in nxterm_main.c The BOARDIOC_NXTERM_IOCTL is only called for the case of a redraw event. This happens when a window "above" the current window is moved and the text is exposed. If you use only the background window, then it will always have focus and the BOARDIOC_NXTERM_IOCTL will never be used. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org