add modal dialog

This commit is contained in:
Stewart Allen 2022-01-06 15:10:03 -05:00
commit 2666069a27
4 changed files with 113 additions and 7 deletions

View file

@ -131,6 +131,9 @@ function space_init(data) {
platform.setColor(platcolor);
},
'keypress', evt => {
if (api.modal.showing) {
return;
}
let { shiftKey, metaKey, ctrlKey, code } = evt;
switch (code) {
case 'KeyC':
@ -173,6 +176,12 @@ function space_init(data) {
'keydown', evt => {
let rv = Math.PI / 16;
let { shiftKey, metaKey, ctrlKey, code } = evt;
if (api.modal.showing) {
if (code === 'Escape') {
api.modal.hide();
}
return;
}
switch (code) {
case 'KeyA':
if (metaKey || ctrlKey) {