APL Keyboard Switching

Recently I’ve been learning a language called APL (A programming language)* and one thing that annoys me is, because APL requires a specific keyboard layout, you have to change between the APL layout and the English layout when switching between pieces of software.

To ease this burden some of the software will automatically switch the keyboard layouts however in some scenarios you may require the APL symbols in software such as Microsoft Office Word.

Word will automatically change your keyboard layout to UK or US English** meaning you will then have to manually navigate to the languages section and again change your keyboard layout.

After doing this many many times while writing documentation notes for myself I decided to write a quick solution.

For this program I used C# and only a small piece of code is needed to change the input language assuming System.Globalization is included:

InputLanguage.CurrentInputLanguage = InputLanguage;

To find the required IME and implement it I used the following code:


foreach (InputLanguage lang in InputLanguage.InstalledInputLanguages)
{
    if (lang.LayoutName == "Dyalog APL IME (en-GB)")
    {
        InputLanguage.CurrentInputLanguage = lang;
    }
}

This small piece of code cycles through all your installed languages and finds the one entitled “Dyalog APL IME (en-GB)”, then it sets your current language to the one it found.

For my program I used listboxes to allow the selection of different keyboard layouts and I also added docking buttons to allow the form to sit comfortably in any corner of the screen,

You can download my program as a small executable from the following link: http://www.mediafire.com/download/35ku6ea39f9pyaq/KeyboardSwitcher.exe

Thanks for reading if you have any questions comment them and I’ll try and respond as quickly as I can,

Callum (flouc001)

* No I’m not joking that’s actually the name of it

** Country / Default language specific

Advertisements