示例#1
0
 protected override void WndProc(ref Message m)
 {
     switch (m.Msg)
     {
     case MKC.WM_HOTKEY:
         string modifier = KeyParse((int)m.LParam & 0xFFFF);
         int    K        = ((int)m.LParam >> 16) & 0xFFFF;
         string key      = GetKeyName(K);
         if (VUIKeys.ContainsKey(modifier + key) == true)
         {
             (string Func, string Param) = FuncParse(VUIKeys[modifier + key]);
             if (API.GetPClass() == "MagicKeys")
             {
                 List <string> VUFValues = Ini.IniReadValues(API.GetVUIPath() + API.GetVUI() + ".vuf", Func);
                 VUFInvoke(VUFValues);
             }
             else
             {
                 InvokeFromString(Func, Param);
             }
         }
         break;
     }
     base.WndProc(ref m);
 }
示例#2
0
        public static void VUILoader(string File)
        {
            KeyUnReg();
            VUIKeys.Clear();
            SoundPlay("ChangeVUI", 0);
            string VUIFile = VUIPathDetect(File);

            CurrentPlugin["VUI"]        = File;
            CurrentPlugin["PClass"]     = Ini.IniRead(VUIFile, "Info", "PClass");
            CurrentPlugin["BClass"]     = Ini.IniRead(VUIFile, "Info", "BClass");
            CurrentPlugin["PluginName"] = Ini.IniRead(VUIFile, "Info", "PluginName");
            CurrentPlugin["Loader"]     = Ini.IniRead(VUIFile, "Info", "Loader");
            Count = Ini.IniCountSections(VUIFile) - 1;
            if (Ini.IniSectionExists(VUIFile, "Keys") == true)
            {
                Count = Ini.IniCountSections(VUIFile) - 2;
            }
            VUIObjects.Clear();
            if (Ini.IniSectionExists(VUIFile, "1") == true)
            {
                for (int I = 1; I <= Count; I++)
                {
                    VUIObjects.Add(I, new Dictionary <string, string>());
                    VUIObjects[I].Add("Active", "true");
                    VUIObjects[I].Add("Text", Ini.IniRead(VUIFile, I.ToString(), "Text"));
                    VUIObjects[I].Add("ObjectType", Ini.IniRead(VUIFile, I.ToString(), "ObjectType"));
                    VUIObjects[I].Add("Help", Ini.IniRead(VUIFile, I.ToString(), "Help"));
                    if (Ini.IniKeyExists(VUIFile, I.ToString(), "AutoFunc") == true)
                    {
                        VUIObjects[I].Add("AutoFunc", Ini.IniRead(VUIFile, I.ToString(), "AutoFunc"));
                    }
                    VUIObjects[I].Add("Func", Ini.IniRead(VUIFile, I.ToString(), "Func"));
                    if (Ini.IniKeyExists(VUIFile, I.ToString(), "Param") == true)
                    {
                        VUIObjects[I].Add("Param", Ini.IniRead(VUIFile, I.ToString(), "Param"));
                    }
                    if (Ini.IniKeyExists(VUIFile, I.ToString(), "Key") == true)
                    {
                        VUIObjects[I].Add("Key", Ini.IniRead(VUIFile, I.ToString(), "Key"));
                    }
                }
                VUIObjectsUpdate(true);
            }
            GetPluginType();
            VUIPluginLoad();
            KeyLoader();
            KeyReg();
            SoundPlay("PluginDetect", 0);
        }
示例#3
0
 public static void KeyReg()
 {
     if (VUIKeys.ContainsKey("None") == false)
     {
         int IDKey = 0;
         foreach (var OBJKey in VUIKeys)
         {
             uint     Mod      = MKC.MOD_NOREPEAT;
             string[] KeyItems = OBJKey.Key.Split("+");
             for (int K = 0; K < KeyItems.Length; K++)
             {
                 if (KeyItems[K] == "Ctrl" | KeyItems[K] == "Alt" | KeyItems[K] == "Shift" | KeyItems[K] == "Win")
                 {
                     Mod = Mod | (uint)Enum.Parse(typeof(MKC.ModKeys), KeyItems[K]);
                 }
             }
             try{
                 Keys key = (Keys)kc.ConvertFrom(KeyItems[^ 1]);