Keyboard shortcut inserts character into editor when showing alert


I’m facing a strange problem with a package. When my package function completes, I want to show a message to the user. Is alert() the correct way to do this?

I have assigned the shortcut ctrl-alt-b to my package function. Everything works fine when I’m not showing the alert. But as soon as I enable the alert, pressing the shortcut inserts a character into the current editor.

In my case, it’s ∫, which is triggered by ctrl-alt-b on Mac OS X.

Is this is a known issue? Showing the alert seems to hand over the key press to the OS. Is there a way to prevent this?


Let me guess… German keyboard?

See this issue on the repo.
There is a problem using your Alt-Gr, so for your purposes you might want to try it with another key mapping.


It depends on what kind of message you want to display. I’m pretty sure there’s a built-in way to show a dialog without resorting to alert(), but I can’t recall off the top of my head. Perhaps @abe can enlighten us?

If you just want to give some simple feedback, you can check out my StatusMessage class for displaying text in the status bar.


Yes, it’s a German keyboard - but I don’t think it’s this problem. The default behavior on the Mac is to insert this character when pressing Ctrl+Alt+B - it has nothing to do with the AltGr key (which I don’t even have on the Mac).


Thanks! I’ve removed the alert() call in favor of using a view now - this works quite well and it’s nicer than the alert window.

See here for the view.


This is what I was about to suggest, generally the basic popup class is overlay, with from-top to stick it in the top center of the screen. If you want the user to interact with the view to validate/cancel it you can take a look at how the SelectListView does it: