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

    • 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.
    • dilligence
      By dilligence
      Hello everyone,
      I could use some help with the following: 
      I'm a speech recognition user and recently I've started to use AutoIt for additional scripting because sometimes it works faster. 
      I would like to create an AutoIt script that will open the Chrome link on my desktop which is a a symbolic link, so that the Chrome cache is on my Ram drive:
      "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disk-cache-dir="A:\Browser Cache"
      Next I want to send the website address, in this case: https://autochords.com/ (with SendKeys) to the address bar.
      Then another SendKeys to send Enter.
      I want to use this script when I'm working on my girlfriend's computer, where speech recognition isn't installed.
      I could use ShellExecute ("Chrome", "https://autochords.com/") but then it won't run via my ram drive.
      I am a Dragon NaturallySpeaking user. The program has a scripting language similar to VBA. In Dragon the command is as follows:
      HeardWord "open","chrome" ; HeardWord acts as if I literally said "open Chrome" this command opens any desktop shortcut no matter which window I'm working in.
      Wait 1500 
      SendKeys "https://autochords.com/"
      SendKeys "{Enter}"; these last three lines are similar to AutoIt language I think.....
      Any help would be appreciated.
      Rob

       
    • wakillon
      By wakillon
      I love chiptune music, but BASS only support XM, IT, S3M, MOD, MTM, UMX and MO3 file format for MOD music.
       
      1 | Nintendo NES and SNES Sound File Players
      May be you already have some files with extension nsf, nsfe, spc or rsn (unzip rsn files for get spc collection files inside) but you can't play them in a AutoIt script ?
      So I searched around a bit, and found 2 DLL ( nsf_player.dll and spc_player.dll ) for play Nintendo NES and SNES Sound Files.
      Interest of those DLL is that they can play from file path or binary data, avoiding temp files.
      Dll and audio files are embedded in scripts for permit you to test them right away.
      Some info/download links are in front of each script.
       
      2 | ModPlug Player
      Another dll found : npmod32.dll who support mod, s3m, xm, med, it, s3z, mdz, itz, xmz and wav files.
      Interest : it can play some rares chiptune formats, you can also pause, set volume and set position.
      Inconvenient : do not load from binary datas.
      Dll and audio files are embedded in script and i have added a gui for permit you to try right away !
      Warning : Do not work on Win8.
       
      3 | ZXTune Player 2 (basszxtune.dll v2.4.5) UPDATE of 23 DEC 2016
      Using BASSZXTUNE chiptune support for BASS ( Support  as0, asc, ay, ftc, gtr, psc, psg, psm, pt1, pt2, pt3, sqt, st1, s, st3, stc, stp, ts, txt, vtx, ym, chi, dmm, dst, m, sqd, str, sid, cop, tf0, tfc, tfd, tfe, $b, $m, ahx, ayc, bin, cc3, d, dsq, esv, fdi, gam, gamplus, gbs, gym, hes, hrm, hrp, lzs, msp, mtc, nsf, nsfe, p, pcd, sap, scl, spc, szx, td0, tlz, tlzp, trd, trs, vgm )
      Interest : it can play lot of rares chiptune formats, while benefiting from all bass functions.
      Inconvenient : dll size.(5860ko)
      Dll and audio files are embedded in script.
       
      4 | TitchySID Player 
      Files and dll are loaded in memory.
      Interest : dll size (8ko), you can Play/Stop/Pause/Resume and choose which subsong to play.
      Inconvenient : only SID audio files supported ( PSID & RSID)
      Dll and audio files are embedded in script.
      Tested under Win7 and Win8.
      Edit : added a Sid header viewer : SidHeaderViewer.au3
       
      5 | MiniFmod Player
      Interest : dll size (20ko)
      Inconvenient : only xm audio files supported.
       
      6 | Npnez Player 
      Using npnez.dll (88ko) for play Gameboy Sound System audio files and some others ( kss, hes, nsf, ay, gbr, gbs, gb, nsd, sgc )
      Interest : Can be loaded in memory, subsong can be set and volume can be adjusted ( perfect for create a fade when exiting ) 
      Inconvenient : for an unknow reason, only 20% of my hes collection is playable...
       
      7 | µFMOD Player 
      Interest : dll size (10ko), can be loaded in memory, support Play/Stop/Pause/Resume actions and volume can be adjusted ( perfect for create a fade when exiting ) 
      Inconvenient : only xm audio files supported.
       
      8 | MagicV2m Player 
      Interest : dll size (20ko), Play/Stop/IsPlay/SetAutoRepeat/Progress
      Inconvenient : only v2m audio files supported, V2mPlayStream is not reliable, so prefer V2mPlayFile instead.
       
      9 | OSMEngine Player 
      OSMEngine.dll (80 ko)(Oldskool Musics Engine) permit to play snd, sndh, fc, fc4, fc14 and some rare jam audio files from Amiga/Atari ST(E)
      Interest : audio can be loaded in memory, and Pause/Resume/SetVolume/GetInfos are available
      Inconvenient : none at the moment. 
       
      10 | Ayfly Player
      Ayfly.dll (268 ko) is a AY-891x emulator and player who support
      the following tracker formats : aqt, asc, ay, fxm, gtr, psc, psg, pt1, pt2, pt3, sqt, stc, stp, vtx, ym and zxs (ZX Spectrum Emulator Snapshot) files.
      Interest : SetVolume/GetInfos are available
      Inconvenient : a function named "ay_initsongindirect" for load module in memory exists, but due to the poor documentation provided i do not succeed to get it to work...
       
      11 | GMGME Player
      GMGME.dll is a emulated music DLL that allows you to play ay, gbs, gym, hes, kss, nsf/nsfe, sap, spc and vgm files.
      Interest : Can play ATARI SAP files (only type B and C) , Set Volume and Set Tempo are available
      Inconvenient : Dll Size (and his imports) , and audio files can not be loaded in memory.
       
      12 | SC68 Player
      sc68replay.dll (166 ko) is a Freebasic DLL compiled from "sc68replay" src that allows you to play SC68  (Atari ST and Amiga audio formats)  files.
      Interest : Can play from file and memory
      Inconvenient : Unfortunatelly for an unknown reason not all sc68 files are supported.
       
      13 | Extended Module Player
      LibXmp.dll  (272 ko)  can "read" xm, mod, it, s3m, med, 669 but also some rares formats
      abk, amd, amf, dbm, digi, dtm, emod, far, flx, fnk, gdm, hsc, imf, j2b, liq, m15, mdl, mfp, mgt, mtm, mtn, okt, psm, ptm, rad, rtm, sfx, smp, stim, stm, stx, ult, umx, wow, ym3812
      Despite its name, it's not a "player" but a library that renders module files to RAW PCM data.
      So the interest in this script was to find a way to convert those raw datas into a "playable" sound.
      With Waveform Audio Interface i create a pseudo Wav header who permit to play datas as a Wav file.
      Interest : Can play from file and memory
      Inconvenient : Time to render datas (depends of file size)
       
      14 | LibModPlug Player
      LibModPlug.dll (102 ko)  can "read" xm, it, mod, s3m, med, 669 and also amf, ams, dbm, dmf, dsm, far, j2b, mdl, mt2, mtm, okt, psm, ptm, stm, ult, umx.
      As LibXmp.dll, it's a library that renders module files to RAW PCM data.
      For this one, i create a real binary wave header for be able to play it easily from memory with winmm.dll PlaySoundW function.
      Interests : Can play from file and memory, and have some nice sound effects : Surround, MegaBass and Reverb  (used in script example)
      It can also replace modplug player(2) for Win 8+ users
      Inconvenient : Time to render datas (depends of file size)
       
      15 | AdPlug Player
      AdPlug.dll ( 69ko ) is an AdLib sound player library who is able to play the following files type :  A2M, ADL, AMD, BAM, CFF, CMF, D00, DFM, DMO, DRO, DTM, HSC, HSP, IMF, KSM, LAA, LDS, M, MAD, MID, MKJ, MSC, MTK, RAD, RAW, RIX, ROL, S3M, SA2, SAT, SCI, SNG, XAD, XMS, XSM
      For this one, time to render datas is to long, so i needed to find an other way for play modules.
      Using Bass.dll and particulary the "BASS_StreamPutData" function i succeeded to play module in loop while rendering it.
      Both DLL are loaded in memory, and 16 different module types are available in the script. No includes/files needed. Just run it.
      Warning : for a unique file extension (example .sng), it's sometimes possible to have several filetypes from different trackers !
      AdPlug.dll Imports : msvcp71.dll, msvcr71.dll in C:\Windows\SysWOW64  ( VC Redist Installer )
      Interests : Can read some obscure rare formats.
      Inconvenient : Can not read from memory
       
      16 | LibMikmod Player
      LibMikmod.dll (85ko) will currently play the following common and not so common  formats : 669, AMF, DSM, FAR, GDM, IMF, IT, MED, MOD, MTM, S3M, STM, STX, ULT, UNI, XM  
      Interests : Can load from memory
      Inconvenient : only for full-screen applications, because if the application has not the focus sound is muted
       
       
      Downloads are available in the download section
      Dedicated to chiptune Lovers ! 
      Music Links : 
      asma.atari.org  woolyss.com  chipmusic.org  demozoo.org  modarchive.org  modules.pl  keygenmusic.net  zxtunes.com  mazemod.org  amigaremix.com  pouet.net  plopbox.eu  Modland
    • Tarakesh
      By Tarakesh
      Hi,
      First of all I would like say infinite thanks to the team involved in designing this great tool.
      Here is my problem
      1. Press windows button
      2. ESC
      3. TAB
      4. It will take me to the first pinned icon in the taskbar
      5. If I I do SHIFT F10 which usually opens context menu like  right click of the mouse.
      6. For one of the application I am using it does not support  Shift + F10 context menu rather it listens to only mouse right click event.
      7. I do a search in a tree view of my application and the search item is selected or focused
      8. For eg

           User1

           User2
           User3
      Now if I search for User1 the tab or focus move to User 1 (Red)
           User1

           User2
           User3
      If I search for User3 the tab or focus moves to User 3
      Now my question is how can I move the mouse automatically go to the focused item on the window. Such that during automation I can issue MoveClick("{RIGHT}") as {SHIFT F10} is not working from the keyboard. It is a java app, unfortunately it is not honoring the right click events from keyboard to open the context

      WinMinimizeAll();
      Send("^{ESC}")
      Sleep(200)
      Send("{ESC}")
      Send("{TAB}")

      the above scripts take the tab to the first pinned icon in the taskbar. Now i want
      MouseMove( "move to tab" selection")

      Regards,
      Tarakesh
    • UEZ
      By UEZ
      A FMOD UDF to play music whereas the DLL calls are done from memory.
      Supported formats:
      - .MOD (protracker/fasttracker modules) - .S3M (screamtracker 3 modules) - .XM (fasttracker 2 modules) - .IT (impulse tracker modules) - .MID (MIDI files) - .RMI (MIDI files) - .SGT (DirectMusic segment files) - .FSB (FMOD Sample Bank files) - .MP3 - .OGG - .WAV - .MP2 - .RAW  
      Click the forum URL to the right for more information.