electron-localshortcut | Add keyboard shortcuts locally to a BrowserWindow instance | Menu library
kandi X-RAY | electron-localshortcut Summary
kandi X-RAY | electron-localshortcut Summary
Add keyboard shortcuts locally to a BrowserWindow instance, without using a Menu
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Registers the shortcut accelerator registered on the BrowserWindow instance .
- Unregisters the shortcut of accelerator registered on the BrowserWindow instance .
- normalize event
- Checks the accelerator configuration .
- Search for the shortcut of a shortcut
- Unregisters all shortcuts registered on any BrowserWindow instance .
- Disable all shortcuts registered on the specified window object .
- Enable all shortcuts registered on the BrowserWindow instance .
- Check if a shortcut is registered on the BrowserWindow instance .
electron-localshortcut Key Features
electron-localshortcut Examples and Code Snippets
Community Discussions
Trending Discussions on electron-localshortcut
QUESTION
I want to use keyboard shortcuts in mac without using menu.
I read this.
Can I make non global accelerators without putting things in a menu?
And now I know that I can use this module.
But how can I use copy, cut, and paste?
...ANSWER
Answered 2019-Aug-13 at 10:16- One best way is using
keydown
andkeyup
events or you can just use electron web-contentsbefore-input-event
event which is emitted before dispatchingkeydown
andkeyup
events in the page. It can be used to catch and handle custom shortcuts that are not visible in the menu. you can check the combination of key you want to add shortcut and then add a callback. - If you don't want to do manual shortcut parsing there are libraries that do advanced key detection such as mousetrap.
QUESTION
Well, I have quite a simple task, which can't be really hard. I have an app, which uses the electron framework to use the application on Windows and Mac machines. I notices that I am able to use Ctrl+c/Ctrl+v on Windows without any problems, but I am not able to use Cmd+c/Cmd+v on Mac after I used the electron-packager.
I found solutions like this (CMD + C / CMD + V not working), but I have a custom menue and I don't want to define and use the one in electron itself. So I found this (global accelerators without menue, but the issue is still open and there seems to be no solution. Solutions like this (Local-Shortcut) are also not usable, as they don't get the selected text (e.g. from a textbox) as a parameter.
I think using Cmd+c / Cmd+v shouldn't be a real issue, since it is a common action in every application, but I don't see a usable solution at the moment. This also effects all other shortcuts like Cmd+a to select everything.
...ANSWER
Answered 2017-Jun-28 at 11:10There seems to be no way of doing it if you really want to hide these shortcuts from the menu.
At the moment, the best workaround is to display the shortcuts menu on MacOS only:
QUESTION
electon-localshortcut
giving error when I am trying to assign shortcut without specifying any browser window as given in https://www.npmjs.com/package/electron-localshortcut
ANSWER
Answered 2017-May-27 at 17:32Register electron-localshortcut
on all the windows then when it get's pressed then run a function that checks for the focused window like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install electron-localshortcut
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page