예제 #1
0
        public MainWindow()
        {
            InitializeComponent();

            this.Conf = XmlSerializer.Load <Config>(@".\Configure.xml");

            this.keyhook = new LLKeyHook();
            this.keyhook.Set();
            this.keyhook.KeyDown += new KeyEvent(KeyDownEvet);
            this.keyhook.KeyUp   += new KeyEvent(KeyUpEvet);

            var hide = new DoubleAnimation();

            Storyboard.SetTarget(hide, this.DispButton);
            Storyboard.SetTargetProperty(hide, new PropertyPath("(Button.Opacity)"));
            hide.From      = 1;
            hide.To        = 0;
            hide.Duration  = TimeSpan.FromSeconds(2);
            this.boardDisp = new Storyboard();
            this.boardDisp.Children.Add(hide);

            var flash = new DoubleAnimation();

            Storyboard.SetTarget(flash, this.MainGrid);
            Storyboard.SetTargetProperty(flash, new PropertyPath("(Grid.Opacity)"));
            flash.From      = 1;
            flash.To        = 0;
            flash.Duration  = TimeSpan.FromMilliseconds(500);
            this.boardFlash = new Storyboard();
            this.boardFlash.Children.Add(flash);
        }
예제 #2
0
        public MainWindow()
        {
            InitializeComponent();

            _Keyhook = new LLKeyHook();
            _Keyhook.SetKeyHook();
            _Keyhook.SetMouseHook();
            _Keyhook.KeyDown       += new KeyEvent(KeyDownEvetAsync);
            _Keyhook.KeyUp         += new KeyEvent(KeyUpEvet);
            _Keyhook.MouseMove     += new MouseEvent(Mousehook_MouseMove);
            _Keyhook.MouseLeftDown += new MouseEvent(Mousehook_MouseLeftDown);

            this._MacroRecord = new MacroSet {
                Macros = new List <Macro> {
                    new Macro()
                }
            };
            this._MacroRecord.Macros[0].MacroCommands = new List <Command>();
        }
예제 #3
0
 protected void txtKey_LostFocus(object sender, EventArgs e)
 {
     //Unhook keyboard when the leave the hotkey text box
     LLKeyHook.Unhook();
 }
예제 #4
0
 protected void txtKey_GotFocus(object sender, EventArgs e)
 {
     //Hook keyboard when the user is in the Hotkey text box
     LLKeyHook.StartHook();
 }