What's the function of the Alt Gr key?

28

6

I read somewhere that the Alt Gr key found on some layouts is a substitute for Ctrl + Alt.

However, what can this combination be used for? Are there any documented shortcuts using Ctrl + Alt?

Sparx

Posted 2010-12-09T09:57:45.673

Reputation: 1 667

3Ctrl + Alt + Delete – Joe Taylor – 2010-12-09T12:41:14.847

Answers

27

IBM named this key "alternate graphic" and it's not a substitute for CTRL + ALT, though CTRL + ALT was implemented as a substitute for ALT GR in Windows. It is a key modifier (like CTRL or SHIFT) that enables a different input than is normally expected of a key.

Depending on your keyboard and location setup, it can be used to produce characters with diacritical marks when used in conjunction with alphabetic keys (most often vowels), and the third symbol that is printed on some keys, for example, € (ALT GR + 4) or ¦ (ALT GR + `) that appear on my UK keyboard. Continental European keyboards generally have many more keys with extra symbols printed on them which correspond letters with the various types of diacritical marks used in those languages.

See AltGr key for more information.

James

Posted 2010-12-09T09:57:45.673

Reputation: 1 171

@JürgenA.Erhard: I thought the same too. – Alex Essilfie – 2015-01-28T20:56:23.177

3Nice pointing out that Alt Gr is implemented as Ctrl+Alt but Ctrl+Alt does not map to Alt Gr. – Alex Essilfie – 2015-01-28T21:09:12.993

In India, in some designated keyboards, the key Alt Gr + 4 gives the Indian currency symbol (₹) – Code Poet – 2016-07-29T16:34:09.220

I always thought it stood for Alt Green, as I remember the key was printed with green letters on the IBM PC/AT keyboard, but just saying Alt. It's strange that the Wikipedia article does not even mention that. – paradroid – 2010-12-09T14:20:21.273

1I, for a long time, thought it meant "Alt German"... – Jürgen A. Erhard – 2010-12-09T15:23:08.373

9

For some keyboards, it allows some alternate combinations. In some keyboards it allows the cent symbol or the euro symbol - Wikipedia has a pretty comprehensive list of combinations using Alt Gr.

However using a US/Windows keymap, it doesn't do anything in most cases.

Journeyman Geek

Posted 2010-12-09T09:57:45.673

Reputation: 119 122

Even some US layouts have a <€> somewhere on them (on <5> in my case). – Ignacio Vazquez-Abrams – 2010-12-09T11:48:42.923

mine is a british keyboard set to american ;p. it has the euro symbol on the 4 if it were on british keysets – Journeyman Geek – 2010-12-09T16:12:09.047

4

Also, handy for people with accessibility needs who have to do a Ctrl+alt+del. You try it one-handed.

Bonus

Posted 2010-12-09T09:57:45.673

Reputation: 1 192

I doubt that works? – Arjan – 2010-12-09T15:12:14.190

@Arjan It doesn't work. – AndrejaKo – 2010-12-09T15:19:41.507

1Does on every keyboard I've used. Maybe it's a UK-keymap thing. – Bonus – 2010-12-09T15:22:38.530

@Bonus Never worked for me on any keyboard I used, even on UK keymap. Maybe there's some not so obvious setting that controls that? – AndrejaKo – 2010-12-09T15:24:18.463

Wouldn't that defeat the purpose of the secure attention key if this was enabled without any specific setting, like @Andreja wonders about?

– Arjan – 2010-12-09T16:17:15.847

1@Arjan Maybe some keyboards produce different scancode for AltGr? Could it be that of some keyboards AltGr is actually configured to behave as ctrl+alt? – AndrejaKo – 2010-12-09T16:48:01.387

2The C+A+D sequence is handled at a much lower level than the AltGr to Ctrl+Alt conversion (at least on Windows and Linux), so they are not going to work exactly the same. (Except perhaps in the case of a keyboard sending Ctrl+Alt scancodes.) – user1686 – 2010-12-09T19:20:01.777

4

Alt gr is necessary for some languages like Polish:

Alt Gr + a = ą

Alt Gr + s = ś

Alt Gr + shift + n = Ń

Antyradek

Posted 2010-12-09T09:57:45.673

Reputation: 41

Such keyboard layout can lead to interesting bugs and issues. Read The curious case of the disappearing Polish S.

– Kamil Maciorowski – 2017-07-03T09:19:38.640

1

I am pretty sure it is implemented like this.

You can test the vkCode from the KBDLLHOOKSTRUCT to see what you get.

Mapped enum list from here, here, and www.pinvoke.net/default.aspx/Constants/WM.html

It should be equivalent to this:

using System.Windows.Forms;

isAltGr ? (Keys) (1 << 19) : Keys.None

private static Keys BuildKeyData(Keys virtualKeyCode) => virtualKeyCode | (IsDownControl ? Keys.Control : Keys.None) | (IsDownShift ? Keys.Shift : Keys.None) | (IsDownAlt ? Keys.Alt : Keys.None) | (IsAltGr ? (Keys) (1 << 19) : Keys.None);
private static bool IsDownControl => IsKeyPressed((ushort)VirtualKeys.LeftControl) || IsKeyPressed((ushort)VirtualKeys.RightControl);
private static bool IsDownShift => IsKeyPressed((ushort)VirtualKeys.LeftShift) || IsKeyPressed((ushort)VirtualKeys.RightShift);
private static bool IsDownAlt => IsKeyPressed((ushort)VirtualKeys.LeftMenu) || IsKeyPressed((ushort)VirtualKeys.RightMenu) || IsKeyPressed((ushort)VirtualKeys.Menu);
private static bool IsAltGr => IsDownControl && IsDownAlt;

Latency

Posted 2010-12-09T09:57:45.673

Reputation: 11

0

Important Alt+Gr key combinations on a default German keyboard are:

  • @ ... AltGr + Q (if you press the same keys on a OS X keyboard, the application will be closed)
  • € ... AltGr + E
  • { ... AltGr + 7
  • [ ... AltGr + 8
  • ] ... AltGr + 9
  • } ... AltGr + 0
  • \ ... AltGr + ß
  • ~ ... AltGr + +
  • | ... AltGr + <
  • µ ... AltGr + M

Mike L.

Posted 2010-12-09T09:57:45.673

Reputation: 4 539