Add hotkey Ctrl-s for saving code
This commit is contained in:
parent
80ddd7a8b5
commit
6102c101b3
@ -43,7 +43,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="panel ctrl-panel">
|
<div class="panel ctrl-panel">
|
||||||
<button style="width:100%" onclick="save_code()">Save</button>
|
<button style="width:100%" onclick="save_code()">Save (ctrl+s)</button>
|
||||||
<button style="width:100%" onclick="send_to_icarus()">Run Icarus Verilog</button>
|
<button style="width:100%" onclick="send_to_icarus()">Run Icarus Verilog</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel editor" id="editor">@CODE@</div>
|
<div class="panel editor" id="editor">@CODE@</div>
|
||||||
@ -94,6 +94,13 @@
|
|||||||
.then((text) => { window.location.href = text; });
|
.then((text) => { window.location.href = text; });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
document.addEventListener('keydown', (e) => {
|
||||||
|
if (e.key.toLowerCase() === 's' && e.ctrlKey) {
|
||||||
|
e.preventDefault();
|
||||||
|
save_code();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user