TI中文支持网
TI专业的中文技术问题搜集分享网站

TM4C1294NCPDT: USB LIB modifier 键

Part Number:TM4C1294NCPDT

您好,请问TIVA WARE提供的USB库的USBHIDKEYBOARD HID键盘如何能实现发送单独的modifer键呢

Cherry Zhou:

您好,我们已经收到问题并升级到英文论坛,温馨提示您由于圣诞及新年假期,英文论坛回复将稍慢,给您带来的不便敬请谅解!

,

Cherry Zhou:

qian zha 说:,请问TIVA WARE提供的USB库的USBHIDKEYBOARD HID键盘如何能实现发送单独的modifer键呢

您好,请参考以下USB库:

2.18.4.3 USBDHIDKeyboardKeyStateChangeReports a key state change to the USB host.Prototype:uint32_tUSBDHIDKeyboardKeyStateChange(void *pvKeyboardDevice,uint8_t ui8Modifiers,uint8_t ui8UsageCode,bool bPress)Parameters:pvKeyboardDevice is the pointer to the device instance structure as returned by USBDHIDKeyboardInit().

ui8Modifiers contains the states of each of the keyboard modifiers (left/right shift,ctrl, alt or GUI keys). Valid values are logical OR combinations of the labelsHID_KEYB_LEFT_CTRL, HID_KEYB_LEFT_SHIFT, HID_KEYB_LEFT_ALT,HID_KEYB_LEFT_GUI, HID_KEYB_RIGHT_CTRL, HID_KEYB_RIGHT_SHIFT,

HID_KEYB_RIGHT_ALT and HID_KEYB_RIGHT_GUI. Presence of one of thesebit flags indicates that the relevant modifier key is pressed and absence indicates that it isreleased.ui8UsageCode is the usage code of the key whose state has changed. If only modifier keyshave changed, HID_KEYB_USAGE_RESERVED should be passed in this parameter.bPress is true if the key has been pressed or false if it has been released. If only modifierkeys have changed state, this parameter is ignored.Description:This function adds or removes a key usage code from the list of keys currently pressed andschedules a report transmission to the host to inform it of the new keyboard state. If themaximum number of simultaneous key presses are already recorded, the report to the hostcontains the rollover error code, HID_KEYB_USAGE_ROLLOVER instead of key usage codesand the caller receives return code KEYB_ERR_TOO_MANY_KEYS.Returns:Returns KEYB_SUCCESS if the key usage code was added to or removed from thecurrent list successfully. KEYB_ERR_TOO_MANY_KEYS is returned if an attempt ismade to press a 7th key (the BIOS keyboard protocol can report no more than 6 simultaneouslypressed keys). If called before the USB host has configured the device,KEYB_ERR_NOT_CONFIGURED is returned and, if an error is reported while attempting totransmit the report, KEYB_ERR_TX_ERROR is returned. If an attempt is made to remove akey from the pressed list (by setting parameter bPressed to false) but the key usage code isnot found, KEYB_ERR_NOT_FOUND is returned.

赞(0)
未经允许不得转载:TI中文支持网 » TM4C1294NCPDT: USB LIB modifier 键
分享到: 更多 (0)