Ejemplo n.º 1
0
 public IOProcessor(KeyProcessor kpr)
 {
     SetKPR(kpr);
     bf = new Buffer();
     log = new Log();
     cfg = new Config("MyInput\\");
 }
Ejemplo n.º 2
0
 public Log()
 {
     Config cfg = new Config("MyInput\\");
     if (Convert.ToBoolean(cfg.Read("debug", "false")))
     {
         if (sw == null)
             sw = new StreamWriter("keylog.log");
     }
     else
     {
         if (sw != null)
             sw.Dispose();
         sw = null;
     }
 }
Ejemplo n.º 3
0
 private void HWPan_Load(object sender, EventArgs e)
 {
     this.Manager = new CoreInk.Manager();
     writingPad1.OnWrittenEvent += new eLibrary.WritingPad.OnWritten(OnWritten);
     cfg = new Config("MyInput\\");
     int x = (Screen.GetWorkingArea(this).Width / 2) - (this.Width / 2);
     int y = (Screen.GetWorkingArea(this).Height - this.Height);
     string left = cfg.Read("hwkx", x.ToString());
     string top = cfg.Read("hwky", y.ToString());
     this.Top = Convert.ToInt32(top);
     this.Left = Convert.ToInt32(left);
 }
Ejemplo n.º 4
0
 private void VKeyboard_Load(object sender, EventArgs e)
 {
     dkstate = "none";
     cfg = new Config("MyInput\\");
     int x = (Screen.GetWorkingArea(this).Width / 2) - (this.Width / 2);
     int y = (Screen.GetWorkingArea(this).Height - this.Height);
     string left = cfg.Read("vkx", x.ToString());
     string top = cfg.Read("vky", y.ToString());
     this.Top = Convert.ToInt32(top);
     this.Left = Convert.ToInt32(left);
 }
Ejemplo n.º 5
0
 private void cmdset_Tick(object sender, EventArgs e)
 {
     try
     {
         if (cfg == null)
             cfg = new Config("MyInput\\");
         string cmd = cfg.Read("command");
         if (cmd == "layout")
         {
             UpdateLayout(cfg.Read("layout"));
         }
         else if (cmd == "activation")
         {
             actv_Click(this, null);
         }
         else if (cmd == "script")
         {
             UpdateScript(cfg.Read("script"));
         }
         else if (cmd == "layout&script")
         {
             UpdateScript(cfg.Read("script"));
             UpdateLayout(cfg.Read("layout"));
         }
         else if (cmd == "layout&script&activate")
         {
             active = false;
             UpdateScript(cfg.Read("script"));
             UpdateLayout(cfg.Read("layout"));
             actv_Click(this, null);
         }
         cfg.Write("command", "");
     }
     catch (Exception ex)
     {
     }
 }
