Keyboard Beep Prank: On every key press, PC beeps with a random frequency. I'll install this to my co-workers pc before I leave the company. The implementation feels quite poor, any improvement ideas? #NoTrayIcon
#include <Misc.au3>
$dll = DllOpen("user32.dll")
While 1
for $i=1 to 221
If _IsPressed(Hex($i, 2), $dll) Then
beep(random(100,1000,1), 100)
ExitLoop
EndIf
Next
Sleep ( 100 )
WEnd
DllClose($dll) EDIT: Changed the beep frequency to random instead of a calculation based on the key hex. Cooler effect.