Beispiel #1
0
        private void initialize()
        {
            System.IO.Directory.CreateDirectory(Settings.Default.keymaps_path);
            this.applicationsJson  = this.loadApplicationsJSON();
            this.defaultKeymapJson = this.loadDefaultKeymapJSON();

            this.defaultName  = this.defaultKeymapJson.GetValue("Title").ToString();
            this.fallbackName = this.defaultName;
            this.fallbackFile = DEFAULT_JSON_FILENAME;

            JObject specificKeymap = new JObject();
            JObject commonKeymap   = new JObject();

            if (this.defaultKeymapJson.GetValue(this.WiimoteID.ToString()) != null)
            {
                specificKeymap = (JObject)this.defaultKeymapJson.GetValue(this.WiimoteID.ToString());
            }
            if (this.defaultKeymapJson.GetValue("All") != null)
            {
                commonKeymap = (JObject)this.defaultKeymapJson.GetValue("All");
            }

            MergeJSON(commonKeymap, specificKeymap);
            this.defaultKeymapJson  = commonKeymap;
            this.fallbackKeymapJson = commonKeymap;

            this.KeyMap = new WiiKeyMap(this.defaultKeymapJson, this.fallbackName, this.fallbackFile, new XinputDevice(XinputBus.Default, this.WiimoteID), new XinputReport(this.WiimoteID));
            this.KeyMap.OnButtonDown    += keyMap_onButtonDown;
            this.KeyMap.OnButtonUp      += keyMap_onButtonUp;
            this.KeyMap.OnConfigChanged += keyMap_onConfigChanged;
            this.KeyMap.OnRumble        += keyMap_onRumble;

            this.SendConfigChangedEvt();
        }
Beispiel #2
0
        private void initialize()
        {
            this.defaultKeymap = KeymapDatabase.Current.getDefaultKeymap();

            JObject specificKeymap = new JObject();
            JObject commonKeymap   = new JObject();

            this.fallbackKeymap = defaultKeymap;

            this.KeyMap = new WiiKeyMap(this.WiimoteID, this.defaultKeymap, this.outputHandlers);
            this.KeyMap.OnButtonDown    += keyMap_onButtonDown;
            this.KeyMap.OnButtonUp      += keyMap_onButtonUp;
            this.KeyMap.OnConfigChanged += keyMap_onConfigChanged;
            this.KeyMap.OnRumble        += keyMap_onRumble;

            this.SendConfigChangedEvt();
        }
Beispiel #3
0
        private void initialize()
        {
            System.IO.Directory.CreateDirectory(Settings.Default.keymaps_path);
            this.applicationsJson = this.loadApplicationsJSON();
            this.defaultKeymapJson = this.loadDefaultKeymapJSON();

            this.defaultName = this.defaultKeymapJson.GetValue("Title").ToString();
            this.fallbackName = this.defaultName;
            this.fallbackFile = DEFAULT_JSON_FILENAME;

            JObject specificKeymap = new JObject();
            JObject commonKeymap = new JObject();

            if (this.defaultKeymapJson.GetValue(this.WiimoteID.ToString()) != null)
            {
                specificKeymap = (JObject)this.defaultKeymapJson.GetValue(this.WiimoteID.ToString());
            }
            if (this.defaultKeymapJson.GetValue("All") != null)
            {
                commonKeymap = (JObject)this.defaultKeymapJson.GetValue("All");
            }

            MergeJSON(commonKeymap, specificKeymap);
            this.defaultKeymapJson = commonKeymap;
            this.fallbackKeymapJson = commonKeymap;

            this.KeyMap = new WiiKeyMap(this.defaultKeymapJson, this.fallbackName, this.fallbackFile, new XinputDevice(XinputBus.Default, this.WiimoteID), new XinputReport(this.WiimoteID));
            this.KeyMap.OnButtonDown += keyMap_onButtonDown;
            this.KeyMap.OnButtonUp += keyMap_onButtonUp;
            this.KeyMap.OnConfigChanged += keyMap_onConfigChanged;
            this.KeyMap.OnRumble += keyMap_onRumble;

            this.SendConfigChangedEvt();
        }
Beispiel #4
0
        private void initialize()
        {
            this.defaultKeymap = KeymapDatabase.Current.getDefaultKeymap();

            JObject specificKeymap = new JObject();
            JObject commonKeymap = new JObject();

            this.fallbackKeymap = defaultKeymap;

            this.KeyMap = new WiiKeyMap(this.WiimoteID, this.defaultKeymap, this.outputHandlers);
            this.KeyMap.OnButtonDown += keyMap_onButtonDown;
            this.KeyMap.OnButtonUp += keyMap_onButtonUp;
            this.KeyMap.OnConfigChanged += keyMap_onConfigChanged;
            this.KeyMap.OnRumble += keyMap_onRumble;

            this.SendConfigChangedEvt();
        }