Want to use AHK to bind laptop's "answer call" key to press control+enter to answer Discord calls Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
MeepTheChangeling
Posts: 6
Joined: 07 Jun 2019, 18:01

Want to use AHK to bind laptop's "answer call" key to press control+enter to answer Discord calls

22 Apr 2021, 21:46

I'm setting up an HP Elietbook for a friend of mine. It has built in keys for answering and hanging up calls on the keyboard. I thought I would set these to work for Discord because, well, duh!

Problem is Discord refuses to let you rebind the hotkeys for most functions, including the answer and hangup hotkeys. Sounds like a job for AHK, right? Rebind these keys to send control+enter and escape respectively.

Unfortunately, it's just not working at all... I press the buttons, nothing happens. I have the script set up like this currently:

Code: Select all

SC068::SendRaw {Ctrl}{Enter}
But, nothing happens. It's important to note that while the AHK script I found to pick up the scancode of a key says that's what key is being pressed, if I try and make one of the few keybinds I CAN make in Discord with these answer call keys, it says I pressed alt+control+META. I'm compleatly lost.

Any recommendations? I'm an AHK noobie so please provide explanations in laymen's terms.
User avatar
boiler
Posts: 16955
Joined: 21 Dec 2014, 02:44

Re: Want to use AHK to bind laptop's "answer call" key to press control+enter to answer Discord calls  Topic is solved

22 Apr 2021, 21:55

SendRaw just sends the actual string of characters, not the keys they represent. And {Ctrl} by itself just presses and releases the Ctrl key instead of modifying the following key.

Try:

Code: Select all

sc068::Send, ^{Enter}
or:

Code: Select all

sc068::Send, {Ctrl down}{Enter}{Ctrl up}
MeepTheChangeling
Posts: 6
Joined: 07 Jun 2019, 18:01

Re: Want to use AHK to bind laptop's "answer call" key to press control+enter to answer Discord calls

22 Apr 2021, 22:26

boiler wrote:
22 Apr 2021, 21:55
Try:

Code: Select all

sc068::Send, ^{Enter}
or:

Code: Select all

sc068::Send, {Ctrl down}{Enter}{Ctrl up}
Okay that got the reject call option working, but the answer call option is not working at all. What I have now is:

Code: Select all

^<!F14::
    Sleep, 10
    Send, {esc}
return

<#<!F15::
    Sleep, 10
    Send, {Ctrl down}{'}{Ctrl up}
    Sleep, 10
    Send, {Ctrl down}{ENTER}{Ctrl up}
return
I found a thread where somone tried to rebind the same keys on this same computer to be page up and page down, so those codes should be correct for the media keys in question. Howeaver, while the first one works, the second one will exicute neither command... (first command should press control+' which will start a call in Discord, wait, then send control+enter to answer a call, that way the key does both... but it's not working for either option).
MeepTheChangeling
Posts: 6
Joined: 07 Jun 2019, 18:01

Re: Want to use AHK to bind laptop's "answer call" key to press control+enter to answer Discord calls

22 Apr 2021, 22:50

I figured it out. The button needs to be held down for about half a second to work. No idea why HP thought that was a good idea, but the script works perfectly fine now. Thank you!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: filipemb, Google [Bot], mikeyww and 385 guests