Mouse wheel IO system

Towards fixing . This adds an IO class for detecting the mouse wheel
being scrolled. Basic tests are included; they mock the runtime to see
what blocks are activated by scrolling.
This commit is contained in:
Florrie 2018-01-26 17:13:01 -04:00
parent b201ce948d
commit be83c0ee74
3 changed files with 75 additions and 1 deletions
src/engine

View file

@ -14,6 +14,7 @@ const Clock = require('../io/clock');
const DeviceManager = require('../io/deviceManager');
const Keyboard = require('../io/keyboard');
const Mouse = require('../io/mouse');
const MouseWheel = require('../io/mouseWheel');
const defaultBlockPackages = {
scratch3_control: require('../blocks/scratch3_control'),
@ -258,7 +259,8 @@ class Runtime extends EventEmitter {
clock: new Clock(),
deviceManager: new DeviceManager(),
keyboard: new Keyboard(this),
mouse: new Mouse(this)
mouse: new Mouse(this),
mouseWheel: new MouseWheel(this)
};
/**