How to customize the behavior of the Escape button (PC) #354
Replies: 6 comments
-
The problem is that every editor simply listens to keyboard events, making it impossible for editors to determine which one is currently active. However, in version Best regards |
Beta Was this translation helpful? Give feedback.
-
Thank you @hm21 ! indeed detecting which one is active falls in my end responsibility (I can do that), glad there is a way to disable escapeButton, will test! |
Beta Was this translation helpful? Give feedback.
-
@hm21 Couldn't make it to work, unfortunately, I am unsuccessful to change the state of a currently open image editor. Perhaps I am doing something wrong? _saveTimer = Timer.periodic(Duration(seconds: 2), (timer) {
if (!isImageTabActive() || _isSaving) {
if (listenForEscapeButton) {
setState(() {
listenForEscapeButton = false;
});
}
return;
}
if (!listenForEscapeButton) {
setState(() {
listenForEscapeButton = true;
});
}
if (_imageHasUpdates) {
_imageHasUpdates = false;
_captureImageAndSave();
}
}); mainEditor: MainEditorConfigs(
enableZoom: true,
editorMinScale: 1.0,
editorMaxScale: maxScale,
enableCloseButton: true,
enableEscapeButton: listenForEscapeButton,
... |
Beta Was this translation helpful? Give feedback.
-
Would it also be possible that the Escape button triggers |
Beta Was this translation helpful? Give feedback.
-
I think all this could be better if we could have access to overwrite the ESC behavior, i.e. |
Beta Was this translation helpful? Give feedback.
-
Hello!!
I have multiple image editors open in different tabs in my app, however if I press ESC anywhere, all editors are closing simultaneously. I wish to close only the active one, or worst case scenario, disable this shortcut so I use mine.
I thought of wrapping everything with my own
KeyboardListener
widget but not sure if this is a good idea overall.Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions