Jump to content
Sign in to follow this  
amokoura

Keyboard Beep Prank

Recommended Posts

amokoura

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

Share this post


Link to post
Share on other sites
FireFox

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.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
amokoura

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!

Share this post


Link to post
Share on other sites
FireFox

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.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
FireFox

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

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
youknowwho4eva

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

Share this post


Link to post
Share on other sites
sandin
FireFox

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

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
Inyu

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

Share this post


Link to post
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
Sign in to follow this  

×