public MainProgram() { replacementMap = new Dictionary <char, char>() { { 'c', 'ĉ' }, { 'C', 'Ĉ' }, { 'g', 'ĝ' }, { 'G', 'Ĝ' }, { 'j', 'ĵ' }, { 'J', 'Ĵ' }, { 's', 'ŝ' }, { 'S', 'Ŝ' }, { 'u', 'ŭ' }, { 'U', 'Ŭ' }, { 'h', 'ĥ' }, { 'H', 'Ĥ' } }; onIcon = new System.Drawing.Icon("greenstar2.ico"); offIcon = new System.Drawing.Icon("graystar.ico"); cm = new ContextMenu(); cm.MenuItems.Add("Malŝalti", new EventHandler(Toggle_OnClick)); cm.MenuItems.Add("Fermi", new EventHandler(Close_onClick)); ni = new NotifyIcon(); ni.Icon = onIcon; ni.ContextMenu = cm; ni.Text = "Esperanta Klavaro"; ni.Visible = true; KeyboardHook.Modifiers modifiers = KeyboardHook.Modifiers.MOD_CONTROL; Keys k = Keys.Space; kbHook = new KeyboardHook(modifiers, k); kbHook.KeyPressed += new KeyPressEventHandler(KeyPressHandler); kbHook.HotKeyPressed += new EventHandler(Toggle_OnClick); }
public WindowsMessageListener(KeyboardHook kbHook) { this.kbHook = kbHook; }