Jump to content

Recommended Posts

Posted (edited)

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
Posted

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.

Posted

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!

Posted

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.

Posted (edited)

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
Posted

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.

Giggity

Posted (edited)

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
  • 2 months later...
Posted

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].

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
  • Recently Browsing   0 members

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