SWRA715 December 2021 CC2642R , CC2652R
The project also implements HID keyboard operation. The keyboard functionality is implemented in a manner that is very similar to how the mouse functionality is implemented. The hid_input union is used to package the keyboard input. Specifically, the keyboard structure is packaged with the desired inputs. Several keypresses can be sent in a single transmission. The hiddev.h file contains all of the keyboard/keypad usage IDs. The aforementioned IDs are used to send a specific key press. The section of the report map that corresponds to the keyboard operation is shown in Figure 4-3.
The keyboard portion of the hid_input union be filled with several key presses, modifier keys, and a reserved field. Once the keyboard data has been packaged, the HidEmuKbd_sendKeyboardInput() function may be called to send a keyboard input transmission to the HID Host. In the demo portion of this project, keypresses are sent through the use of events that are queued up within the HidEmuKbd_keyPressHandler() function.