private void HotkeyProc(HotkeyInfo hotkeyInfo)
        {
            Console.WriteLine("KBW- {0} : Hotkey Proc! {1}, {2}{3}", DateTime.Now.ToString("hh:MM:ss.fff"),
                                             hotkeyInfo.Key, hotkeyInfo.Modifiers, Environment.NewLine);
            if (volUpDown == "Up")
                group.setVolumeUpHotkey(hotkeyInfo.Key.ToString());
            else
                group.setVolumeDownHotkey(hotkeyInfo.Key.ToString());

            this.Close();
        }
예제 #2
0
        private void HotkeyProc(HotkeyInfo hotkeyInfo)
        {
            Console.WriteLine("{0} : Hotkey Proc! {1}, {2}{3}", DateTime.Now.ToString("hh:MM:ss.fff"),
                                             hotkeyInfo.Key, hotkeyInfo.Modifiers, Environment.NewLine);
            if(hotkeyInfo.Key == Keys.F5)
            {
                rebuildGroups();

            }
            else
            {
                foreach (ProgramGroup group in Program.PGM.programGroups)
                {
                    group.isThisYourKotkey(hotkeyInfo);
                }

            }
            updateDisplayedVolume();
        }
        /*
            This function is called with info on what hotkey was pressed,
            if the hotkey that was pressed belongs to this group then it
            performs the appropriate task
            */
        public void isThisYourKotkey(HotkeyInfo hotkeyInfo)
        {
            if (!hasHotkey)
            {
                return;
            }
            if (hotkeyInfo.Key == (Keys)hotkeyVolUp.Key &&
                hotkeyInfo.Modifiers == (Modifiers)hotkeyVolUp.Modifier)
            {
                //volAsPercent += 5;
                setVolume(volAsPercent + 5);

            }

            if (hotkeyInfo.Key == (Keys)hotkeyVolDown.Key &&
                hotkeyInfo.Modifiers == (Modifiers)hotkeyVolDown.Modifier)
            {
                //volAsPercent -= 5;
                setVolume(volAsPercent - 5);
            }
            updateVolume();
        }