예제 #1
0
 public ClKey(ClKey input)
 {
     this.val       = input.val;
     this.ktype     = input.ktype;
     this.display   = input.display;
     this.allLayers = input.allLayers;
 }
예제 #2
0
 public ClKeyData(int slice, int x, int y)
 {
     key        = new ClKey();
     this.x     = x;
     this.y     = y;
     this.slice = slice;
 }
예제 #3
0
 public ClKeyData()
 {
     key   = new ClKey();
     x     = 0;
     y     = 0;
     slice = 0;
 }
예제 #4
0
        private void SetLayoutFromButton(Button sender, char input)
        {
            string btn = sender.Tag.ToString();

            btn = btn.Substring(btn.IndexOf("_") + 1);
            int slice = Convert.ToInt32(btn.Substring(0, btn.IndexOf("_")));

            btn = btn.Substring(btn.IndexOf("_") + 1);
            int x = Convert.ToInt32(btn.Substring(0, btn.IndexOf("_")));

            btn = btn.Substring(btn.IndexOf("_") + 1);
            int y = Convert.ToInt32(btn.Substring(0, btn.IndexOf("_")));

            btn = btn.Substring(btn.IndexOf("_") + 1);
            int z = Convert.ToInt32(btn);



            foreach (List <ClKeyData> kl in layout.keys)
            {
                foreach (ClKeyData k in kl)
                {
                    if (k.slice == slice && k.x == x && k.y == y)
                    {
                        if (CBAllLayers.Checked.Value || ClKey.GetKeyFromChar(input).allLayers || k.key.allLayers || layout.keys.IndexOf(kl) == this.index)
                        {
                            k.key = ClKey.GetKeyFromChar(input);
                        }
                    }
                }
            }
            MdGlobals.board.LoadLayout(layout);
        }
예제 #5
0
 public static void Initiate()
 {
     SERIAL_SET_LAYER_COMMAND = "uniqueksetlayer";
     selectedSpecial          = false;
     selectedKey     = new ClKey();
     kselect         = new FmKeySelector();
     kselect.Topmost = true;
 }
예제 #6
0
        public static ClKey GetKeyFromChar(char input)
        {
            ClKey cky = dKeys.Find(k => (k.ktype == 0 && k.val == Convert.ToByte(input)));

            if (cky != null)
            {
                return(cky);
            }
            return(new ClKey());
        }
예제 #7
0
        public FmMain()
        {
            InitializeComponent();
            Icon = new Icon(MdConstants.icon);
            //Icon = ArbitesEto.Properties.Resources.favicon as Eto.Drawing.Icon;
            //Icon = Icon.FromResource("favicon.ico", typeof(System.Drawing.Icon));
            ClKey.iniList();
            MdGlobals.Initiate();

            // load ports event
            BtnDevice.Click += (sender, e) => LoadHardwareList();

            // load devices event
            BtnPort.Click += (sender, e) => LoadPortList();

            // launch key selector
            BtnKeyMenu.Click += (sender, e) => LaunchKeyMenu();

            BtnUpload.Click += (sender, e) => BtnUploadClicked();

            this.Closing += (sender, e) => FormClosing();
        }