Closed neoedmund closed 6 months ago
There is an optional cheerpjInit
callback that let the user decides which additional shortcuts should be handled by Java rather than the browser: https://labs.leaningtech.com/cheerpj3/reference/cheerpjInit#overrideshortcuts
We do not automatically preventDefault
all shortcuts since that would hijack legitimate ones that the user of the page might need. With the aforementioned callback the page author can refine the behavior.
after using
await cheerpjInit({
overrideShortcuts: function (e) {return true;}
});
I cannot input a single character, something wrong? I suppose to have as many keys as possible because it's a text editor app.
Simply returning true
won't work. By returning true
you are causing CheerpJ to preventDefault()
all events. By calling preventDefault()
on all keydown
/keyup
events there will be no keypress
events.
This is how the browser work, not something that CheerpJ can change.
You need to carefully select the combination you are interested in.
still impressive job, thank you!
Wow, quite impressive about the Java Swing support. I can even run neoeedit.jar after recompile with jdk 8. But some keys are go through to the web browser, like, ,TAB , ctrl-H, ... , del, backspace, ... any options?