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
My application is currently using add_acceleratorkeypressed to intercept keypresses in the host. The aim was to prevent or remap keys like ctrl-p and prevent default dialogs. The problem is, it seems that those keypresses aren't getting raised as JS events, EG: window.addEventListener('keydown', console.log) will print nothing. If I return false for handled, then the print dialog will be opened, but if i return true, the event isn't raised in JS.
What's the correct approach to this problem? Thanks.
The text was updated successfully, but these errors were encountered:
@leaanthony Hey Lea! If I understand correctly, you want to use AcceleratorKeyPressed to stop things like Print, but also want them to show up as regular key presses so you can do something else with ctrl+P? If you are ok with handling the logic in the host app you could have the logic for detecting ctrl+P, cancel the behavior, and then send ExecuteScript to call the different functionality you want.
Or have you tried doing this completely within javascript (use e.preventDefault() for example)?
My application is currently using add_acceleratorkeypressed to intercept keypresses in the host. The aim was to prevent or remap keys like
ctrl-p
and prevent default dialogs. The problem is, it seems that those keypresses aren't getting raised as JS events, EG:window.addEventListener('keydown', console.log)
will print nothing. If I returnfalse
for handled, then the print dialog will be opened, but if i return true, the event isn't raised in JS.What's the correct approach to this problem? Thanks.
The text was updated successfully, but these errors were encountered: