Пример #1
0
 static IntPtr jklWndProc(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam)
 {
     if (msg == jkluMSG)
     {
         uint layout = (uint)lParam;
         MahouUI.GlobalLayout = MahouUI.currentLayout = layout;
         Logging.Log("[JKL] > Layout changed to [" + layout + "] / [0x" + layout.ToString("X") + "].");
         Debug.WriteLine(">> JKL LC: " + layout);
         if (layout == OnLayoutAction)
         {
             OnLayoutAction = 0;
             Debug.WriteLine("Executing action: " + ActionOnLayout.Method.Name + " on layout: " + layout);
             ActionOnLayout();
         }
         if (start_cyclEmuSwitch)
         {
             if (layout != cycleEmuDesiredLayout)
             {
                 KMHook.CycleEmulateLayoutSwitch();
             }
             else
             {
                 start_cyclEmuSwitch = false;
             }
         }
         else if (!self_change)
         {
             MahouUI.RefreshFLAG();
             MMain.mahou.RefreshAllIcons();
             MMain.mahou.UpdateLDs();
         }
     }
     return(WinAPI.DefWindowProcW(hWnd, msg, wParam, lParam));
 }
Пример #2
0
 static IntPtr jklWndProc(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam)
 {
     if (msg == jkluMSG)
     {
         uint layout = (uint)lParam;
         MahouUI.GlobalLayout = MahouUI.currentLayout = layout;
         Logging.Log("[JKL] > Layout changed to [" + layout + "] / [0x" + layout.ToString("X") + "].");
         if (start_cyclEmuSwitch)
         {
             if (layout != cycleEmuDesiredLayout)
             {
                 KMHook.CycleEmulateLayoutSwitch();
             }
             else
             {
                 start_cyclEmuSwitch = false;
             }
         }
         else
         {
             MMain.mahou.UpdateLDs();
         }
     }
     return(WinAPI.DefWindowProcW(hWnd, msg, wParam, lParam));
 }
Пример #3
0
 protected override void WndProc(ref Message m)
 {
     if (m.Msg == jkluMSG)
     {
         uint layout = (uint)m.LParam, laysho = layout & 0xffff;
         MahouUI.GlobalLayout = MahouUI.currentLayout = layout;
         Logging.Log("[JKL] > Layout changed to [" + layout + "] / [0x" + layout.ToString("X") + "].");
         Debug.WriteLine(">> JKL LC: " + layout);
         Logging.Log("[JKL] > On layout act:" + OnLayoutAction);
         var anull = ActionOnLayout == null;
         Logging.Log("[JKL] > ACtion: " + (anull?"null":ActionOnLayout.Method.Name));
         if (layout == OnLayoutAction || (layout & 0xffff) == (OnLayoutAction & 0xffff))
         {
             actionOnLayoutExecuted = true;
             OnLayoutAction         = 0;
             if (anull)
             {
                 Logging.Log("[JKL] > Action is null, something terribly went wrong... Please try to disable JKL, if layout changing went wild.", 1);
             }
             else
             {
                 Debug.WriteLine("Executing action: " + ActionOnLayout.Method.Name + " on layout: " + layout);
                 ActionOnLayout();
                 ActionOnLayout = null;
             }
         }
         if (start_cyclEmuSwitch)
         {
             Debug.WriteLine("Cycling out from: " + layout + " to " + cycleEmuDesiredLayout + "...");
             if (layout != cycleEmuDesiredLayout && laysho != cycleEmuDesiredLayout)
             {
                 KMHook.CycleEmulateLayoutSwitch();
             }
             else
             {
                 start_cyclEmuSwitch = false;
                 if (MahouUI.MAIN_LAYOUT1 == layout || MahouUI.MAIN_LAYOUT2 == layout)
                 {
                     KMHook.last_switch_layout = layout;
                     KMHook.evt_layoutchanged(layout, 0, MahouUI.bindable_events[0]);
                 }
             }
         }
         if (!self_change && !start_cyclEmuSwitch)
         {
             MahouUI.RefreshFLAG();
             MMain.mahou.RefreshAllIcons();
             MMain.mahou.UpdateLDs();
             if (anull && !KMHook.selfie)
             {
                 KMHook.AS_IGN_fun();
             }
         }
     }
     base.WndProc(ref m);
 }
