Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Many applications like Google Docs use Ctrl+Alt shortcuts like Ctrl+Alt+2 for heading 2, Ctrl+Alt+m for comments etc. However, in case of international keyboards' layouts, Ctrl+Alt is mapped to AltGr, so many of these shortcuts produce special characters instead, e.g. Ctrl+Alt+2 = @. Therefore these shortcuts can not be used.

Is there a way to disable this Ctrl+Alt = AltGr, such that AltGr+2 = @ but Ctrl+Alt+2 can be used as a shortcut?


There has been some earlier post with answers related to this problem:

Both solutions are however related to unassign the special character completely. These solutions do not disable the Ctrl+Alt = AltGr binding. This means, that in order to use Ctrl+Alt+2 as a shortcut, I am not able to write @ at all, which is naturally not an option.

share|improve this question
2  
Did you try AutoHotKey –  Dave May 8 '13 at 8:37

3 Answers 3

up vote 5 down vote accepted
+50

I have researched further and looked at the other answers. It seems like the short answer is: No! Windows treats Ctrl+Alt and AltGr identically.

But there is a hack. Essentially we do not let Windows handle AltGr key bindings and instead use a third party tool that knows the difference. We do this manually for every singe key.

This hack does not work with "dead keys" such as ~ or ^.

.

Part 1: Let AutoHotKey convert AltGr+Some Key to symbols
AutoHotKey can distinguish between AltGr and Ctrl+Alt. It can also transform keystrokes like AltGr+2 to a single symbol @, before Windows applies its keyboard layout.

  1. Download and install AutoHotKey
  2. Create a new script, i.e., a plain text file with the extension .ahk
  3. For each character you want to write with AltGr+BUTTON=CHAR, create a line like this:
    <^>!BUTTON::SendInput {raw}CHAR
    Example: AltGr+2=@ becomes <^>!2::SendInput {raw}@
  4. Save the script

If you want to test your script, you can create some arbitrary mapping like <^>!t::SendInput {raw}tttt. Double click the script to apply it and test if AltGr+t produces four t's when you type.

.

Part 2: Get windows out of the way:
We want to remove all assignments of AltGr+Any Key on they keyboard, so Windows never convert them into characters.

First we need to create a new keyboard layout.

  1. Download The Microsoft Keyboard Layout Creator. It is a simple tool that lets you modify your keyboard layout. (Download link)
  2. Open to tool and File -> Load Existing Keyboard and choose your keyboard layout.
  3. Select File -> Save source as and give it a new name.
  4. Tick the Alt+Ctrl (AltGr).
    You might want to select File -> Save as Image to make a note of the original assignments.
  5. Remove all assigned keys, by clicking them, deleting the symbol, and click OK
    Do not clear any dead keys! (The grey ones). Check for all modifiers i.e. AltGr, Ctrl, Alt, or none!
  6. Go to Projet -> Propertie and give it a decent name and description.
  7. Save it: File -> Save Source File so you can edit it later
  8. Export setup: Project -> Build DLL and Setup Package

Then we need to apply this new keyboard layout.

  1. Find the exported setup files in you Documents folder, and double click setup.exe. This will install your new keyboard layout.
  2. Open the input setting by going to Control Pannel -> Change keyboards and other input methods -> Change keybords
  3. Click Add select you own keyboard and make it default.
    Come back here and remove the standard keyboard, once your confident everything works well.

.

Part 3: Let AutoHotKey take over:
Now lets put everything into action:

  1. Make sure your new keyboard is selected in the language task bar, and AutoHotKey is not running minimized in the notification tray.
  2. Try to type your special characters. This should not work.
  3. Double click on you AutoHotKey script. So it launches
  4. Try to type special characters again. This should now work with AltGr only.
  5. To make sure the script is loaded when Windows starts, create a short-cut to it in the Start Menu\Programs\Startup folder

That's it! (ツ) You can share the keyboard layout setup files and the .ahk script, with other computers to skip most of the steps.


Other resources:
http://answers.microsoft.com/en-us/windows/forum/windows_7-desktop/replace-default-windows-keyboard-shortcut-behavior/0c5ff2a4-6bea-49a9-88bc-669049a1e107
http://office.microsoft.com/en-us/word-help/alt-gr-keys-HP005259063.aspx
http://blogs.msdn.com/b/oldnewthing/archive/2004/03/29/101121.aspx
http://www.autohotkey.com/board/topic/61625-how-to-avoid-that-ctrl-alt-altgr/

share|improve this answer
    
Another valuable resource is Michael Kaplan's blog. –  Piotr Dobrogost Sep 28 '13 at 19:58

I would recommend you to have a look at AutoHotKey. Its a free Tool and you can also change shortcut-effects very easy. Have a look at the Hotkey-Documentation at their website. It is really easy to understand and really easy to use. You can remap every key/shortcut.

share|improve this answer

I would recommend SharpKeys:

SharpKeys is a Registry hack that is used to make certain keys on a keyboard act like other keys. For example, if you accidentally hit Caps Lock often, you could use this utility to map Caps Lock to a Shift key or even turn it off completely. This official release includes support for up to 104 mappings, an extensive list of available keys, and a "Type Key" option to help when managing mappings.

I have not used it personally, but know someone who has used it in the past and is quite happy with it.

I am not sure, But maybe switching your keyboard layout to (English UK) might help. Here is a link on how.

share|improve this answer
    
Took a look at SharpKeys, but it only seems to map one key stroke to another and doesn't do combinations, so it is not helping :( Switching keyboard layout is not an option, since most symbols are in other locations - even the number of keys are different. But thanks for suggestions. –  Bittenus Sep 26 '13 at 8:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.