Ejemplo n.º 1
0
 private void cbOutput_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (cbOutput.SelectedItem != null && ((ComboBoxItem)cbOutput.SelectedItem).Content != null)
     {
         ComboBoxItem cbItem = (ComboBoxItem)cbOutput.SelectedItem;
         if (cbItem == cbiAll)
         {
             this.selectedOutput = KeymapOutputType.ALL;
         }
         else if (cbItem == cbiKeyboard)
         {
             this.selectedOutput = KeymapOutputType.KEYBOARD;
         }
         else if (cbItem == cbiTouch)
         {
             this.selectedOutput = KeymapOutputType.TOUCH;
         }
         else if (cbItem == cbiMouse)
         {
             this.selectedOutput = KeymapOutputType.MOUSE;
         }
         else if (cbItem == cbi360)
         {
             this.selectedOutput = KeymapOutputType.XINPUT;
         }
         else if (cbItem == cbiOther)
         {
             this.selectedOutput = KeymapOutputType.DISABLE;
         }
         this.fillOutputList(this.selectedOutput, "");
     }
 }
Ejemplo n.º 2
0
 public KeymapOutput(KeymapOutputType type, string name, string key, bool continous, bool cursor, bool stackable)
 {
     this.Type      = type;
     this.Name      = name;
     this.Key       = key;
     this.Continous = continous;
     this.Cursor    = cursor;
 }
Ejemplo n.º 3
0
        public List <KeymapOutput> getAvailableOutputs(KeymapOutputType type)
        {
            if (type == KeymapOutputType.ALL)
            {
                return(allOutputs);
            }
            List <KeymapOutput> list = new List <KeymapOutput>();

            foreach (KeymapOutput output in allOutputs)
            {
                if (output.Type == type)
                {
                    list.Add(output);
                }
            }
            return(list);
        }
Ejemplo n.º 4
0
 public static Color GetColor(KeymapOutputType type)
 {
     switch (type)
     {
         case KeymapOutputType.KEYBOARD:
             return Colors.Orange;
         case KeymapOutputType.TOUCH:
             return Colors.Purple;
         case KeymapOutputType.MOUSE:
             return Colors.OrangeRed;
         case KeymapOutputType.XINPUT:
             return Colors.Green;
         case KeymapOutputType.DISABLE:
             return Colors.Black;
         default:
             return Colors.Black;
     }
 }
Ejemplo n.º 5
0
        private void fillOutputList(KeymapOutputType type, string filter)
        {
            this.spOutputList.Children.Clear();
            List <KeymapOutput> allOutputs = KeymapDatabase.Current.getAvailableOutputs(type);

            allOutputs.Sort(new KeymapOutputComparer());

            foreach (KeymapOutput output in allOutputs)
            {
                if (filter == null || filter == "" || output.Name.ToLower().Contains(filter.ToLower()))
                {
                    KeymapOutputRow row = new KeymapOutputRow(output);
                    row.OnDragStart += output_OnDragStart;
                    row.OnDragStop  += output_OnDragStop;
                    this.spOutputList.Children.Add(row);
                }
            }
        }
Ejemplo n.º 6
0
        public static Color GetColor(KeymapOutputType type)
        {
            switch (type)
            {
            case KeymapOutputType.KEYBOARD:
                return(Colors.Orange);

            case KeymapOutputType.TOUCH:
                return(Colors.Purple);

            case KeymapOutputType.MOUSE:
                return(Colors.OrangeRed);

            case KeymapOutputType.XINPUT:
                return(Colors.Green);

            case KeymapOutputType.DISABLE:
                return(Colors.Black);

            default:
                return(Colors.Black);
            }
        }
Ejemplo n.º 7
0
 public KeymapOutput(KeymapOutputType type, string name, string key)
     : this(type, name, key, true, false, false, true)
 {
 }
        private void fillOutputList(KeymapOutputType type, string filter)
        {
            this.spOutputList.Children.Clear();
            List<KeymapOutput> allOutputs = KeymapDatabase.Current.getAvailableOutputs(type);
            allOutputs.Sort(new KeymapOutputComparer());

            foreach (KeymapOutput output in allOutputs)
            {
                if (filter == null || filter == "" || output.Name.ToLower().Contains(filter.ToLower()))
                {
                    KeymapOutputRow row = new KeymapOutputRow(output);
                    row.OnDragStart += output_OnDragStart;
                    row.OnDragStop += output_OnDragStop;
                    this.spOutputList.Children.Add(row);
                }
            }
        }
 private void cbOutput_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (cbOutput.SelectedItem != null && ((ComboBoxItem)cbOutput.SelectedItem).Content != null)
     {
         ComboBoxItem cbItem = (ComboBoxItem)cbOutput.SelectedItem;
         if (cbItem == cbiAll)
         {
             this.selectedOutput = KeymapOutputType.ALL;
         }
         else if (cbItem == cbiKeyboard)
         {
             this.selectedOutput = KeymapOutputType.KEYBOARD;
         }
         else if (cbItem == cbiTouch)
         {
             this.selectedOutput = KeymapOutputType.TOUCH;
         }
         else if (cbItem == cbiMouse)
         {
             this.selectedOutput = KeymapOutputType.MOUSE;
         }
         else if (cbItem == cbi360)
         {
             this.selectedOutput = KeymapOutputType.XINPUT;
         }
         else if (cbItem == cbiOther)
         {
             this.selectedOutput = KeymapOutputType.DISABLE;
         }
         this.fillOutputList(this.selectedOutput,"");
     }
 }