Пример #4
0
 static IntPtr jklWndProc(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam)
 {
     if (msg == jkluMSG)
     {
         uint layout = (uint)lParam, laysho = layout & 0xffff;
         MahouUI.GlobalLayout = MahouUI.currentLayout = layout;
         Logging.Log("[JKL] > Layout changed to [" + layout + "] / [0x" + layout.ToString("X") + "].");
         Debug.WriteLine(">> JKL LC: " + layout);
         Logging.Log("[JKL] > On layout act:" + OnLayoutAction);
         var anull = ActionOnLayout == null;
         Logging.Log("[JKL] > ACtion: " + (anull?"null":ActionOnLayout.Method.Name));
         if (layout == OnLayoutAction || (layout & 0xffff) == (OnLayoutAction & 0xffff))
         {
             actionOnLayoutExecuted = true;
             OnLayoutAction         = 0;
             if (anull)
             {
                 Logging.Log("[JKL] > Action is null, something terribly went wrong... Please try to disable JKL, if layout changing went wild.", 1);
             }
             else
             {
                 Debug.WriteLine("Executing action: " + ActionOnLayout.Method.Name + " on layout: " + layout);
                 ActionOnLayout();
                 ActionOnLayout = null;
             }
         }
         if (start_cyclEmuSwitch)
         {
             Debug.WriteLine("Cycling out from: " + layout + " to " + cycleEmuDesiredLayout + "...");
             if (layout != cycleEmuDesiredLayout && laysho != cycleEmuDesiredLayout)
             {
                 KMHook.CycleEmulateLayoutSwitch();
             }
             else
             {
                 start_cyclEmuSwitch = false;
             }
         }
         if (!self_change && !start_cyclEmuSwitch)
         {
             MahouUI.RefreshFLAG();
             MMain.mahou.RefreshAllIcons();
             MMain.mahou.UpdateLDs();
             if (anull && !KMHook.selfie)
             {
                 KMHook.AS_IGN_fun();
             }
         }
     }
     return(WinAPI.DefWindowProcW(hWnd, msg, wParam, lParam));
 }
Пример #5
0
 static IntPtr jklWndProc(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam)
 {
     if (msg == jkluMSG)
     {
         uint layout = (uint)lParam, laysho = layout & 0xffff;
         MahouUI.GlobalLayout = MahouUI.currentLayout = layout;
         Logging.Log("[JKL] > Layout changed to [" + layout + "] / [0x" + layout.ToString("X") + "].");
         Debug.WriteLine(">> JKL LC: " + layout);
         Logging.Log("[JKL] > On layout act:" + OnLayoutAction);
         var anull = ActionOnLayout == null;
         Logging.Log("[JKL] > ACtion: " + (anull?"null":ActionOnLayout.Method.Name));
         if (layout == OnLayoutAction || (layout & 0xffff) == (OnLayoutAction & 0xffff))
         {
             actionOnLayoutExecuted = true;
             OnLayoutAction         = 0;
             if (anull)
             {
                 Logging.Log("[JKL] > Action is null, something terribly went wrong... Please try to disable JKL, if layout changing went wild.", 1);
             }
             else
             {
                 Debug.WriteLine("Executing action: " + ActionOnLayout.Method.Name + " on layout: " + layout);
                 ActionOnLayout();
                 ActionOnLayout = null;
             }
         }
         if (start_cyclEmuSwitch)
         {
             Debug.WriteLine("Cycling out from: " + layout + " to " + cycleEmuDesiredLayout + "...");
             if (layout != cycleEmuDesiredLayout && laysho != cycleEmuDesiredLayout)
             {
                 KMHook.CycleEmulateLayoutSwitch();
             }
             else
             {
                 start_cyclEmuSwitch = false;
             }
         }
         if (!self_change && !start_cyclEmuSwitch)
         {
             MahouUI.RefreshFLAG();
             MMain.mahou.RefreshAllIcons();
             MMain.mahou.UpdateLDs();
             if (anull && !KMHook.selfie && KMHook.AS_IGN_LS)
             {
                 if (KMHook.AS_IGN_RULES.Contains("L"))
                 {
                     Debug.WriteLine("[HEY] > " + KMHook.was_ls);
                     if (KMHook.was_ls)
                     {
                         KMHook.was_ls = KMHook.was_back = KMHook.was_del = false;
                     }
                     else
                     {
                         KMHook.was_ls = true;
                         if (KMHook.AS_IGN_RULES.Contains("T"))
                         {
                             if (KMHook.AS_IGN_RESET != null)
                             {
                                 KMHook.AS_IGN_RESET.Stop();
                                 KMHook.AS_IGN_RESET.Dispose();
                             }
                             KMHook.AS_IGN_RESET          = new System.Windows.Forms.Timer();
                             KMHook.AS_IGN_RESET.Interval = KMHook.AS_IGN_TIMEOUT;
                             KMHook.AS_IGN_RESET.Tick    += (_, __) => {
                                 Debug.WriteLine("TIMER_AS_RESET");
                                 KMHook.was_ls = KMHook.was_back = KMHook.was_del = false;
                                 KMHook.AS_IGN_RESET.Stop();
                                 KMHook.AS_IGN_RESET.Dispose();
                             };
                             KMHook.AS_IGN_RESET.Start();
                         }
                     }
                 }
                 else
                 {
                     KMHook.was_ls = true;
                 }
             }
         }
     }
     return(WinAPI.DefWindowProcW(hWnd, msg, wParam, lParam));
 }