Organizing input actions in device folders

This commit is contained in:
barsdeveloper
2022-01-05 22:26:56 +01:00
parent 7704850cf6
commit a6ff4161e8
19 changed files with 41 additions and 41 deletions

25
js/input/mouse/Select.js Executable file
View File

@@ -0,0 +1,25 @@
import MouseClickDrag from "./MouseClickDrag"
export default class Select extends MouseClickDrag {
constructor(target, blueprint, options) {
super(target, blueprint, options)
this.selectorElement = this.blueprint.selectorElement
}
startDrag() {
this.selectorElement.startSelecting(this.clickedPosition)
}
dragTo(location, movement) {
this.selectorElement.doSelecting(location)
}
endDrag() {
if (this.started) {
this.selectorElement.finishSelecting()
} else {
this.blueprint.unselectAll()
}
}
}