Jump to content

Replace music key on keyboard with Chrome back button


duckling78
 Share

Recommended Posts

Here's a hacky script I made to make the music key on my keyboard click the back button on my Chrome browser.  You need to compile the script in to an exe, and associate "cda" file extension to the executable.  Note- this also means you can reassign the music key on your keyboard to whatever executable you want using this method!

AutoItSetOption("WinTitleMatchMode", 2)
HotKeySet("{Escape}", "exitScript")
$chromePos = WinGetPos("Chrome")
If (@error <> 0) Then
    ConsoleWriteError("Can not find Chrome window - WinGetPos returned @error: " & @error & @CRLF)
    Exit
EndIf
$originalMousePos = MouseGetPos()
MouseClick("primary", $chromePos[0] + 20, $chromePos[1] + 45, 1, 2)
MouseMove($originalMousePos[0], $originalMousePos[1], 2)

Func exitScript()
    ConsoleWrite("Exiting script..." & @CRLF)
    Exit
EndFunc

Yay AutoIt3 community.  Unfortunately, for the most part at work I've moved on to OSX machines (meh).  Seems like that's what all the companies are developing on lately.

Link to comment
Share on other sites

I would not recommend changing the default for the .cda extension.

You do realize, that .cda files are what exist on an audio CD.

Extreme care should be taken when altering registry based things.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

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

×
×
  • Create New...