function test () io.write(string.format("+keyboardstress\n")) local properties = [[ VendorID 5 ProductID 6 ReportInterval 10000 RequestTimeout 5000000 ]] local descriptor = { 0x05 ,0x01 ,0x09 ,0x06 ,0xa1 ,0x01 ,0x05 ,0x07 ,0x19 ,0xe0 ,0x29 , 0xe7 ,0x15 ,0x00 ,0x25 ,0x01 ,0x75 ,0x01 ,0x95 ,0x08 ,0x81 ,0x02 , 0x95 ,0x01 ,0x75 ,0x08 ,0x81 ,0x01 ,0x05 ,0x08 ,0x19 ,0x01 ,0x29 , 0x05 ,0x95 ,0x05 ,0x75 ,0x01 ,0x91 ,0x02 ,0x95 ,0x01 ,0x75 ,0x03 , 0x91 ,0x01 ,0x05 ,0x07 ,0x19 ,0x00 ,0x2a ,0xff ,0x00 ,0x95 ,0x05 , 0x75 ,0x08 ,0x15 ,0x00 ,0x26 ,0xff ,0x00 ,0x81 ,0x00 ,0x05 ,0xff , 0x09 ,0x03 ,0x75 ,0x08 ,0x95 ,0x01 ,0x81 ,0x02 ,0xc0 } local keyboards = {} for i=0,20,1 do keyboards[i] = HIDUserDevice(properties, descriptor) end util.usleep(100000) for i=0,20,1 do io.write(string.format("Send key\n")) local keyboard = keyboards[i]; keyboard:SendReport ({0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00}) util.usleep(10000) keyboard:SendReport ({0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}) end io.write(string.format("-keyboardstress\n")) end function main () for i=0,10000,1 do test() collectgarbage() end end main();