Mouse+Keyboard combination key

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
decara19
Posts: 3
Joined: 16 Jan 2022, 22:17

Mouse+Keyboard combination key

Post by decara19 » 16 Jan 2022, 22:36

Newbie here. I do have a problem regarding on making a mouse+keyboard combination key. lately, I messed up my right click because of my script because I'm trying to combine these keys RButton & Letter(S). I don't have any programming or scripting background for this. I need your help.
Last edited by gregster on 16 Jan 2022, 22:44, edited 1 time in total.
Reason: Topic moved from 'Forum Issues'.

Rohwedder
Posts: 7645
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Mouse+Keyboard combination key

Post by Rohwedder » 17 Jan 2022, 03:17

Hallo,
try:

Code: Select all

RButton & s::ComObjCreate("SAPI.SpVoice").Speak(A_ThisHotkey)
RButton Up::Click,% (A_PriorKey = "RButton")?"Right":0

decara19
Posts: 3
Joined: 16 Jan 2022, 22:17

Re: Mouse+Keyboard combination key

Post by decara19 » 17 Jan 2022, 20:59

Thank you, sir! btw, what if I want to have a key trigger for that combination key? like I'd want to press letter V to toggle that combo key. What changes should I do for this script?

Rohwedder
Posts: 7645
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Mouse+Keyboard combination key

Post by Rohwedder » 18 Jan 2022, 03:49

Always these meaning riddles!
Do you want to switch the combination Hotkey RButton & s:: off/on with the Hotkey v::?
Then:

Code: Select all

v::Hotkey, RButton & s,% RBS:=!RBS?"Off":"On"
RButton & s::ComObjCreate("SAPI.SpVoice").Speak(A_ThisHotkey)
RButton Up::Click,% (A_PriorKey = "RButton")?"Right":0

decara19
Posts: 3
Joined: 16 Jan 2022, 22:17

Re: Mouse+Keyboard combination key

Post by decara19 » 18 Jan 2022, 04:14

I see… Thank you sir!

Post Reply

Return to “Ask for Help (v1)”