예제 #1
0
        internal void UpdateVisual()
        {
            string font = kl.getFont();
            double fonssize = Convert.ToDouble(kl.getFontSize());
            foreach (Object b in this.Controls)
            {
                if (typeof(Glass.GlassButton) == b.GetType())
                {
                    Glass.GlassButton g = (Glass.GlassButton)b;
                    g.Font = new Font(font, (float)fonssize);
                    if (g.VKCode != null)
                    {
                        Key k = new Key();
                        k.shift = shift;
                        k.alt = alt;
                        k.vkCode = Convert.ToInt32(g.VKCode, 16);
                        if (dkstate != "none")
                            k = kl.ProcessKey(k, dkstate);
                        else
                            k = kl.ProcessKey(k);
                        if (k.ch.StartsWith("[") && k.ch.EndsWith("]"))
                            g.Text = "\u25cc\t\t" + k.ch;
                        else
                            g.Text = k.ch;
                    }
                    else
                    {
                        if (shift)
                        {
                            if (g.Text == "SHIFT")
                                g.InnerBorderColor = Color.LightSkyBlue;
                        }
                        else
                        {
                            if (g.Text == "SHIFT")
                                g.InnerBorderColor = Color.FromArgb(64, 64, 64, 20);
                        }

                        if (alt)
                        {
                            if (g.Text == "ALT")
                                g.InnerBorderColor = Color.LightSkyBlue;
                        }
                        else
                        {
                            if (g.Text == "ALT")
                                g.InnerBorderColor = Color.FromArgb(64, 64, 64, 20);
                        }
                    }
                }
            }
        }
예제 #2
0
 public bool Income(int vkCode,bool gis,bool shf,KeyboardLayout kl)
 {
     Key k = new Key();
     k.alt = gis;
     k.shift = shf;
     k.vkCode = vkCode;
     if (k.vkCode == 8)
         k.ch = "delete";
     else
     {
         if (mfm != null)
         {
             if (mfm.dkstate != "none")
             {
                 k = kl.ProcessKey(k, mfm.dkstate);
                 k.ch = k.ch.Replace("◌", "");
             }
             else
             {
                 k = kl.ProcessKey(k);
                 k.ch = k.ch.Replace("◌", "");
             }
         }
     }
     if (k.ch.StartsWith("[") && k.ch.EndsWith("]"))
     {
         if (mfm != null)
         {
             mfm.dkChange(k.ch.Replace("[", "").Replace("]", ""));
             return true;
         }
     }
     else
     {
         mfm.dkChange("none");
     }
     bool eat = false;
     foreach (string s in CompatibilityDecompose(k.ch))
     {
         eat = eat | Income(s);
     }
     // what will we do with ear?
     return eat;
 }
예제 #3
0
 public Key ProcessKey(string xch,bool shift,bool alt)
 {
     string s;
     if (shift)
     {
         if (alt)
         {
             s = inis.GetValue("ALTSHIFT", xch);
         }
         else
         {
             s = inis.GetValue("SHIFT", xch);
         }
     }
     else if (alt)
     {
         s = inis.GetValue("ALT", xch);
     }
     else
     {
         s = inis.GetValue("NORMAL", xch);
     }
     if (s == null) s = "";
     s = processValue(s);
     Key k = new Key();
     k.shift = shift;
     k.alt = alt;
     k.ch = s;
     return k;
 }
예제 #4
0
 public Key ProcessKey(Key k)
 {
     string ch = Convert.ToString(k.vkCode, 16);
     ch = ch.ToUpper();
     return ProcessKey(ch,k.shift,k.alt);
 }
예제 #5
0
 public Key ProcessKey(string xch, bool shift, string state)
 {
     string s;
     if (shift)
     {
         s = inis.GetValue(state + "SHIFT", xch);
     }
     else
     {
         s = inis.GetValue(state, xch);
     }
     if (s == null) s = "";
     s = processValue(s);
     Key k = new Key();
     k.shift = shift;
     k.alt = false;
     k.ch = s;
     return k;
 }