X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/0c5d6f5f975790f9cd19a0f65a2a0c4598b2862f..a9e0935a90346beb0c981924becc1f55d969a08b:/Demos/Device/ClassDriver/Keyboard/Keyboard.c diff --git a/Demos/Device/ClassDriver/Keyboard/Keyboard.c b/Demos/Device/ClassDriver/Keyboard/Keyboard.c index 26636bf41..0da529543 100644 --- a/Demos/Device/ClassDriver/Keyboard/Keyboard.c +++ b/Demos/Device/ClassDriver/Keyboard/Keyboard.c @@ -7,8 +7,7 @@ */ /* - Copyright 2010 Denver Gingerich (denver [at] ossguy [dot] com) - Based on code by Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -67,6 +66,7 @@ int main(void) SetupHardware(); LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY); + sei(); for (;;) { @@ -146,9 +146,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn uint8_t ButtonStatus_LCL = Buttons_GetStatus(); uint8_t UsedKeyCodes = 0; - - KeyboardReport->Modifier = HID_KEYBOARD_MODIFER_LEFTSHIFT; - + if (JoyStatus_LCL & JOY_UP) KeyboardReport->KeyCode[UsedKeyCodes++] = 0x04; // A else if (JoyStatus_LCL & JOY_DOWN) @@ -165,6 +163,9 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn if (ButtonStatus_LCL & BUTTONS_BUTTON1) KeyboardReport->KeyCode[UsedKeyCodes++] = 0x09; // F + if (UsedKeyCodes) + KeyboardReport->Modifier = HID_KEYBOARD_MODIFER_LEFTSHIFT; + *ReportSize = sizeof(USB_KeyboardReport_Data_t); return false; }