topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 5:21 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Keyboard Sounds  (Read 17301 times)

CleverCat

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Keyboard Sounds
« on: August 17, 2008, 04:16 AM »
Hi, I've been running this for a while - works great:

~*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
~*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

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Keyboard Sounds
« Reply #1 on: August 28, 2008, 07:20 PM »
is this an autohotkey question? surely we have some autohotkey people who can help with this.

Curt

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 7,566
    • View Profile
    • Donate to Member
Re: Keyboard Sounds
« Reply #2 on: August 28, 2008, 08:01 PM »
Would be easier to install the free Jingle Keyboard
http://www.bestfreew...eeware-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
    • View Profile
    • Donate to Member
Re: Keyboard Sounds
« Reply #3 on: August 28, 2008, 08:40 PM »
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 28, 2008, 08:44 PM by SirSmiley »

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Keyboard Sounds
« Reply #4 on: August 28, 2008, 08:56 PM »
here's a working example that defines keys in a range.

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

Hoty:
   SoundBeep 999, 1
Return
-Laszlo
Source: http://www.autohotke....php?p=111687#111687

CleverCat

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: Keyboard Sounds
« Reply #5 on: August 29, 2008, 07:19 AM »
Thanks guys - will be looking at all suggestions!  :Thmbsup:

CleverCat

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: Keyboard Sounds
« Reply #6 on: August 29, 2008, 07:42 AM »
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

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Keyboard Sounds
« Reply #7 on: August 29, 2008, 09:04 AM »
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

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: Keyboard Sounds
« Reply #8 on: August 30, 2008, 03: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:

CleverCat

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: Keyboard Sounds
« Reply #9 on: August 30, 2008, 04:00 AM »
Same formula as my Shift/Alt/Control... http://img115.exs.cx/img115/8895/signquestion3xd.gif
Keyboard Sounds

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Keyboard Sounds
« Reply #10 on: August 30, 2008, 06:42 AM »
Same formula as my Shift/Alt/Control... http://img115.exs.cx/img115/8895/signquestion3xd.gif
Keyboard Sounds

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

;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

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: Keyboard Sounds
« Reply #11 on: August 30, 2008, 08:34 AM »
Thanks - will report back when mission accomplished!  ;)

CleverCat

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: Keyboard Sounds
« Reply #12 on: September 05, 2008, 08:17 AM »
MISSION ACCOMPLISHED!  :Thmbsup:

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

Just one small problem - sometimes the sounds lag behind the key press?

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
Re: Keyboard Sounds
« Reply #13 on: September 05, 2008, 11:03 AM »
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.

CleverCat

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: Keyboard Sounds
« Reply #14 on: September 06, 2008, 02: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


cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
Re: Keyboard Sounds
« Reply #15 on: September 06, 2008, 06: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.

CleverCat

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: Keyboard Sounds
« Reply #16 on: September 06, 2008, 07:41 AM »
Hey, we need all the humour we can get!

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Keyboard Sounds
« Reply #17 on: September 06, 2008, 05: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. :)

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

CleverCat

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: Keyboard Sounds
« Reply #18 on: September 07, 2008, 01:30 AM »
Will give that a try...  :Thmbsup: