Newbie: Packaged application and events


#1

Hello,

I have a question about getting a keydown event or something similar on my Electron application.

If I locally debug it with npm start, cmd + r makes the window reload, so far so good.

However, when I export it with electron-packager, I lose the ability to do so.

I’ve tried using electron-debug but no result.

Is there a way around this?

If remote works for this, I’d appreciate a pointer in the right path…

Regards.


#2

When you package the app do you have an app menu with the View/Reload menu item in it?


#3

maybe the shortcut (cmd +r ) conflict with os.


#4

No, I do not.

Just a Quit button on top.


#5

F5/Ctrl+R doesnt work on Windows too apparently :frowning:


#6

Quote by @zcbenz:

The default app creates a default menu for your app, once your app is packaged, the default menu will be gone.

So, if I understand @zcbenz correctly then you’ll want to explicitly create your own application menu with a Reload menu item that has the Ctrl+R keyboard accelerator.


#7

I see.

Appreciate it, will get right on top of it.

Cheers!