DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
This is the second time that I have forgotten how NxTerm keyboard input is handled and was inspired to write a Wiki page. The first was when I analyzed CNxConsole Keyboard Input. This time, I am focused on the NxTerm example at apps/examples/nxterm.
Initialization
NX Server
The NxTerm example initializes the NX Server through the following steps:
...
- Calls
nxtk_openwindow()to create a bordered window, - Calls
nxtk_setposition()andnxtk_setsize()to position the window in the display, - Calls
nxtk_opentoolbar()to create a toolbar sub-window on the main window (This toolbar window is not used by the example, it is just for illustration).
A more practical use case for, say, a handheld device with a single NxTerm display would be to use the background window. The background is a window like any other with these special properties: It cannot be moved; it is always positioned at (0,0). It cannot be resized; it is always the full size of the display. And it cannot be raised, it is always the lowest windows in the z-axis.
NxTerm Driver
And binds the Nxterm driver to the permit drawing in the window. This is done when it:
...
- Character input driver receives input,
- Some keyboard listener thread receives input and injects it into NX via a call to
nx_kbdin(), - NX sends an event to the registered
kbdin()method of the window that has focus, providing the keyboard input to the window application. In this case, the window application of interest is the window bound to the NxTerm character driver by the application. Thekbin()callback provides the focused keyboard input to the NxTerm driver viaboardctl(BOARDIOC_NXTERM_IOCTL, (uintptr_t)&iocargs), - If the NxTerm window is the window with focus, the The NxTerm character driver receives keyboard data, buffers it, and provides that keyboard input for the next read operation,
- NSH receives input on
stdinwhich was re-directed to the NxTerm character driver. NSH processes the input, and - NSH outputs data to
stdoutwhich was re-directed to the NxTerm character driver.
...
