How to make Alt Gr into a hot key and also as a modifier?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Garmzar
Posts: 1
Joined: 16 Aug 2018, 18:26

How to make Alt Gr into a hot key and also as a modifier?

16 Aug 2018, 18:40

Could you guys help me with this please

I want Alt Gr to work as a hotkey like this:
LControl & RAlt::MsgBox You pressed AltGr itself.

But I also want Alt Gr plus another hotkey to work like this:
<^>!m::MsgBox You pressed AltGr+m.

Each of these syntaxes works fine on their own but if I type both of them into my auto hotkey file and press run. Only the "LControl & RAlt::MsgBox You pressed AltGr itself." works
why?
Is there any way to work around this?

I appreciate all help!
Rohwedder
Posts: 7630
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: How to make Alt Gr into a hot key and also as a modifier?

17 Aug 2018, 01:41

Hallo,
try:

Code: Select all

~<^RAlt::
KeyWait, RAlt
IF A_ThisHotkey = ~<^RAlt
	MsgBox You pressed AltGr itself.
Return
<^>!m::MsgBox You pressed AltGr+m.
GEV
Posts: 1002
Joined: 25 Feb 2014, 00:50

Re: How to make Alt Gr into a hot key and also as a modifier?

17 Aug 2018, 01:47

Code: Select all

LControl & RAlt:: AltGr := true

LControl & RAlt Up::
	If (A_PriorKey = "RAlt")
		MsgBox You pressed AltGr itself
	AltGr := false
return

#If (AltGr)

	m:: MsgBox You pressed AltGr+m.
	m & n:: MsgBox You pressed AltGr+m+n.

#If
Guest

Re: How to make Alt Gr into a hot key and also as a modifier?

22 Aug 2018, 10:32

Rohwedder wrote:Hallo,
try:

Code: Select all

~<^RAlt::
KeyWait, RAlt
IF A_ThisHotkey = ~<^RAlt
	MsgBox You pressed AltGr itself.
Return
<^>!m::MsgBox You pressed AltGr+m.
It worked perfectly! Thanks alot

Also big thanks to you GEV for the help

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 242 guests