Ejemplo n.º 6
0
        private void Form1_Load(object sender, EventArgs e)
        {
            //MessageBox.Show("This version of MyInput Beta is for use by \r\nMyanmar Posts and Telecommunications\r\nfor demonstration purpose at ICT Week.\r\nAll other rights reserved.\r\nCopyright 2000-2010\r\nTechnomation Studios.");
            //UserInterface.Glass.ExtendGlassIntoClientArea(this, 0, 0, Width, Height);
            kp = new KeyProcessor("NULL");
            iop = new IOProcessor(kp);
            iop.SetMainHandle(this);
            imp = new IMEProcessor(kime, this, iop);
            //kl = new KeyboardLayout("NULL");
            dkstate = "none";
            cfg = new Config("MyInput\\");
            //cfg.Write("embed-crypt", EmbeddingControl.createPublicKey("589114946"));
            int xxx = Screen.GetWorkingArea(this).Width - this.Width + 1;
            int yyy = Screen.GetWorkingArea(this).Height - this.Height;
            string left = cfg.Read("mfx", xxx.ToString());
            string percent = cfg.Read("ypercent", Pixel2Percent(yyy, Screen.GetWorkingArea(this).Height).ToString());
            this.Top = Percent2Pixel(Convert.ToDouble(percent), Screen.GetWorkingArea(this).Height);
            this.Left = Convert.ToInt32(left);
            togglekey = Convert.ToInt32(cfg.Read("toggle", "119"));
            scrkey = Convert.ToInt32(cfg.Read("scriptshortcut", "122"));
            osk = Convert.ToInt32(cfg.Read("osk", "121"));
            enableenable = Convert.ToBoolean(cfg.Read("enableenable", "true"));
            toggleenable = Convert.ToBoolean(cfg.Read("toggleenable", "true"));
            screnable = Convert.ToBoolean(cfg.Read("screnable", "true"));
            autohide = Convert.ToBoolean(cfg.Read("autoshow", "true"));
            oskenable = Convert.ToBoolean(cfg.Read("oskenable", "true"));
            virtualize = Convert.ToBoolean(cfg.Read("virtualize", "true"));
            Layouts = new ArrayList();
            Scripts = new ArrayList();
            string[] s = System.IO.Directory.GetFiles("Layouts\\");
            foreach (string x in s)
            {
                if (x.EndsWith(".keylayout"))
                {
                    string ss = Directory.GetCurrentDirectory() + "\\" + x;
                    KeyboardLayout kl = new KeyboardLayout(ss);
                    if (kl.getname() != null)
                    {
                        Layout l = new Layout();
                        l.name = kl.getname();
                        l.isIME = false;
                        l.scripts = kl.getScripts();
                        Layouts.Add(l);
                    }
                    kl = null;
                }
                else if (x.EndsWith(".dll"))
                {
                    Layout l = new Layout();
                    l.name = x.Substring(x.LastIndexOf("\\") + 1);
                    l.name = l.name.Substring(0, l.name.IndexOf("."));
                    l.isIME = true;
                    l.scripts = null;
                    Layouts.Add(l);
                }
            }
            s = System.IO.Directory.GetFiles("Scripts\\");
            foreach (string x in s)
            {
                string ss = Directory.GetCurrentDirectory() + "\\" + x;
                if (ss.EndsWith(".ikl"))
                {
                    ss = ss.Substring(ss.LastIndexOf("\\") + 1);
                    ss = ss.Substring(0, ss.Length - 4);
                    if (!ScriptExists(ss))
                    {
                        Scripts.Add(ss);
                    }
                }
                else if (ss.EndsWith(".ikb"))
                {
                    ss = ss.Substring(ss.LastIndexOf("\\") + 1);
                    ss = ss.Substring(0, ss.Length - 4);
                    if (!ScriptExists(ss))
                    {
                        Scripts.Add(ss);
                    }
                }
            }

            foreach (string sx in Scripts)
            {
                ToolStripMenuItem i = new ToolStripMenuItem(sx);
                i.Click += ScriptClick;
                scripts_menu.Items.Add(i);
            }

            foreach (Layout l in Layouts)
            {
                ToolStripMenuItem i = new ToolStripMenuItem(l.name);
                i.Click += LayoutClick;
                layouts.Items.Add(i);
            }


            string lay = cfg.Read("layout", "Type Writer");
            string scr = cfg.Read("script", "MM Unicode");
            if (LayoutExists(lay))
            {
                laybtn.Text = lay;
            }
            else
            {
                laybtn.Text = "Type Writer";
            }
            if (ScriptExists(scr))
            {
                UpdateScript(scr);
            }
            else
            {
                UpdateScript("MM Unicode");
            }
            System.GC.Collect();
            if (!true)
            {
                try
                {
                    string sss = cfg.Read("embed-crypt");
                    if (EmbeddingControl.isValid(sss))
                    {
                        embedcrypt.Enabled = true;
                        actv.Enabled = false;
                        scrbtn.Enabled = false;
                        laybtn.Enabled = false;
                        //glassButton4.Enabled = false;
                    }
                    else
                    {
                        //internet();
                    }
                }
                catch (Exception ex)
                {
                    //internet();
                }
            }
            else
            {
                enablekey = Convert.ToInt32(cfg.Read("enable", "120"));
            }
            this.Refresh();
            Program.kh.SetHandle(this);
            Program.kh.Initiate();
        }
Ejemplo n.º 7
0
 public ConfigForm(Main mf)
 {
     mfm = mf;
     cfg = new Config("MyInput\\");
     InitializeComponent();
 }