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:
...
Redraw callbacks will not be received even in a multi-window configuration if you use per-window frame buffers, either. In that case, the system will automatically redraw windows as needed using the per-window frame buffer shadow memory. This is controlled by the option CONFIG_NX_RAMBACKED. This option is recommended for performance reasons if you have sufficient memory to support it.
...
Character Data Flow: Keyboard to Display
...
Character Data Flow in apps/examples/nxterm
- Character input driver receives input
- NSH receives input on stdin and processes it (stdin is not redirected)
- Data is output to stdout (redirected to the NxTerm driver)
In this simple, single-window case, BOARDIOC_NXTERM_IOCTL will never be used.
...
Character Data Flow in the Generic Window Case
See, for an example, apps/graphics/nxwm/src/cnxterm.cxx. In this case, the behavior will change, depending on the selection of CONFIG_NXTERM_NXKBDIN: If CONFIG_NXTERM_NXKBDIN is not selected, then the behavior will be similar to apps/examples/nxterm; stdin will not be redirected an keyboard input will come directly from the the system console.
...
- 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), - The If the NxTerm is the window with focus, 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.
...
