You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
createShortcut(['Meta', 'P'], () => {
console.log('Pressed Meta + P');
});
Pressing this combo works fine, however if I fully let go, and press it again the native browser "Print" dialog will popup. I close it, press the combo again and it works fine, press again and the dialog opens (and so on...).
I've tried with requireReset on both true and false but the behaviour is the same.
This behaviour is the same on "Meta + S" too.
The text was updated successfully, but these errors were encountered:
This is interesting.
Preventing the default behavior for Control + P on Windows works as expected, but for Meta + P the native behavior is executed anyway. Not sure if events associated with Meta key cannot be prevented or what's the issue. Needs more investigating.
So for a bit more context, my current (slimmed) logic looks like this:
constisMac=navigator.platform.toLowerCase().indexOf('mac')>-1;window.addEventListener('keydown',shortcut);functionshortcut(event: KeyboardEvent): void{if(isMac&&e.metaKey&&e.key==='p'){event.preventDefault();// do something}}
I can mash Cmd + P as much as I want and the print dialog doesn't show (this is in use here: https://zapp.run/edit/dart) - it'll trigger the command palette. I implemented the logic above to trigger the palette but yeah, it worked but then showed the print dialog the second time, so it should be possible to prevent it.
Hey,
When I setup the following shortcut (on Mac):
Pressing this combo works fine, however if I fully let go, and press it again the native browser "Print" dialog will popup. I close it, press the combo again and it works fine, press again and the dialog opens (and so on...).
I've tried with
requireReset
on both true and false but the behaviour is the same.This behaviour is the same on "Meta + S" too.
The text was updated successfully, but these errors were encountered: