mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-08-06 11:29:16 -04:00
Mouse wheel IO system
Towards fixing #865. 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:
parent
b201ce948d
commit
be83c0ee74
3 changed files with 75 additions and 1 deletions
src/engine
|
@ -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)
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue