• You are not logged in.

    Per Application layout settings

    • Started by droberts
    • 3 Replies:
    • Reputation: 0
    • Registered: 03-Sep-2008
    • Posts: 1

    Is there a program out there that will remember which applications I want to start in Colemak or QWERTY?

    Offline
    • 0
    • Reputation: 0
    • Registered: 08-Mar-2008
    • Posts: 303

    Not that I know of.

    (I'm only responding so you don't feel ignored. I hate it when that happens to me.)

    Offline
    • 0
    • Reputation: 0
    • From: NYC
    • Registered: 02-Feb-2007
    • Posts: 104

    I don't know of any, but wouldn't it be easier if you control when you want to type in the preferred layout? All it takes is just one keyboard shortcut to switch back and forth.

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

    It shouldn't be impossible to hack a script for that. Not that I have the time nor inclination for it unfortunately, but one could use AutoIt or AutoHotkey in Windows, and similar languages for the other systems - if one doesn't know one of the "real" languages, that is. Just takes a resident loop that checks the active window. Quick-and-dirty way would be having it send hotkeys set in the Control Panel.

    Okay, I may have a quick stab at an AutoHotKey script stub:

    ;
    ; AutoHotkey Version: 1.0.47.06
    ; Language:       English
    ; Platform:       Win9x/NT
    ; Author:         DreymaR, 0808
    ;
    ; AHK script stub for setting keyboard layout per application
    ; Warning: If any applications use Ctrl-Shift-# hotkeys, they may override the Windows ones causing this to fail.
    ;
    
    #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
    SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
    #SingleInstance force
    #Persistent
    
    SetTimer, CheckLayout, 500    ; Less to make it more responsive; more to refrain from spamming key presses
    
    return
    
    CheckLayout:
    If WinActive("ahk_class Notepad") {
      Send {^+2}    ; Set this hotkey in the Language panel
    } Else {
      Send {^+1}
    }
    return
    
    ^#r::Reload
    ^#p::Pause

    Disclaimer: I did NOT try that out, and I'm having to break off now - but there you have it.  ;)

    [edit: Okay, I tried that out and it's tricky. However, there are better ways involving the Windows API LoadKeyboardLayout and it's already been done. See https://www.donationcoder.com/Forums/bb … 1#msg75651 and download the ahk script or .exe file there - enjoy!]

    [edit2: In case you're wondering how to use that neat little script, here's how:

    - Run it once; it'll generate an .ini file
    - If you're using a non-standard locale (like Colemak!) use RegEdit (from the Run... menu) to have a gander at the HKEY_CURRENT_USER\Keyboard Layout\Preload keys. If you have a bunch of layouts, temporarily unload some to see clearer.
    - The value from that key should go in your autoswitch.ini file's DefaultLang key, and the other layout in the second one.
    - I think the best way of specifying apps is by ahk_class: If you have AutoHotkey installed (it's free and fun!) you'll have a Window Spy app that you can have running while a program's window is up. It'll show you info about the active window.
    - Hence, a sample MonitorList value in the .ini could be 'ahk_class WordPadClass|ahk_class Notepad' (pipe separated list).

    Hope that makes it clearer for anyone interested! It's good to know that this functionality is available.]

    Last edited by DreymaR (07-Sep-2008 07:47:37)

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

    Offline
    • 0