The most important physical input device for a Microsoft Windows-based user interface is the mouse. User mouse operatings are pointing, clicking, and dragging. A mouse operation is proposed when the mouse button is pressed down, and confirmed when the mouse button is released. For example, if the pointer is over a menu item, the item is highlighted when the mouse button is pressed down and initiated when the mouse button is released. Similarly, during drag operations the user gets visual feedback while the button is down, but the operations are not accepted until the mouse button is released. For example, some actions are initiated as soon as the user presses the mouse button over a push button control.
The other important physical input device for a Windows-based user interface is the keyboard. Keyboard input involves pressing types of keys: text keys, editing keys, mode keys, navigation keys, and shortcut (function) keys. Text keys can be defined as the alphanumeric (a-z, 0-9), punctuation, symbol, TAB, and ENTER keys, and the SPACEBAR. Editing keys are DEL, BACKSPACE, and INS. Mode keys change the actions of the other keys. The two kinds of mode keys are toggle keys (INS, CAPS LOCK, NUM LOCK, SCROLL LOCK, F8, and SHIFT + F8) and modifier keys (SHIFT, CTRL, and ALT). Navigation keys are HOME, END, PAGE UP, PAGE DOWN, the four arrow keys, and TAB. Shortcut keys or key combinations can be used to provide more rapid access to frequently performed operations. Function keys and CTRL + letter or ALT + function combinations are often used as shortcuts. Note that ALT + letter combinations are not recommended as shortcut keys because they provide standard keyboard access to menus and controls.
The navigation in a Windows-based user interface with a mouse is simple: When the mouse is moved left or right on the user's desktop, the mouse pointer moves left or right on the screen. By moving the mouse, the user can move the pointer to any location on the screen. Keyboard navigation is more complicated than the mouse navigation. Keyboard navigation to controls relies pimarily on mnemonic access characters. With mnemonic access, when the user presses ALT plus the mnemonic letter in a control label, the focus moves to the control, and the control is selected or operated.
There are many ways for writing Microsoft Windows- based applications for the BB2TD Flat Panel PC. Very important is the 8 by 8 touch panel matrix of the BB2TD. This touch panel matrix offers a keyboard emulation. In most industrial applications the BB2TD do not offers a mouse. There is only one physical input device for a Microsoft Windows- based user interface: the touch panel matrix with keyboard emulation. Please see also: BB2TD software based mouse emulator.
As the user presses and releases BB2TD touch panel keys, the BB2TD touch panel scanner passes the keystrokes to Windows. Windows saves the keystrokes in the system message queue and then transfers them to the message queue of the program with the input focus. The next table shows the Windows most important keystroke messages.
| Message | Event |
|---|---|
| WM_KEYDOWN | Uses presses a key |
| WM_KEYUP | User releases a key |
| WM_CHAR | Value of the key being pressed or released |
| WM_DEADCHAR | Value of dead keys such as umlaut |
| WM_SYSKEYDOWN | Uses presses a system key such as ALT or F10 |
| WM_SYSKEYUP | User releases a system key such as ALT, F10 |
| WM_SYSCHAR | Value of virtual key code of a system menue key |
| WM_SYSDEADCHAR | Value of dead key |
Together with all keystroke messages, Windows passes a 32- bit parameter lParam to the window procedure of the program with the input focus. This parameter contains six fields. One field is the OEM Scan Code. The OEM Scan Code is the default scan code of the BB2TD touch panel scanner. If youŽd like to see how Windows sends keyboard messages to a program, the sample OEMSC.C will help. This program displays in its client area all the information that Windows sends the window procedure for the eight different keyboard messages.
The most important control for a BB2TD Windows- based user interface is the push button. A push button is a button that the user can select to carry out a specific action. With the Windows API function CreateWindow, a application can create push buttons with program defined size on any position within the main window. Size and position are parameters of the Windows API CreateWindow function.
CreateWindow ("BUTTON", //Control Class
"ButtonLabel", //Button Label
"WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, //Control Styles
395, //x-coordinate
275, //y-coordinate
160, //Button width in pixel
60, //Button height in pixel
hWnd, //Parent Window
BUTTON1, //Control Identifier
ghInstance, //Instance Handle
NULL);
Windows push buttons are predefined child windows for mouse operation. For using
this push buttons over the BB2TD touch panel keys, a application program needs the
Windows keystroke messages WM_KEYDOWN and WM_KEYUP together with the OEM Scan Code.
If a BB2TD user presses and releases BB2TD touch panel keys over a push button,
Windows passes the 32- bit parameter lParam with the OEM Scan Code for the
touch panel key together with the WM_KEYDOWN and WM_KEYUP messages to the application
program. The program BB2TDE01.C shows an example. This program
creates two push buttons within the client area. Each push button is using two BB2TD
touch panel keys. If the user presses the BB2TD touch panel keys over the examples
push buttons, the example prints out some text messages in the left half of the
BB2TD COLOR VGA TFT LCD.
The BB2TDE01 example program shows how to use push buttons for a BB2TD Windows- based user interface. This example creates a 640 * 480 dots application window with a title bar, system menue box, a maximize box, a minimize box, a sizing border, and a client area with two push buttons. In a real BB2TD application, the application window donŽt offer the title bar, the system menue box, the maximize box, the minimize box, and the sizing border. The size of the application window and the client area is 640 * 480 dots - the full screen size of the BB2TD COLOR VGA TFT LCD. The demo program BB2TDF01.C shows an example with two push buttons and a virtual instrument (VI).