Change layers with ctrl+1/2/3

This commit is contained in:
Devine Lu Linvega 2018-03-07 09:32:31 +13:00
parent 9e5f84e56c
commit 679e3abccf
2 changed files with 4 additions and 1 deletions

View File

@ -156,6 +156,9 @@ function Dotgrid(width,height,grid_x,grid_y,block_x,block_y,thickness = 3,lineca
this.controller.add("default","Layers","Move Above",() => { dotgrid.tool.layer_up() },"P");
this.controller.add("default","Layers","Move Below",() => { dotgrid.tool.layer_down() },"L");
this.controller.add("default","Layers","Foreground",() => { dotgrid.tool.select_layer(0) },"CmdOrCtrl+1");
this.controller.add("default","Layers","Middleground",() => { dotgrid.tool.select_layer(1) },"CmdOrCtrl+2");
this.controller.add("default","Layers","Background",() => { dotgrid.tool.select_layer(2) },"CmdOrCtrl+3");
this.controller.add("default","View","Tools",() => { dotgrid.interface.toggle(); },"U");
this.controller.add("default","View","Grid",() => { dotgrid.guide.toggle(); },"H");

View File

@ -91,7 +91,7 @@ function Keyboard()
dotgrid.keyboard.move(0,-1);
e.preventDefault();
}
if(e.code && e.code.substr(0,5) == "Digit"){
if(e.code && e.code.substr(0,5) == "Digit" && !e.metaKey && !e.ctrlKey){
var value = parseInt(e.code.substr(5,1));
dotgrid.keyboard.push(value);
e.preventDefault();