Updated DuckyKeyboardController with 2ms delays between each packet sent

This should fix the issue where Ducky keyboards would softlock

Commit amended to move delays to packet send functions by Adam Honse <calcprogrammer1@gmail.com>
This commit is contained in:
sakloui 2021-04-04 14:19:36 +02:00 committed by Adam Honse
parent 0fd106cb92
commit 2ae12c52ec

View file

@ -81,6 +81,7 @@ void DuckyKeyboardController::SendInitialize()
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, (unsigned char *)usb_buf, 65);
std::this_thread::sleep_for(std::chrono::milliseconds(2));
}
void DuckyKeyboardController::SendInitializeColorPacket()
@ -109,6 +110,7 @@ void DuckyKeyboardController::SendInitializeColorPacket()
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, (unsigned char *)usb_buf, 65);
std::this_thread::sleep_for(std::chrono::milliseconds(2));
}
unsigned int DuckyKeyboardController::SendColorDataPacket
@ -176,6 +178,7 @@ unsigned int DuckyKeyboardController::SendColorDataPacket
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, (unsigned char *)usb_buf, 65);
std::this_thread::sleep_for(std::chrono::milliseconds(2));
return(bytes_sent);
}
@ -201,4 +204,5 @@ void DuckyKeyboardController::SendTerminateColorPacket()
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, (unsigned char *)usb_buf, 65);
std::this_thread::sleep_for(std::chrono::milliseconds(2));
}