Beispiel #1
0
 public void Remove(KeyCombinationData data)
 {
     if (CombinationList.Contains(data) == true)
     {
         CombinationList.Remove(data);
     }
 }
Beispiel #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();
        }
Beispiel #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);
            }
        }
Beispiel #4
0
 public void Add(KeyCombinationData data)
 {
     CombinationList.Add(data);
 }