Simple Hotkey question ?

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
User avatar
yfjuu6
Posts: 125
Joined: 28 Apr 2023, 15:28

Simple Hotkey question ?

01 Apr 2024, 08:06

I want when pressing AltGr only {
MsgBox("AltGr only")
}
when pressing AltGr + RButton {
MsgBox("<^>!RButton")
}
I tried this :

Code: Select all

~*LCtrl Up:: {
    if A_PriorKey = "RAlt" {
        MsgBox("AltGr only")
    }
}
<^>!RButton:: {
    MsgBox("<^>!RButton")
}
The problem is when I press <^>!RButton the MsgBox("<^>!RButton") appears then MsgBox("AltGr only") also appears.
I want when pressing <^>!RButton the MsgBox("<^>!RButton") only appears
Any help to do so Please!
User avatar
mikeyww
Posts: 27314
Joined: 09 Sep 2014, 18:38

Re: Simple Hotkey question ?

01 Apr 2024, 08:42

Code: Select all

#Requires AutoHotkey v2.0
RB := False

~*LCtrl Up:: {
 If A_PriorKey = 'RAlt' && !RB
  MsgBox 'AltGr only'
 Global RB := False
}

<^>!*RButton Up:: {
 Global RB := True
 MsgBox '<^>!RButton', 'Status', 'T1.5'
}
ntepa
Posts: 438
Joined: 19 Oct 2022, 20:52

Re: Simple Hotkey question ?

01 Apr 2024, 23:08

Code: Select all

#Requires AutoHotkey v2.0

~<^RAlt::{
    KeyWait "LCtrl"
    if A_ThisHotkey = ThisHotkey {
        MsgBox("AltGr only")
    }
}

<^>!RButton::{
    MsgBox("<^>!RButton")
}

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: linkun, mcl, william_ahk and 24 guests