\r
uint8_t UsedKeyCodes = 0;\r
\r
+ KeyboardReport->Modifier = HID_KEYBOARD_MODIFER_LEFTSHIFT;\r
+ \r
if (JoyStatus_LCL & JOY_UP)\r
KeyboardReport->KeyCode[UsedKeyCodes++] = 0x04; // A\r
else if (JoyStatus_LCL & JOY_DOWN)\r
if (!(ButtonStatus_LCL & BUTTONS_BUTTON1))\r
return 0;\r
\r
+ KeyboardReport->Modifier = HID_KEYBOARD_MODIFER_LEFTSHIFT;\r
+\r
if (JoyStatus_LCL & JOY_UP)\r
KeyboardReport->KeyCode[0] = 0x04; // A\r
else if (JoyStatus_LCL & JOY_DOWN)\r
uint8_t JoyStatus_LCL = Joystick_GetStatus();\r
uint8_t ButtonStatus_LCL = Buttons_GetStatus();\r
\r
+ KeyboardReport->Modifier = HID_KEYBOARD_MODIFER_LEFTSHIFT;\r
+\r
if (JoyStatus_LCL & JOY_UP)\r
KeyboardReport->KeyCode[0] = 0x04; // A\r
else if (JoyStatus_LCL & JOY_DOWN)\r
/* Clear the report contents */\r
memset(ReportData, 0, sizeof(USB_KeyboardReport_Data_t));\r
\r
+ /* Make sent key uppercase by indicating that the left shift key is pressed */\r
+ ReportData->Modifier = KEYBOARD_MODIFER_LEFTSHIFT;\r
+ \r
if (JoyStatus_LCL & JOY_UP)\r
ReportData->KeyCode[UsedKeyCodes++] = 0x04; // A\r
else if (JoyStatus_LCL & JOY_DOWN)\r
\r
/* Macros: */\r
/** Idle period indicating that reports should be sent only when the inputs have changed */\r
- #define HID_IDLE_CHANGESONLY 0\r
+ #define HID_IDLE_CHANGESONLY 0\r
\r
/** HID Class specific request to get the next HID report from the device. */\r
- #define REQ_GetReport 0x01\r
+ #define REQ_GetReport 0x01\r
\r
/** HID Class specific request to get the idle timeout period of the device. */\r
- #define REQ_GetIdle 0x02\r
+ #define REQ_GetIdle 0x02\r
\r
/** HID Class specific request to send the next HID report to the device. */\r
- #define REQ_SetReport 0x09\r
+ #define REQ_SetReport 0x09\r
\r
/** HID Class specific request to set the idle timeout period of the device. */\r
- #define REQ_SetIdle 0x0A\r
+ #define REQ_SetIdle 0x0A\r
\r
/** HID Class specific request to get the current HID protocol in use, either report or boot. */\r
- #define REQ_GetProtocol 0x03\r
+ #define REQ_GetProtocol 0x03\r
\r
/** HID Class specific request to set the current HID protocol in use, either report or boot. */\r
- #define REQ_SetProtocol 0x0B\r
+ #define REQ_SetProtocol 0x0B\r
+\r
+ /** Constant for a keyboard report modifier byte, indicating that the keyboard's left control key is currently pressed. */\r
+ #define KEYBOARD_MODIFER_LEFTCTRL (1 << 0)\r
+\r
+ /** Constant for a keyboard report modifier byte, indicating that the keyboard's left shift key is currently pressed. */\r
+ #define KEYBOARD_MODIFER_LEFTSHIFT (1 << 1)\r
+\r
+ /** Constant for a keyboard report modifier byte, indicating that the keyboard's left alt key is currently pressed. */\r
+ #define KEYBOARD_MODIFER_LEFTALT (1 << 2)\r
+\r
+ /** Constant for a keyboard report modifier byte, indicating that the keyboard's left GUI key is currently pressed. */\r
+ #define KEYBOARD_MODIFER_LEFTGUI (1 << 3)\r
+\r
+ /** Constant for a keyboard report modifier byte, indicating that the keyboard's right control key is currently pressed. */\r
+ #define KEYBOARD_MODIFER_RIGHTCTRL (1 << 4)\r
+\r
+ /** Constant for a keyboard report modifier byte, indicating that the keyboard's right shift key is currently pressed. */\r
+ #define KEYBOARD_MODIFER_RIGHTSHIFT (1 << 5)\r
+\r
+ /** Constant for a keyboard report modifier byte, indicating that the keyboard's right alt key is currently pressed. */\r
+ #define KEYBOARD_MODIFER_RIGHTALT (1 << 6)\r
+\r
+ /** Constant for a keyboard report modifier byte, indicating that the keyboard's right GUI key is currently pressed. */\r
+ #define KEYBOARD_MODIFER_RIGHTGUI (1 << 7)\r
\r
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */\r
- #define LEDMASK_USB_NOTREADY LEDS_LED1\r
+ #define LEDMASK_USB_NOTREADY LEDS_LED1\r
\r
/** LED mask for the library LED driver, to indicate that the USB interface is enumerating. */\r
- #define LEDMASK_USB_ENUMERATING (LEDS_LED2 | LEDS_LED3)\r
+ #define LEDMASK_USB_ENUMERATING (LEDS_LED2 | LEDS_LED3)\r
\r
/** LED mask for the library LED driver, to indicate that the USB interface is ready. */\r
- #define LEDMASK_USB_READY (LEDS_LED2 | LEDS_LED4)\r
+ #define LEDMASK_USB_READY (LEDS_LED2 | LEDS_LED4)\r
\r
/** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */\r
- #define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3)\r
+ #define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3)\r
\r
/* Type Defines: */\r
/** Type define for the keyboard HID report structure, for creating and sending HID reports to the host PC.\r
/* Check if board button is not pressed, if so mouse mode enabled */\r
if (!(Buttons_GetStatus() & BUTTONS_BUTTON1))\r
{\r
+ /* Make sent key uppercase by indicating that the left shift key is pressed */\r
+ KeyboardReportData.Modifier = KEYBOARD_MODIFER_LEFTSHIFT;\r
+\r
if (JoyStatus_LCL & JOY_UP)\r
KeyboardReportData.KeyCode[0] = 0x04; // A\r
else if (JoyStatus_LCL & JOY_DOWN)\r
\r
/* Macros: */\r
/** HID Class specific request to get the next HID report from the device. */\r
- #define REQ_GetReport 0x01\r
+ #define REQ_GetReport 0x01\r
\r
/** HID Class specific request to send the next HID report to the device. */\r
- #define REQ_SetReport 0x09\r
+ #define REQ_SetReport 0x09\r
\r
/** HID Class specific request to get the current HID protocol in use, either report or boot. */\r
- #define REQ_GetProtocol 0x03\r
+ #define REQ_GetProtocol 0x03\r
\r
/** HID Class specific request to set the current HID protocol in use, either report or boot. */\r
- #define REQ_SetProtocol 0x0B\r
+ #define REQ_SetProtocol 0x0B\r
+\r
+ /** Constant for a keyboard report modifier byte, indicating that the keyboard's left control key is currently pressed. */\r
+ #define KEYBOARD_MODIFER_LEFTCTRL (1 << 0)\r
+\r
+ /** Constant for a keyboard report modifier byte, indicating that the keyboard's left shift key is currently pressed. */\r
+ #define KEYBOARD_MODIFER_LEFTSHIFT (1 << 1)\r
+\r
+ /** Constant for a keyboard report modifier byte, indicating that the keyboard's left alt key is currently pressed. */\r
+ #define KEYBOARD_MODIFER_LEFTALT (1 << 2)\r
+\r
+ /** Constant for a keyboard report modifier byte, indicating that the keyboard's left GUI key is currently pressed. */\r
+ #define KEYBOARD_MODIFER_LEFTGUI (1 << 3)\r
+\r
+ /** Constant for a keyboard report modifier byte, indicating that the keyboard's right control key is currently pressed. */\r
+ #define KEYBOARD_MODIFER_RIGHTCTRL (1 << 4)\r
+\r
+ /** Constant for a keyboard report modifier byte, indicating that the keyboard's right shift key is currently pressed. */\r
+ #define KEYBOARD_MODIFER_RIGHTSHIFT (1 << 5)\r
+\r
+ /** Constant for a keyboard report modifier byte, indicating that the keyboard's right alt key is currently pressed. */\r
+ #define KEYBOARD_MODIFER_RIGHTALT (1 << 6)\r
+\r
+ /** Constant for a keyboard report modifier byte, indicating that the keyboard's right GUI key is currently pressed. */\r
+ #define KEYBOARD_MODIFER_RIGHTGUI (1 << 7)\r
\r
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */\r
- #define LEDMASK_USB_NOTREADY LEDS_LED1\r
+ #define LEDMASK_USB_NOTREADY LEDS_LED1\r
\r
/** LED mask for the library LED driver, to indicate that the USB interface is enumerating. */\r
- #define LEDMASK_USB_ENUMERATING (LEDS_LED2 | LEDS_LED3)\r
+ #define LEDMASK_USB_ENUMERATING (LEDS_LED2 | LEDS_LED3)\r
\r
/** LED mask for the library LED driver, to indicate that the USB interface is ready. */\r
- #define LEDMASK_USB_READY (LEDS_LED2 | LEDS_LED4)\r
+ #define LEDMASK_USB_READY (LEDS_LED2 | LEDS_LED4)\r
\r
/** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */\r
- #define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3)\r
+ #define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3)\r
\r
/* Type Defines: */\r
/** Type define for the keyboard HID report structure, for creating and sending HID reports to the host PC.\r
unsigned char _RESERVED1 : 7;\r
unsigned char Removable : 1;\r
\r
- uint8_t Version;\r
+ uint8_t Version;\r
\r
unsigned char ResponseDataFormat : 4;\r
unsigned char _RESERVED2 : 1;\r
unsigned char TrmTsk : 1;\r
unsigned char AERC : 1;\r
\r
- uint8_t AdditionalLength;\r
- uint8_t _RESERVED3[2];\r
+ uint8_t AdditionalLength;\r
+ uint8_t _RESERVED3[2];\r
\r
unsigned char SoftReset : 1;\r
unsigned char CmdQue : 1;\r
unsigned char WideBus32Bit : 1;\r
unsigned char RelAddr : 1;\r
\r
- uint8_t VendorID[8];\r
- uint8_t ProductID[16];\r
- uint8_t RevisionID[4];\r
+ uint8_t VendorID[8];\r
+ uint8_t ProductID[16];\r
+ uint8_t RevisionID[4];\r
} SCSI_Inquiry_Response_t;\r
\r
/** Type define for a SCSI sense structure to a SCSI REQUEST SENSE command. For details of the\r
unsigned char EOM : 1;\r
unsigned char FileMark : 1;\r
\r
- uint8_t Information[4];\r
- uint8_t AdditionalLength;\r
- uint8_t CmdSpecificInformation[4];\r
- uint8_t AdditionalSenseCode;\r
- uint8_t AdditionalSenseQualifier;\r
- uint8_t FieldReplaceableUnitCode;\r
- uint8_t SenseKeySpecific[3];\r
+ uint8_t Information[4];\r
+ uint8_t AdditionalLength;\r
+ uint8_t CmdSpecificInformation[4];\r
+ uint8_t AdditionalSenseCode;\r
+ uint8_t AdditionalSenseQualifier;\r
+ uint8_t FieldReplaceableUnitCode;\r
+ uint8_t SenseKeySpecific[3];\r
} SCSI_Request_Sense_Response_t;\r
\r
/* Function Prototypes: */\r
\r
/* Macros: */\r
/** HID Class Specific Request to get the current HID report from the device. */\r
- #define REQ_GetReport 0x01\r
+ #define REQ_GetReport 0x01\r
\r
/** HID Class Specific Request to get the current device idle count. */\r
- #define REQ_GetIdle 0x02\r
+ #define REQ_GetIdle 0x02\r
\r
/** HID Class Specific Request to set the current HID report to the device. */\r
- #define REQ_SetReport 0x09\r
+ #define REQ_SetReport 0x09\r
\r
/** HID Class Specific Request to set the device's idle count. */\r
- #define REQ_SetIdle 0x0A\r
+ #define REQ_SetIdle 0x0A\r
\r
/** HID Class Specific Request to get the current HID report protocol mode. */\r
- #define REQ_GetProtocol 0x03\r
+ #define REQ_GetProtocol 0x03\r
\r
/** HID Class Specific Request to set the current HID report protocol mode. */\r
- #define REQ_SetProtocol 0x0B\r
+ #define REQ_SetProtocol 0x0B\r
\r
/** Descriptor header type value, to indicate a HID class HID descriptor. */\r
- #define DTYPE_HID 0x21\r
+ #define DTYPE_HID 0x21\r
\r
/** Descriptor header type value, to indicate a HID class HID report descriptor. */\r
- #define DTYPE_Report 0x22\r
+ #define DTYPE_Report 0x22\r
\r
/** Constant for the protocol value of a HID interface descriptor, indicating that the interface does not support\r
* any HID class boot protocol (see HID Class Specification).\r
*/\r
- #define HID_NON_BOOT_PROTOCOL 0x00\r
+ #define HID_NON_BOOT_PROTOCOL 0x00\r
\r
/** Constant for the protocol value of a HID interface descriptor, indicating that the interface supports the\r
* HID class Keyboard boot protocol (see HID Class Specification).\r
*/\r
- #define HID_BOOT_KEYBOARD_PROTOCOL 0x01\r
+ #define HID_BOOT_KEYBOARD_PROTOCOL 0x01\r
\r
/** Constant for the protocol value of a HID interface descriptor, indicating that the interface supports the\r
* HID class Mouse boot protocol (see HID Class Specification).\r
*/\r
- #define HID_BOOT_MOUSE_PROTOCOL 0x02\r
+ #define HID_BOOT_MOUSE_PROTOCOL 0x02\r
+ \r
+ /** Constant for a keyboard report modifier byte, indicating that the keyboard's left control key is currently pressed. */\r
+ #define HID_KEYBOARD_MODIFER_LEFTCTRL (1 << 0)\r
+\r
+ /** Constant for a keyboard report modifier byte, indicating that the keyboard's left shift key is currently pressed. */\r
+ #define HID_KEYBOARD_MODIFER_LEFTSHIFT (1 << 1)\r
+\r
+ /** Constant for a keyboard report modifier byte, indicating that the keyboard's left alt key is currently pressed. */\r
+ #define HID_KEYBOARD_MODIFER_LEFTALT (1 << 2)\r
+\r
+ /** Constant for a keyboard report modifier byte, indicating that the keyboard's left GUI key is currently pressed. */\r
+ #define HID_KEYBOARD_MODIFER_LEFTGUI (1 << 3)\r
+\r
+ /** Constant for a keyboard report modifier byte, indicating that the keyboard's right control key is currently pressed. */\r
+ #define HID_KEYBOARD_MODIFER_RIGHTCTRL (1 << 4)\r
+\r
+ /** Constant for a keyboard report modifier byte, indicating that the keyboard's right shift key is currently pressed. */\r
+ #define HID_KEYBOARD_MODIFER_RIGHTSHIFT (1 << 5)\r
+\r
+ /** Constant for a keyboard report modifier byte, indicating that the keyboard's right alt key is currently pressed. */\r
+ #define HID_KEYBOARD_MODIFER_RIGHTALT (1 << 6)\r
+\r
+ /** Constant for a keyboard report modifier byte, indicating that the keyboard's right GUI key is currently pressed. */\r
+ #define HID_KEYBOARD_MODIFER_RIGHTGUI (1 << 7)\r
\r
/* Type Defines: */\r
/** Enum for the different types of HID reports. */\r
/** Type define for a standard Boot Protocol Keyboard report */\r
typedef struct\r
{\r
- uint8_t Modifier; /**< Keyboard modifier byte, indicating pressed modifier keys (such as Shift, Control, etc.) */\r
+ uint8_t Modifier; /**< Keyboard modifier byte, indicating pressed modifier keys (a combination of\r
+ * HID_KEYBOARD_MODIFER_* masks)\r
+ */\r
uint8_t Reserved; /**< Reserved for OEM use, always set to 0 */\r
uint8_t KeyCode[6]; /**< Key codes of the currently pressed keys */\r
} USB_KeyboardReport_Data_t;\r
* - New Webserver project, a RNDIS host USB webserver using the open source uIP TCP/IP network stack and FatFS library\r
* - New BOARD value option BOARD_NONE (equivelent to not specifying BOARD) which will remove all board hardware drivers which\r
* do not adversely affect the code operation (currently only the LEDs driver)\r
+ * - Added keyboard modifier masks (HID_KEYBOARD_MODIFER_*) to the HID class driver and Keyboard demos\r
*\r
* <b>Changed:</b>\r
* - Slowed down software USART carried PDI programming in the AVRISP project to prevent transmission errors\r