📄 uglusbkeybd.h
字号:
/* uglusbkeybd.h - USB keyboard device header file *//* Copyright 2003 Wind River Systems, Inc. All Rights Reserved *//*modification history--------------------01a,18jun03,jlb created*//* DESCRIPTION This file provides data definitions for the USB type keyboards. Thescan codes are assumed to be identical to the PS/2 keyboard codes.*/#ifndef __INCuglusbkbdh#define __INCuglusbkbdh #ifdef __cplusplusextern "C"{#endif#include <drv/usb/usbKeyboardLib.h>#include <usb/usbHid.h>/* defines *//* ----- Driver Configuration ----- */#ifndef INCLUDE_USB_KEYBOARD#define INCLUDE_USB_KEYBOARD#define BUILD_DRIVER#include <uglInit.h>#endif /* INCLUDE_USB_KEYBOARD */#define UGL_KEYBOARD_INIT uglUsbKbdInit/* Default the keyboard device name */#ifndef SYS_KEYBOARD_NAME#define SYS_KEYBOARD_NAME #endif /* SYS_KEYBOARD_NAME *//* Standard PC type keyboard */UGL_INPUT_DEVICE_ID uglUsbKbdInit (char * pDevName, UGL_EVENT_SERVICE_ID eventServiceId);/* typedefs */typedef struct ugl_usb_kbd_report { unsigned char modifier; /* Keyboard HID report modifier */ unsigned char keys[BOOT_RPT_KEYCOUNT]; /* Scan codes for keys */ unsigned char keyCount; /* Number of vaild keys in keys */ } UGL_USB_KBD_REPORT;typedef struct ugl_usb_kbd_device { UGL_UINT8 state; /* attachment state */ int pipeNum; SIO_CHAN *pSioChan; /* The underlying SIO channel */ UGL_UINT32 ledValue; /* current LED state */ UGL_USB_KBD_REPORT lastReport; /* keys in last report */ } UGL_USB_KBD_DEVICE;/* Mapping of scancodes to unicode */typedef struct usbkbdKeyMapStruct { UGL_UINT16 unshiftedKeyValue; UGL_UINT16 shiftedKeyValue; } USB_KBD_KEYMAP;/* defines */#define UGL_USB_KBD_PIPE_LEN (10)#define UGL_USB_KBD_ATTACHED (1)#define UGL_USB_KBD_UNATTACHED (2)/* ----- Special scan codes ----- */#define UGL_USBKBD_LEFT_CTRL 0x66#define UGL_USBKBD_RIGHT_CTRL 0x6a#define UGL_USBKBD_LEFT_SHIFT 0x67#define UGL_USBKBD_RIGHT_SHIFT 0x6b#define UGL_USBKBD_LEFT_ALT 0x68#define UGL_USBKBD_RIGHT_ALT 0x6c#define UGL_USBKBD_NUM_LOCK 0x53#define UGL_USBKBD_SCROLL_LOCK 0x47#define UGL_USBKBD_CAPS_LOCK 0x39/* USB Standard values:#define UGL_USBKBD_LEFT_CTRL 0xe0#define UGL_USBKBD_RIGHT_CTRL 0xe4#define UGL_USBKBD_LEFT_SHIFT 0xe1#define UGL_USBKBD_RIGHT_SHIFT 0xe5#define UGL_USBKBD_LEFT_ALT 0xe2#define UGL_USBKBD_RIGHT_ALT 0xe6#define UGL_USBKBD_NUM_LOCK 0x53#define UGL_USBKBD_SCROLL_LOCK 0x47#define UGL_USBKBD_CAPS_LOCK 0x39Mapping table needs to be adjusted to contain theseif they are used.*//* ----- Keyboard LED values ----- */#define UGL_USBKBD_LED_CAPS_LOCK 0x4#define UGL_USBKBD_LED_NUM_LOCK 0x2#define UGL_USBKBD_LED_SCROLL_LOCK 0x1/* USB type keyboard */extern USB_KBD_KEYMAP usbKbdUsKeyMapTable[];extern size_t sizeOfUsbUsKmap;#ifdef __cplusplus}#endif#endif /* __INCuglusbkbdh */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -