Reputation: 9273
I have some mappings that uses Alt key on Windows XP. While they work fine with the left Alt, they doesn't with the right Alt key.
For example, the following mapping does nothing when I press right_Alt+b, while it display a message box when left_Alt+b is pressed.
!b::MsgBox You pressed Alt+b.
I'd like to have both Alt keys to work the same way and trigger the mapping above.
The mapping below does works with right Alt key, but doesn't works with left Alt key:
<^>!b::MsgBox You pressed right Alt+b.
One workaround would be duplicate all mappings that contains the alt key, but that would significantly increase the size of some scripts. Besides, I found that in some cases it doesn't works. Further investigation showed that the right alt key has a strange behavior. In a script containing only the following mapping,
^!b::MsgBox You pressed Ctrl+Alt+b.
, the message box is displayed when right_Alt+b is pressed.
I've tried to map right Alt to left Alt,
<^>!::!
or
<^>!::Send {ALT}
, but it didn't solve the problem.
Upvotes: 1
Views: 2008
Reputation: 7953
I write this comment as an answer because of the better formatting options.
Here is the script I used in AutoHotKey_L (1.1.09.01), should work the same in regular AutoHotKey.:
RAlt::LAlt
<^>!b::MsgBox, A You pressed right Alt+b.
^!b::MsgBox, B You pressed Ctrl+Alt+b.
Test 1: pressed Ctrl+LAlt+b. Result: MsgBox B, normal behaviour
Test 2: pressed Ctrl+RAlt+b. Result: MsgBox B, expected due to the re-mapping
Commented the ;^!b::MsgBox, B...
out and tested again.
Test 3: pressed Ctrl+RAlt+b. Result: Nothing, as expected
Commented ;RAlt::LAlt
out and tested again:
Test 4: pressed Ctrl+RAlt+b. Result: MsgBox A, expected since no more re-mapping.
Last but not least. There is NO difference in behaviour if I press Ctrl+RAlt+b or RAlt+Ctrl+b. One more note: I always used the LEFT Ctrl key, not the RIGHT Ctrl key.
Are you NOT getting these results?
Or are you expecting different results when you make RAlt equal to LAlt?
Upvotes: 0
Reputation: 7953
You mention that you tried to map the Right-Alt to Left-Alt, but not HOW you did this. Anyway, when I use this:
RAlt::LAlt
MsgBox You pressed Alt+b. is executed when I press Right-Alt+b AND Left-Alt+b. Can you tell how you tried to map the two Alt keys?
Upvotes: 3