Sign in to follow this  
Followers 0
duckling78

Replace music key on keyboard with Chrome back button

2 posts in this topic

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.

Share this post


Link to post
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.


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

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

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  
Followers 0

  • Similar Content

    • FMS
      By FMS
      Hello,
      I'm trying to wright a automated process to show some URL's in chrome browsers on multiple screens.
      I've 4 screens and want to show on each screen another instance of chrome whit its own URL.
      In mine search on the site i din't find any topic for this specific problem.
      The way I was trying is something like :
      ShellExecute("chrome.exe", "http://URL1 --start-maximized") so I'll not see the addressbar but it was not opend full screen .
      I've some questions about this way:
      -Is there a way to maximize it on a dedicated screen ?
      (like URL1 on screen 1 , URL2 on screen 2 etc...)
      -Shellexecute will add a tab on a existing browser and will not open another instance, is there a way to work around this?
      Is there somebody who had the same problem whit chrome?
      thanks in advanced.
      edit: I've checked the chrome UDF but it din't same to get the job done....
    • BlazerV60
      By BlazerV60
      Hello all,
      I've been trying to figure out how to launch Google Chrome in the background (hidden) but it doesn't seem possible. I've tried the following methods:
      ShellExecute("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", "", "", "", @SW_HIDE) Also I've tried:
      ShellExecute(@ComSpec, "/c start chrome.exe","","",@SW_HIDE) Lastly I tried:
      RunWait('"'&@ProgramFilesDir&'\Google\Chrome\Application\chrome.exe" --silent-launch',@ScriptDir)  
      But all of them launch my chrome browser without hiding it. Does anyone know a workaround for this or if AutoIT just can't Chrome? 
      Bonus points if you know how to make it launch chrome hidden and make it go to https://www.autoitscript.com
       
      Thank you,
      Brian
    • BOUNCER
      By BOUNCER
      I'm trying to get the output data from https://www.guilded.gg but it uses a web app that generates that output on the fly and this doesn't show up in the page source.
      Only in web inspector of each browser does this data show up. How do I read this data in autoit (equivalent to the web inspector)
       
      thank you
    • Tarakesh
      By Tarakesh
      I have a situation where the desktop is designed in java swings. The nodes JTree is not allowing me to do checkbox selection using "spacebar". I am able to navigate through the nodes using up, down arrow and a tab. When I reach to the desire node selection, mouse left click is not working due a flaw a JTree core. However since it is selected, if mouse cursor auto moved to the position of the selection and send a "click"  then it should be solved. Any ideas much appreciated. 
      the problem with having fixed coordinates are the main windows is divided to 2panels where right panel containing this JTree can be expanded or shrink-ed.

    • myspacee
      By myspacee
      Hello,
      need help to remap '<' button and SHIFT+'<'
      I made a little editor that allows to my users to write using proprietary codes.
      In production we have 2 keys/symbols that i want to 'emulate'. So, when is press on my keyboard :
      < = « SHIFT+< = » Try to use help example _IsPressed :
       
      #include <Misc.au3> #include <MsgBoxConstants.au3> Local $hDLL = DllOpen("user32.dll") While 1 If _IsPressed("10", $hDLL) Then ConsoleWrite("_IsPressed - Shift Key was pressed." & @CRLF) ; Wait until key is released. While _IsPressed("10", $hDLL) Sleep(250) WEnd ConsoleWrite("_IsPressed - Shift Key was released." & @CRLF) ElseIf _IsPressed("1B", $hDLL) Then MsgBox($MB_SYSTEMMODAL, "_IsPressed", "Close the application.") ExitLoop EndIf Sleep(250) WEnd DllClose($hDLL) but how manage keys combination ?
      thank you for any help,
      m.