ppisa commented on code in PR #19579: URL: https://github.com/apache/nuttx/pull/19579#discussion_r3684476572
########## drivers/usbhost/usbhost_hidkbd.c: ########## @@ -238,8 +256,12 @@ struct usbhost_state_s struct work_s rwork; /* For interrupt transfer work */ int16_t nbytes; /* # of bytes actually transferred */ #endif -#ifndef CONFIG_HIDKBD_NODEBOUNCE - uint8_t lastkey[6]; /* For debouncing */ +#if !defined(CONFIG_HIDKBD_NODEBOUNCE) || defined(CONFIG_HIDKBD_KBDUPPER) + uint8_t lastkey[6]; /* Keys down in the previous report */ +#endif +#ifdef CONFIG_HIDKBD_KBDUPPER + struct keyboard_lowerhalf_s lower; /* Keyboard upper-half interface */ Review Comment: I am not sure what is the best option. Some system level KBD which aggregates inputs from all others can be useful. The mapping which lower level keyboards streams should aggregated into system level one should be somehow configurable which adds complexity. Linux input event is quite powerful, I have implemented remapping of numeric keyboard (with some Etneter, cursors and F-keys) as T-9 which output has been seen by application as the regular alphanumeric keyboard long time ago on Linux on our iMX1 based terminal. But it is necessary to consider complexity, because NuttX has man value on smaller system, where thinks has to be kept simple and memory efficient. Another problem is, if the keyboards should deliver keys pressures as ASCII codes or if all should be scancodes specifying location on physical keyboard only. The second approach allows national keyboards variants but requires system of keymaps which are somehow chosen according to locales and geometry reported by keyboard. So may it be using ASCII standardizes this at least a little and you see something understandable at the start and simple keyboards can live with this and list of special keys. More complex applications can use modifies and national ones needs to do full remapping... really, I am not sure what is the best approach for NuttX so I do not want to hold the effort. I think that fixed even format is better for now than that complex ESC based stream. But even this is not strong pinion. -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
