frankhale / electron-with-express

A simple app that demonstrates spawning an Express app from Electron
MIT License
643 stars 147 forks source link

Key binding for F1 (Server Log) doesn't work anymore #25

Closed frankhale closed 3 years ago

frankhale commented 4 years ago

Originally when this started you could grab global key bindings to do various things. Sometime a while ago Keymaster stopped working. This isn't a problem with Keymaster. This is something that happened in Electron. Keybindings no longer work with respect to webviews so you can't open up the server log. It's a shame but I don't really feel like fixing it. If anyone does I'll accept a pull request.

frankhale commented 3 years ago

I'd love to make the key bind work again but maybe the easiest thing to do is to either enable the menu bar or create a custom menu that allows the Server Log to be shown. Maybe the answer is to move away from a web view but I haven't looked at what the options are recently since I've been not paying attention to Electron for quite some time.

Aqueuse commented 3 years ago

it work for me, I'm in Windows 10 and run the app with powershell. Just to give you a feedback, thank you for this good example, it help a lot to begin.

frankhale commented 3 years ago

Okay so as I'm just getting back into this after an extended break I forgot some things I already did previously. I'd like to make a correction to what I said. It seems I switched from webview to iframe for hosting the express content. If you do not focus the main part of the window (no clicking) then the key bind works. After you click the content the key bind will no longer get triggered because the iframe has exclusive control apparantly. I am pretty sure Electron has a way to do global key binds inside the Electron main process so I'm going to attempt that.

Also a long time ago when I started this, this was not a problem and worked as expected with using key binds set up in the normal web programming way.

frankhale commented 3 years ago

I just fixed this with latest commit. See README for new keyboard shortcut to access server log