Exemplo n.º 1
0
 public void Remove(KeyCombinationData data)
 {
     if (CombinationList.Contains(data) == true)
     {
         CombinationList.Remove(data);
     }
 }
Exemplo n.º 2
0
        public void StartDialog(Utilities.GlobalKeyboardHook hook, Action CloseEvent, int Index = -1)
        {
            _hook       = hook;
            _CloseEvent = CloseEvent;

            KeyDownHandler = new KeyEventHandler(Menu_KeyDown);
            KeyUpHandler   = new KeyEventHandler(Menu_KeyUp);

            mapData = KeyCombinationManager.Instance[Index];
            if (mapData == null)
            {
                mapData = new KeyCombinationData();
            }
            for (int i = 0; i < KeyDataManager.Instance.Count; ++i)
            {
                KeyData keyData = KeyDataManager.Instance[i];
                if (keyData != null)
                {
                    _hook.HookedKeys.Add((Keys)keyData.NumbericValue);
                }
            }
            _hook.KeyDown += KeyDownHandler;
            _hook.KeyUp   += KeyUpHandler;
            _hook.hook();
            ShowDialog();
        }
Exemplo n.º 3
0
        public void Load()
        {
            List <SaveData> loadData = FileManager.ReadJsonObject <List <SaveData> >(CONFIG_FILE);

            if (loadData == null)
            {
                return;
            }
            CombinationList.Clear();
            foreach (SaveData data in loadData)
            {
                KeyCombinationData mapData = new KeyCombinationData();
                foreach (int NumvericValue in data.MapCode)
                {
                    mapData.mappingDataList.Add(KeyDataManager.Instance.Find(NumvericValue));
                }
                foreach (int NumvericValue in data.CodeList)
                {
                    mapData.KeyCode.Add(KeyDataManager.Instance.Find(NumvericValue));
                }
                CombinationList.Add(mapData);
            }
        }
Exemplo n.º 4
0
 public void Add(KeyCombinationData data)
 {
     CombinationList.Add(data);
 }