• You are not logged in.
  • Index
  • Technical
  • Colemak on Windows, Alt+Ctrl produces strange characters

    Colemak on Windows, Alt+Ctrl produces strange characters

    • Started by ezuk
    • 12 Replies:
    • Reputation: 0
    • Registered: 12-Jul-2008
    • Posts: 76

    Hi there,

    I have Colemak installed with the standard installer, Win8.

    Hitting Alt+Ctrl+M (for example) and then typing any letter results in something like this: ē -- meaning, the character is printed (I hit the letter e), but with a strange line above.

    This is maddening, especially when working with revisions in Word: Every comment I make starts with a strange character which I have to manually delete and re-type.

    Any idea what might be causing this, or how to fix?

    Last edited by ezuk (26-Nov-2012 10:29:12)
    Offline
    • 0
    • Reputation: 0
    • Registered: 12-Jul-2008
    • Posts: 76

    With a bit more research, I was able to formulate my question in more technical terms: Turns out that Alt+Ctrl actually simulates AltGr, a key I have absolutely no use for. How can I disable this "feature"?

    Offline
    • 0
    • Reputation: 1
    • From: Sofia, Bulgaria
    • Registered: 05-Mar-2011
    • Posts: 387

    Yes, AltGr is the same as Alt+Ctrl in many cases. If you want to disable this behaviour on the installed keyboard you can use MS Keyboard Layout Creator and edit the layout. From there you can remove the AltGr function and both Alt keys will act as Alt.

    But it's strange that Word doesn't disable the AltGr function of the layout when using Ctrl Alt shortcuts. Mine does. For example I've got ¹ on AltGr+1 and pressing Ctrl + Alt + 1 produces ¹ in most places but in Word it doesn't. Instead it changes the text to Heading – the default behaviour. Maybe it's the Office version? I'm using 2010.

    Last edited by pafkata90 (23-Nov-2012 18:58:37)
    Offline
    • 0
    • Reputation: 214
    • From: Viken, Norway
    • Registered: 13-Dec-2006
    • Posts: 5,364

    Hi Ezuk! ;)

    MSWord shortcuts will override whatever a key used to do I think.

    I thought it was only LCtrl+RAlt that produced AltGr? In which case mapping the RAlt as Alt might do the trick although I seem to remember that it won't: You can't set two physical keys to the same VKEY (each key must have a unique mapping) and ALT isn't really a workable VKEY mapping as much as a macro for (LALT || RALT) or something.

    Further reading:
    https://forum.colemak.com/viewtopic.php?id=394
    https://stackoverflow.com/questions/229 … to-alt-key
    https://blogs.msdn.com/b/michkap/archiv … 33168.aspx

    Last edited by DreymaR (23-Nov-2012 20:29:58)

    *** Learn Colemak in 2–5 steps with Tarmak! ***
    *** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

    Offline
    • 0
    • Reputation: 0
    • Registered: 12-Jul-2008
    • Posts: 76

    Hey DreymaR! :) I was hoping you'd reply.

    Basically, the problem is that my left alt + ctrl keys produce altGr (so, left Alt). Being a lefty, that's the key pair I tend to use for alt+ctrl shortcuts... I tried disabling it using the msklc (as per pafkata90's suggestion above), but that option is greyed out: I just can't!

    When I hit the left Alt key, this is what AutoHotkey reports back:

    A4  038         d    3.64    LAlt               
    A4  038         u    0.14    LAlt

    Right Alt key says this:

    A5  138         d    0.00    RAlt               
    A2  01D         u    0.11    LControl           
    A5  138         u    0.00    RAlt  

    Note the three lines of code produced by a single keystroke -- meaning, I get an "LControl u" event as well. I don't mind that so much because I don't use the right alt+ctrl -- but why do the _left_ ones act so strangely?

    Another interesting note: I tried remapping the right alt key using the SharpKeys utility, but when I press it SharpKeys simply doesn't recognize it! It's as if it's some exotic key it's never seen before and isn't on the list.

    Specifically, here's what SharpKeys have to say about my keys:

    LCtrl: "Left Ctrl (00_1D)"
    LAlt: Absolutely nothing. The dialog don't even change -- it's as if it doesn't register the keystroke at all (and that key does work for menus etc.)
    LCtrl+LAlt: "(E0_1F1D)"

    RCtrl: "Special: Right Ctrl (E0_1D)"
    RAlt: "(E0_2038)" -- it does recognize this one, oddly enough, but not as RAlt.
    RCtrl+RAlt: "(E0_601D)"

    And finally, LCtrl + RAlt: "(E0_2038)", just like RAlt on its own.

    In short, I'm totally confused. All of this is just using the stock Colemak layout installer from the site, Windows 8, EN_US, with MS Natural 4000.

    I tried the AHK options, and I'm pretty sure the registry remapping is what SharpKeys tries to do (and fails) -- right?

    Any other ideas?

    Thank you so much for your time and effort! You're a true pillar of the Colemak community. :)

    Last edited by ezuk (24-Nov-2012 13:02:28)
    Offline
    • 0
    • Reputation: 214
    • From: Viken, Norway
    • Registered: 13-Dec-2006
    • Posts: 5,364

    I think the reports are right:
    - 038 is shorthand for 00_38 which is the LAlt code
    - The right-hand variant of a key gets the E0_## prefix as it should, so E0_2038 is RAlt
    - I don't think SharpKeys reports everything from the input stream but AutoHotKey does.
    - Your LAlt key then, produces SC038 as it should
    - Your RAlt key produces SC138 as it should but it automatically becomes LCtrl+RAlt which is the same as AltGr

    Are you saying that this only happens with the Colemak installer layout? If you switch to another AltGr-using layout (UK for instance), what reports and behavior do you get from AHK and Sharpkeys then?

    Last edited by DreymaR (24-Nov-2012 19:07:14)

    *** Learn Colemak in 2–5 steps with Tarmak! ***
    *** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

    Offline
    • 0
    • Reputation: 0
    • Registered: 12-Jul-2008
    • Posts: 76

    No, it definitely happens on some other layouts too, but for example in the built-in QWERTY (EN_US) layout, it doesn't happen at all...

    Any ideas?

    Offline
    • 0
    • Reputation: 214
    • From: Viken, Norway
    • Registered: 13-Dec-2006
    • Posts: 5,364

    Well, the built-in EN_US layout doesn't have an AltGr key. So this isn't a Colemak installer problem as such but a compliance problem for you with layouts that use AltGr in general...

    Okay, if you're up to it then use MS KLC to save a .klc file copy of the EN_US layout as well as the Colemak (iirc it's "Open Existing Layout" you're after). Then you can figure out how to turn off the AltGr key for the Colemak and save/recompile that. Voila, one stunted Colemak for you! Alternatively, just move around the keys on the EN_US layout and save/compile that. Don't move the SC values but do move the VK_ names of the keys!

    (You can't remap the CapsLock key in the MSKLC Graphical User Interface. That'd require hacking the files directly.)

    Myself, I use PKL for Windows stuff these days.

    Last edited by DreymaR (26-Nov-2012 01:47:31)

    *** Learn Colemak in 2–5 steps with Tarmak! ***
    *** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

    Offline
    • 0
    • Reputation: 0
    • Registered: 12-Jul-2008
    • Posts: 76

    As suggested, I went ahead and edited the US English layout. It passes validation, but MSKLC won't let me build a setup package for some reason. I am going to try installing MSKLC in a Windows 7 VM and try to build the package there.

    For anyone who may need it in the future, following is the source file I produced. This isn't tested yet.

    KBD    CmkAltGr    "Colemak Without AltGr"
    
    COPYRIGHT    "(c) 2012 Company"
    
    COMPANY    "Company"
    
    LOCALENAME    "en-US"
    
    LOCALEID    "00000409"
    
    VERSION    1.0
    
    SHIFTSTATE
    
    0    //Column 4
    1    //Column 5 : Shft
    2    //Column 6 :       Ctrl
    
    LAYOUT        ;an extra '@' at the end is a dead key
    
    //SC    VK_        Cap    0    1    2
    //--    ----        ----    ----    ----    ----
    
    02    1        0    1    0021    -1        // DIGIT ONE, EXCLAMATION MARK, <none>
    03    2        0    2    0040    -1        // DIGIT TWO, COMMERCIAL AT, <none>
    04    3        0    3    0023    -1        // DIGIT THREE, NUMBER SIGN, <none>
    05    4        0    4    0024    -1        // DIGIT FOUR, DOLLAR SIGN, <none>
    06    5        0    5    0025    -1        // DIGIT FIVE, PERCENT SIGN, <none>
    07    6        0    6    005e    -1        // DIGIT SIX, CIRCUMFLEX ACCENT, <none>
    08    7        0    7    0026    -1        // DIGIT SEVEN, AMPERSAND, <none>
    09    8        0    8    002a    -1        // DIGIT EIGHT, ASTERISK, <none>
    0a    9        0    9    0028    -1        // DIGIT NINE, LEFT PARENTHESIS, <none>
    0b    0        0    0    0029    -1        // DIGIT ZERO, RIGHT PARENTHESIS, <none>
    0c    OEM_MINUS    0    002d    005f    -1        // HYPHEN-MINUS, LOW LINE, <none>
    0d    OEM_PLUS    0    003d    002b    -1        // EQUALS SIGN, PLUS SIGN, <none>
    10    Q        1    q    Q    -1        // LATIN SMALL LETTER Q, LATIN CAPITAL LETTER Q, <none>
    11    W        1    w    W    -1        // LATIN SMALL LETTER W, LATIN CAPITAL LETTER W, <none>
    12    E        1    f    F    -1        // LATIN SMALL LETTER F, LATIN CAPITAL LETTER F, <none>
    13    R        1    p    P    -1        // LATIN SMALL LETTER P, LATIN CAPITAL LETTER P, <none>
    14    T        1    g    G    -1        // LATIN SMALL LETTER G, LATIN CAPITAL LETTER G, <none>
    15    Y        1    j    J    -1        // LATIN SMALL LETTER J, LATIN CAPITAL LETTER J, <none>
    16    U        1    l    L    -1        // LATIN SMALL LETTER L, LATIN CAPITAL LETTER L, <none>
    17    I        1    u    U    -1        // LATIN SMALL LETTER U, LATIN CAPITAL LETTER U, <none>
    18    O        1    y    Y    -1        // LATIN SMALL LETTER Y, LATIN CAPITAL LETTER Y, <none>
    19    P        0    003b    003a    -1        // SEMICOLON, COLON, <none>
    1a    OEM_4        0    005b    007b    001b        // LEFT SQUARE BRACKET, LEFT CURLY BRACKET, ESCAPE
    1b    OEM_6        0    005d    007d    001d        // RIGHT SQUARE BRACKET, RIGHT CURLY BRACKET, INFORMATION SEPARATOR THREE
    1e    A        1    a    A    -1        // LATIN SMALL LETTER A, LATIN CAPITAL LETTER A, <none>
    1f    S        1    r    R    -1        // LATIN SMALL LETTER R, LATIN CAPITAL LETTER R, <none>
    20    D        1    s    S    -1        // LATIN SMALL LETTER S, LATIN CAPITAL LETTER S, <none>
    21    F        1    t    T    -1        // LATIN SMALL LETTER T, LATIN CAPITAL LETTER T, <none>
    22    G        1    d    D    -1        // LATIN SMALL LETTER D, LATIN CAPITAL LETTER D, <none>
    23    H        1    h    H    -1        // LATIN SMALL LETTER H, LATIN CAPITAL LETTER H, <none>
    24    J        1    n    N    -1        // LATIN SMALL LETTER N, LATIN CAPITAL LETTER N, <none>
    25    K        1    e    E    -1        // LATIN SMALL LETTER E, LATIN CAPITAL LETTER E, <none>
    26    L        1    i    I    -1        // LATIN SMALL LETTER I, LATIN CAPITAL LETTER I, <none>
    27    OEM_1        1    o    O    -1        // LATIN SMALL LETTER O, LATIN CAPITAL LETTER O, <none>
    28    OEM_7        0    0027    0022    -1        // APOSTROPHE, QUOTATION MARK, <none>
    29    OEM_3        0    0060    007e    -1        // GRAVE ACCENT, TILDE, <none>
    2b    OEM_5        0    005c    007c    001c        // REVERSE SOLIDUS, VERTICAL LINE, INFORMATION SEPARATOR FOUR
    2c    Z        1    z    Z    -1        // LATIN SMALL LETTER Z, LATIN CAPITAL LETTER Z, <none>
    2d    X        1    x    X    -1        // LATIN SMALL LETTER X, LATIN CAPITAL LETTER X, <none>
    2e    C        1    c    C    -1        // LATIN SMALL LETTER C, LATIN CAPITAL LETTER C, <none>
    2f    V        1    v    V    -1        // LATIN SMALL LETTER V, LATIN CAPITAL LETTER V, <none>
    30    B        1    b    B    -1        // LATIN SMALL LETTER B, LATIN CAPITAL LETTER B, <none>
    31    N        1    k    K    -1        // LATIN SMALL LETTER K, LATIN CAPITAL LETTER K, <none>
    32    M        1    m    M    -1        // LATIN SMALL LETTER M, LATIN CAPITAL LETTER M, <none>
    33    OEM_COMMA    0    002c    003c    -1        // COMMA, LESS-THAN SIGN, <none>
    34    OEM_PERIOD    0    002e    003e    -1        // FULL STOP, GREATER-THAN SIGN, <none>
    35    OEM_2        0    002f    003f    -1        // SOLIDUS, QUESTION MARK, <none>
    39    SPACE        0    0020    0020    0020        // SPACE, SPACE, SPACE
    56    OEM_102    0    005c    007c    001c        // REVERSE SOLIDUS, VERTICAL LINE, INFORMATION SEPARATOR FOUR
    53    DECIMAL    0    002e    002e    -1        // FULL STOP, FULL STOP, 
    
    
    KEYNAME
    
    01    Esc
    0e    Backspace
    0f    Tab
    1c    Enter
    1d    Ctrl
    2a    Shift
    36    "Right Shift"
    37    "Num *"
    38    Alt
    39    Space
    3a    "Caps Lock"
    3b    F1
    3c    F2
    3d    F3
    3e    F4
    3f    F5
    40    F6
    41    F7
    42    F8
    43    F9
    44    F10
    45    Pause
    46    "Scroll Lock"
    47    "Num 7"
    48    "Num 8"
    49    "Num 9"
    4a    "Num -"
    4b    "Num 4"
    4c    "Num 5"
    4d    "Num 6"
    4e    "Num +"
    4f    "Num 1"
    50    "Num 2"
    51    "Num 3"
    52    "Num 0"
    53    "Num Del"
    54    "Sys Req"
    57    F11
    58    F12
    7c    F13
    7d    F14
    7e    F15
    7f    F16
    80    F17
    81    F18
    82    F19
    83    F20
    84    F21
    85    F22
    86    F23
    87    F24
    
    KEYNAME_EXT
    
    1c    "Num Enter"
    1d    "Right Ctrl"
    35    "Num /"
    37    "Prnt Scrn"
    38    "Right Alt"
    45    "Num Lock"
    46    Break
    47    Home
    48    Up
    49    "Page Up"
    4b    Left
    4d    Right
    4f    End
    50    Down
    51    "Page Down"
    52    Insert
    53    Delete
    54    <00>
    56    Help
    5b    "Left Windows"
    5c    "Right Windows"
    5d    Application
    
    DESCRIPTIONS
    
    0409    Colemak Without AltGr
    LANGUAGENAMES
    
    0409    English (United States)
    ENDKBD

    Edit: This layout is actually really bad, because for some reason, all Ctrl keystrokes still send their QWERTY equivalents. Rolling back to stock Colemak now -- it's AltGr issue is a pain, but at least Ctrl works! Any advice?

    Last edited by ezuk (26-Nov-2012 10:44:49)
    Offline
    • 0
    • Reputation: 0
    • Registered: 12-Jul-2008
    • Posts: 76
    DreymaR said:

    (You can't remap the CapsLock key in the MSKLC Graphical User Interface. That'd require hacking the files directly.)

    Actually, while I'm at this whole layout editing binge, I might as well get this bit done too. Care to show me what to change in my layout file pasted above?

    Thanks in advance!

    -e

    Offline
    • 0
    • Reputation: 0
    • Registered: 12-Jul-2008
    • Posts: 76

    Further developments: After my attempted layout mess, I decided to try using the registry remapping solution and hard-map my keys to Colemak. That actually worked really well, and gave me what I wanted.

    Had to create a manually remapped layout for Hebrew in MSKLC to adapt to this. Posting it in another thread.

    Last edited by ezuk (26-Nov-2012 12:40:37)
    Offline
    • 0
    • Reputation: 214
    • From: Viken, Norway
    • Registered: 13-Dec-2006
    • Posts: 5,364
    DreymaR said:

    Don't move the SC values but do move the VK_ names of the keys!

    You didn't change the VK values like I told you to, that's why your shortcuts are messed up. You don't want QWERTY etc downwards in the second column, but QWFPG etc. Sorry if I wasn't clear enough on that point.

    *** Learn Colemak in 2–5 steps with Tarmak! ***
    *** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

    Offline
    • 0
    • Reputation: 0
    • Registered: 12-Jul-2008
    • Posts: 76

    ... That's what happens when I don't read. Gah. You were super-clear, it's my bad of course. Still, this whole convoluted registry remapping/new Hebrew layout I spent all morning doing seems to be working out so far, so I'll let sleeping dogs lie for now. Thanks again.

    Offline
    • 0
      • Index
      • Technical
      • Colemak on Windows, Alt+Ctrl produces strange characters