title: Property that is set by event handler is always displayed without change
body: <p>I have a simple function that is called every second using <code>setInterval</code>,</p>
  <p>I have to change the value to say if there is mouse or keyboard activity.</p>
  <p>I update the value of my variable but it's always set as 0 even though the <code>console.log</code> are called.</p>
  <pre><code>function generateActivity() {
      var o = { is_mouse: 0, is_keyboard: 0 };
  
      // Keyboard activity
      uiohook.uIOhook.on('keydown', (e) =&gt; {
          //console.log('Keyboard!')
           o.is_keyboard = 1;
      })
  
      // Mouse activity
      uiohook.uIOhook.on('mousemove', (e) =&gt; {
          //console.log('mouse');
          o.is_mouse = 1;
      })
  
      console.log(o);
  }
  
  setInterval(generateActivity, 1*1000);
  </code></pre>