DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Keyboard Sounds  (Read 22,033 times)

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Keyboard Sounds
« on: August 17, 2008, 09:16 AM »
Hi, I've been running this for a while - works great:

Quote
~*shift::SoundPlay, %A_WinDir%\Media\chimes.wav

~*alt::SoundPlay, %A_WinDir%\Media\notify.wav

~*ctrl::SoundPlay, %A_WinDir%\Media\ding.wav

Now I want to make other keys sound and I managed this
Quote
~*a::SoundPlay, %A_WinDir%\Media\Key.wav

How do I include the b to z keys without having to type each separately?

Thanks CleverCat  :D
If you need help - JUST ASK!

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Keyboard Sounds
« Reply #1 on: August 29, 2008, 12:20 AM »
is this an autohotkey question? surely we have some autohotkey people who can help with this.

Curt

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 7,565
Re: Keyboard Sounds
« Reply #2 on: August 29, 2008, 01:01 AM »
Would be easier to install the free Jingle Keyboard
http://www.bestfreewaredownload.com/freeware/t-free-jingle-keyboard-freeware-kdflhwed.html
http://jinglekeys.com/jinglekeys/

- or to purchase it's more advanced replacement, Talking Keyboard - but I haven't tried this one.
http://jinglekeys.com/talkingkeys/

SirSmiley

  • Member
  • Joined in 2007
  • **
  • Posts: 64
Re: Keyboard Sounds
« Reply #3 on: August 29, 2008, 01:40 AM »
Haven't done any scripting in AHK but, couldn't you just use an array or a loop statement?

...Jingle Keyboard

Not to be confused with that all time Christmas Classic "Jingle All the Way"!  :P
« Last Edit: August 29, 2008, 01:44 AM by SirSmiley »

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • Coding Snacks
    • Volunteers/Staff
    • Gathering Badge
    • Participated in NANY Challenge Once
    • Linux User
Re: Keyboard Sounds
« Reply #4 on: August 29, 2008, 01:56 AM »
here's a working example that defines keys in a range.

Quote from: "Laszlo"
keys = ``1234567890-=qwertyuiop[]\asdfghjkl;'zxcvbnm,./
Loop Parse, keys
   HotKey ~*%A_LoopField%, Hoty

Hoty:
   SoundBeep 999, 1
Return
Source: http://www.autohotkey.com/forum/viewtopic.php?p=111687#111687

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Re: Keyboard Sounds
« Reply #5 on: August 29, 2008, 12:19 PM »
Thanks guys - will be looking at all suggestions!  :Thmbsup:
If you need help - JUST ASK!

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Re: Keyboard Sounds
« Reply #6 on: August 29, 2008, 12:42 PM »
I already use 'noisy keyboard' but was playing up and wanted to improve my AHK skills!

Lanux - it works - once I figured out it had to be inserted at beginning of script! I even changed the sound as my 'beep' stopped working...

I'm using a combination but maybe now I can figure out how to make the other keys like backspace/enter etc work on AHK! If not, I'll be back...  ;D
If you need help - JUST ASK!

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • Coding Snacks
    • Volunteers/Staff
    • Gathering Badge
    • Participated in NANY Challenge Once
    • Linux User
Re: Keyboard Sounds
« Reply #7 on: August 29, 2008, 02:04 PM »
Lanux - it works - once I figured out it had to be inserted at beginning of script! I even changed the sound as my 'beep' stopped working...

i should have written some comments on the code but i reckon you had much more fun figuring it out. :D

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Re: Keyboard Sounds
« Reply #8 on: August 30, 2008, 08:58 AM »
:Thmbsup:

I don't understand much about code, but it didn't take long to figure out where it went!

Any clues to including the few remaining keys like Enter/Bksp/Caps Lock/Tab :tellme:
If you need help - JUST ASK!

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Re: Keyboard Sounds
« Reply #9 on: August 30, 2008, 09:00 AM »
Same formula as my Shift/Alt/Control...
If you need help - JUST ASK!

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • Coding Snacks
    • Volunteers/Staff
    • Gathering Badge
    • Participated in NANY Challenge Once
    • Linux User
Re: Keyboard Sounds
« Reply #10 on: August 30, 2008, 11:42 AM »
Same formula as my Shift/Alt/Control...

yes, your earlier code should work fine, just copy-paste the lines below. :)

Quote
;Enter/Bksp/Caps Lock/Tab
~*enter::SoundPlay, %A_WinDir%\Media\chimes.wav
~*backspace::SoundPlay, %A_WinDir%\Media\chimes.wav
~*capslock::SoundPlay, %A_WinDir%\Media\chimes.wav
~*tab::SoundPlay, %A_WinDir%\Media\chimes.wav
~*space::SoundPlay, %A_WinDir%\Media\chimes.wav

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Re: Keyboard Sounds
« Reply #11 on: August 30, 2008, 01:34 PM »
Thanks - will report back when mission accomplished!  ;)
If you need help - JUST ASK!

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Re: Keyboard Sounds
« Reply #12 on: September 05, 2008, 01:17 PM »
MISSION ACCOMPLISHED!  :Thmbsup:

I even 'customized' the wav's to my preference!  ;)

Just one small problem - sometimes the sounds lag behind the key press?
If you need help - JUST ASK!

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • Cody Award
    • Official Forum Clown
    • rotten turkey sandwich - Rotten Turkey Sandwich
Re: Keyboard Sounds
« Reply #13 on: September 05, 2008, 04:03 PM »
sometimes the sounds lag behind the key press?

Previously, I haven't wanted to dazzle the community with my technical skills but this one I can't resist.

Press the keys more slowly.
Chris

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Re: Keyboard Sounds
« Reply #14 on: September 06, 2008, 07:24 AM »
Not possible  ;) - although I type with one finger now due to my disability. I used to do 80 wpm!

My Brother says I type faster with one finger than he does with both hands!  ;D ;D

If you need help - JUST ASK!

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • Cody Award
    • Official Forum Clown
    • rotten turkey sandwich - Rotten Turkey Sandwich
Re: Keyboard Sounds
« Reply #15 on: September 06, 2008, 11:25 AM »
My Brother says I type faster with one finger than he does with both hands!  ;D ;D
I suspect that I belong in the same camp as your brother.
Sorry for the unhelpful interjection (well, almost mildly repentant). I'm sure that you'll get an informed response soon.
Chris

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Re: Keyboard Sounds
« Reply #16 on: September 06, 2008, 12:41 PM »
Hey, we need all the humour we can get!
If you need help - JUST ASK!

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • Coding Snacks
    • Volunteers/Staff
    • Gathering Badge
    • Participated in NANY Challenge Once
    • Linux User
Re: Keyboard Sounds
« Reply #17 on: September 06, 2008, 10:18 PM »
Just one small problem - sometimes the sounds lag behind the key press?

due to the speed of keypresses, i'm afraid this is not possible to rectify unless the the .wav files are really short. maybe you can try the "wait" switch and see if it makes a difference. :)

Quote
~*enter::SoundPlay, %A_WinDir%\Media\chimes.wav, Wait

CleverCat

  • Cat's Are Fun!
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
Re: Keyboard Sounds
« Reply #18 on: September 07, 2008, 06:30 AM »
Will give that a try...  :Thmbsup:
If you need help - JUST ASK!

Original address: https://www.donationcoder.com/forum/index.php?topic=14445.0