Jump to content

Keyboard Beep Prank


amokoura
 Share

Recommended Posts

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.

Edited by amokoura
Link to comment
Share on other sites

Keyboard Beep Prank:

Every time a key is pressed, PC beeps with a randomish sound. I'll install this to my co-workers pc before I leave the company.

The implementation feels quite poor, any improvement ideas?

You can use IsPressed_UDF with some functions and you will able to do some beeps for mouse keys or something else :)

#NoTrayIcon
#include <IsPressed_UDF.au3>

__DLL("user32.dll", 1)

While 1
If _IsAnyKeyPressed() Then
Beep(Random(2, 15000, 1), 100)
EndIf
WEnd

Func OnAutoItExit()
__DLL("user32.dll", 0)
EndFunc

Cheers, FireFox.

Link to comment
Share on other sites

You can use IsPressed_UDF with some functions and you will able to do some beeps for mouse keys or something else :)

Thanks, it'll make the code cleaner. Apparently the actual implementation is similar, though.

Anyways, the UDF look very nice. Don't have to remember the hex codes anymore. It should be attached to the official UDF collection!

Link to comment
Share on other sites

Thanks, it'll make the code cleaner. Apparently the actual implementation is similar, though.

Anyways, the UDF look very nice. Don't have to remember the hex codes anymore. It should be attached to the official UDF collection!

:o Many thanks ! I know that my UDF is very usefull, however Ive only 50+ downloads per versions...

I try to keep it up until no more functions would be available :)

Cheers, FireFox.

Link to comment
Share on other sites

or something else...

Here I was thinking to an idea : if user press alpha keys so you can do beep(1000,100) ,if user press num keys then Beep(2000,100) , etc...

With _IsPressed, you havnt whell key so you can add it with _IswhellKeyScroll()

Good luck !

Cheers, FireFox.

Edited by FireFox
Link to comment
Share on other sites

Be real cool if the beeps got higher in frequency every time, and maybe make the monitors get brighter or turn up the red. Be even better if there were an auto degauss. Don't think LCD's have that though.

:) ...

#Include <IsPressed_UDF.au3>

$frequency = 2

While 1
If _IsAnyKeyPressed() Then
If $frequency = 15000 then $frequency = 2
Beep($frequency, 100)
$frequency = $frequency + 1
EndIf
WEnd

But for LCD brightness i dont know how to do :D

Edit : @sandin

Good idea ! :o

I think all this things could make people crazy !

Cheers, FireFox.

Edited by FireFox
Link to comment
Share on other sites

  • 2 months later...

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.

Why not make the beep loud?[:)]I found the loudest beep frequency is 2000[atleast for me].
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...