Пример #1
0
 // starts user input polling
 public void Start()
 {
     lock (timerLock)
     {
         initialInfo.Update();
         actualInfo = (InputInfo)initialInfo.Clone();
         timer.Start();
     }
 }
Пример #2
0
        public InputTracker(EventHandler<InputChangedEventArgs> changed)
        {
            var handler = changed;
            if (handler != null)
                Changed += handler;

            disposed = false;

            timerLock = new object();
            timer = new Timer { AutoReset = true, Enabled = false };
            timer.Elapsed += timer_Elapsed;

            initialInfo = InputInfo.Create();
            actualInfo = (InputInfo)initialInfo.Clone();
        }
Пример #3
0
        public InputTracker(EventHandler <InputChangedEventArgs> changed)
        {
            var handler = changed;

            if (handler != null)
            {
                Changed += handler;
            }

            disposed = false;

            timerLock = new object();
            timer     = new Timer {
                AutoReset = true, Enabled = false
            };
            timer.Elapsed += timer_Elapsed;

            initialInfo = InputInfo.Create();
            actualInfo  = (InputInfo)initialInfo.Clone();
        }