draw lines on shift press when pen is selected
This commit is contained in:
parent
9a4f32c99a
commit
ea0e9f8452
@ -91,16 +91,33 @@ function main() {
|
|||||||
Whiteboard actions
|
Whiteboard actions
|
||||||
/----------------*/
|
/----------------*/
|
||||||
|
|
||||||
|
var tempLineTool = false;
|
||||||
|
var strgPressed = false;
|
||||||
//Handle key actions
|
//Handle key actions
|
||||||
$(document).on("keydown", function (e) {
|
$(document).on("keydown", function (e) {
|
||||||
if (e.which == 16) {
|
if (e.which == 16) {
|
||||||
whiteboard.pressedKeys["shift"] = true; //Used for straight lines...
|
if(whiteboard.tool=="pen" && !strgPressed) {
|
||||||
|
tempLineTool = true;
|
||||||
|
whiteboard.ownCursor.hide();
|
||||||
|
shortcutFunctions.setTool_line();
|
||||||
|
} else {
|
||||||
|
whiteboard.pressedKeys["shift"] = true; //Used for straight lines...
|
||||||
|
}
|
||||||
|
} else if (e.which == 17) {
|
||||||
|
strgPressed = true;
|
||||||
}
|
}
|
||||||
//console.log(e.which);
|
//console.log(e.which);
|
||||||
});
|
});
|
||||||
$(document).on("keyup", function (e) {
|
$(document).on("keyup", function (e) {
|
||||||
if (e.which == 16) {
|
if (e.which == 16) {
|
||||||
|
if(tempLineTool) {
|
||||||
|
tempLineTool = false;
|
||||||
|
shortcutFunctions.setTool_pen();
|
||||||
|
whiteboard.ownCursor.show();
|
||||||
|
}
|
||||||
whiteboard.pressedKeys["shift"] = false;
|
whiteboard.pressedKeys["shift"] = false;
|
||||||
|
} else if (e.which == 17) {
|
||||||
|
strgPressed = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user