Migrated the remaining shortcuts
This commit is contained in:
parent
801cb3e9af
commit
dc1b8738ac
@ -118,6 +118,20 @@ function Commander()
|
|||||||
ronin.commander.update();
|
ronin.commander.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.activate = function()
|
||||||
|
{
|
||||||
|
ronin.cursor.update();
|
||||||
|
ronin.commander.autocomplete();
|
||||||
|
ronin.commander.show();
|
||||||
|
setTimeout(()=>{ronin.commander.focus},100)
|
||||||
|
}
|
||||||
|
|
||||||
|
this.deactivate = function()
|
||||||
|
{
|
||||||
|
this.blur();
|
||||||
|
this.hide();
|
||||||
|
}
|
||||||
|
|
||||||
this.show = function()
|
this.show = function()
|
||||||
{
|
{
|
||||||
this.el.className = "visible";
|
this.el.className = "visible";
|
||||||
|
@ -4,16 +4,6 @@ function Keyboard()
|
|||||||
|
|
||||||
this.key_up = function(e)
|
this.key_up = function(e)
|
||||||
{
|
{
|
||||||
if(e.key == "tab" || e.keyCode == 9){
|
|
||||||
e.preventDefault();
|
|
||||||
ronin.cursor.update();
|
|
||||||
ronin.commander.autocomplete();
|
|
||||||
ronin.commander.show();
|
|
||||||
setTimeout(()=>{ronin.commander.focus},100)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ronin.keyboard.is_down[e.key] = false;
|
|
||||||
ronin.hint.update(e);
|
ronin.hint.update(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -21,34 +11,10 @@ function Keyboard()
|
|||||||
{
|
{
|
||||||
ronin.keyboard.is_down[e.key] = true;
|
ronin.keyboard.is_down[e.key] = true;
|
||||||
|
|
||||||
if(e.key == "/"){
|
|
||||||
e.preventDefault();
|
|
||||||
ronin.commander.inject("~")
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(e.key == "Enter"){
|
if(e.key == "Enter"){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
ronin.commander.validate();
|
ronin.commander.validate();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(e.key == "Escape"){
|
|
||||||
e.preventDefault();
|
|
||||||
ronin.commander.input_el.blur();
|
|
||||||
ronin.commander.input_el.value = "";
|
|
||||||
ronin.guide.update();
|
|
||||||
ronin.guide.clear();
|
|
||||||
ronin.guide.inspect = false;
|
|
||||||
if(!ronin.commander.is_focused()){
|
|
||||||
ronin.commander.hide();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Macros
|
|
||||||
if(e.key == "f" && (e.ctrlKey || e.metaKey)){
|
|
||||||
e.preventDefault();
|
|
||||||
ronin.commander.inject(`frame fill:${ronin.cursor.color}`)
|
|
||||||
}
|
|
||||||
|
|
||||||
if(ronin.commander.is_focused()){
|
if(ronin.commander.is_focused()){
|
||||||
ronin.hint.update(e);
|
ronin.hint.update(e);
|
||||||
|
@ -85,6 +85,8 @@ function Ronin()
|
|||||||
this.controller.add("default","Brush","Dec Size",() => { ronin.brush.mod_size(-1); },"[");
|
this.controller.add("default","Brush","Dec Size",() => { ronin.brush.mod_size(-1); },"[");
|
||||||
this.controller.add("default","Brush","Toggle Color",() => { ronin.cursor.swap_colors(); },"x");
|
this.controller.add("default","Brush","Toggle Color",() => { ronin.cursor.swap_colors(); },"x");
|
||||||
|
|
||||||
|
this.controller.add("default","Commander","Show",() => { ronin.commander.activate(); },"`");
|
||||||
|
this.controller.add("default","Commander","Hide",() => { ronin.commander.deactivate(); },"Escape");
|
||||||
this.controller.add("default","Commander","Fill With $",() => { ronin.commander.inject("fill:$"); },"CmdOrCtrl+F");
|
this.controller.add("default","Commander","Fill With $",() => { ronin.commander.inject("fill:$"); },"CmdOrCtrl+F");
|
||||||
|
|
||||||
this.controller.add("default","View","Zoom Reset",() => { ronin.frame.methods.zoom.run(1); },"1");
|
this.controller.add("default","View","Zoom Reset",() => { ronin.frame.methods.zoom.run(1); },"1");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user