Esempio n. 1
0
 private String optionToString(KeyInform option, Keys key)
 {
     if (option == KeyInform.Alt)
     {
         return("Alt + " + key.ToString());
     }
     else if (option == KeyInform.Control)
     {
         return("Ctrl + " + key.ToString());
     }
     else if (option == KeyInform.Shift)
     {
         return("Shift + " + key.ToString());
     }
     else if (option == KeyInform.AltControl)
     {
         return("Alt + Ctrl + " + key.ToString());
     }
     else if (option == KeyInform.ShiftAlt)
     {
         return("Shift + Alt + " + key.ToString());
     }
     else if (option == KeyInform.ShiftControl)
     {
         return("Sifht + Ctrl + " + key.ToString());
     }
     else if (option == KeyInform.ShiftAltControl)
     {
         return("Shift + Alt + Ctrl + " + key.ToString());
     }
     else if (option == KeyInform.None)
     {
         return(key.ToString());
     }
     else
     {
         return("");
     }
 }
Esempio n. 2
0
 private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
 {
     switch (msg)
     {
     case HOTKEYGap:
         Keys      key      = (Keys)(((int)lParam >> 16) & 0xFFFF); //눌러 진 단축키의 키
         KeyInform modifier = (KeyInform)((int)lParam & 0xFFFF);    //눌려진 단축키의 수식어
         for (int i = 0; i < this.commandList.Count; i++)
         {
             CommandObject cmd = this.commandList[i];
             if (modifier == cmd.Modifier && key == cmd.Key)
             {
                 animation.Stop();
                 animation.Begin((FrameworkElement)icCommand.ItemContainerGenerator.ContainerFromIndex(i));
                 Messenger.Default.Send <KeyMessage>(new KeyMessage()
                 {
                     CmdIndex = i
                 });
             }
         }
         break;
     }
     return(IntPtr.Zero);
 }
Esempio n. 3
0
 public static extern bool RegisterHotKey(IntPtr itp, int id, KeyInform fsInform, Keys vk);