コード例 #1
0
 //Function for checking what key was pressed, plays corresponding macro
 public static void MacroCheck(int vkCode)
 {
     if ((Keys)vkCode == Keys.NumPad0)
     {
         SoundSystem.PlayMacro(0);
     }
     else if ((Keys)vkCode == Keys.NumPad1)
     {
         SoundSystem.PlayMacro(1);
     }
     else if ((Keys)vkCode == Keys.NumPad2)
     {
         SoundSystem.PlayMacro(2);
     }
     else if ((Keys)vkCode == Keys.NumPad3)
     {
         SoundSystem.PlayMacro(3);
     }
     else if ((Keys)vkCode == Keys.NumPad4)
     {
         SoundSystem.PlayMacro(4);
     }
     else if ((Keys)vkCode == Keys.NumPad5)
     {
         SoundSystem.PlayMacro(5);
     }
     else if ((Keys)vkCode == Keys.NumPad6)
     {
         SoundSystem.PlayMacro(6);
     }
     else if ((Keys)vkCode == Keys.NumPad7)
     {
         SoundSystem.PlayMacro(7);
     }
     else if ((Keys)vkCode == Keys.NumPad8)
     {
         SoundSystem.PlayMacro(8);
     }
     else if ((Keys)vkCode == Keys.NumPad9)
     {
         SoundSystem.PlayMacro(9);
     }
 }
コード例 #2
0
 //eventhandler to play the sound
 private void ButtonClick(object o, EventArgs e)
 {
     SoundSystem.PlayMacro(Convert.ToInt16(((Button)o).Name.Substring(3)));
 }