All Projects → mullvad → NSEventMonitor

mullvad / NSEventMonitor

Licence: MIT License
Node.js module for monitoring NSEvents

Programming Languages

Objective-C++
1391 projects
javascript
184084 projects - #8 most used programming language
objective c
16641 projects - #2 most used programming language
python
139335 projects - #7 most used programming language
HTML
75241 projects
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to NSEventMonitor

bearclaw
Menubar app to quickly create new notes in Bear
Stars: ✭ 60 (+275%)
Mutual labels:  menubar
StockBar
A menu bar app to track stock prices, currency exchange rates, and cryptocurrency prices.
Stars: ✭ 17 (+6.25%)
Mutual labels:  menubar
react-native-macos-menubar-template
A template project for a macOS menu bar/tray app with react-native-mac-os
Stars: ✭ 78 (+387.5%)
Mutual labels:  menubar
Quickeys
A mac menu bar app that provides note taking functionality though a quick dropdown menu.
Stars: ✭ 54 (+237.5%)
Mutual labels:  menubar
radiobar
macOS menubar app to listen to streaming radio
Stars: ✭ 53 (+231.25%)
Mutual labels:  menubar
pluto menu bar
A menu bar for flutter.
Stars: ✭ 29 (+81.25%)
Mutual labels:  menubar
SaveMyEyes
Minimalistic macOS application that helps to take breaks while using the computer
Stars: ✭ 27 (+68.75%)
Mutual labels:  menubar
trueChart-Menubar4Sense
MENUBAR as visualization extension for Qlik Sense® allows for vertical and horizontal buttons and selections (fields, master dimensions and variables) as well as unlimited trigger based Actions. #trueChart #menubar #highcoordination
Stars: ✭ 19 (+18.75%)
Mutual labels:  menubar
nodeScratchpad
Evaluate Nodejs Code Snippets From Menubar! 💻
Stars: ✭ 102 (+537.5%)
Mutual labels:  menubar
rktmachine
Menu bar macOS app for running rkt in a macOS hypervisor CoreOS VM.
Stars: ✭ 31 (+93.75%)
Mutual labels:  menubar
custer
macOS streaming radio in your menu bar
Stars: ✭ 17 (+6.25%)
Mutual labels:  menubar
covid-19-status
Menu bar widget for MacOS with COVID-19 statistics
Stars: ✭ 50 (+212.5%)
Mutual labels:  menubar
Jukebox
A macOS app to view the currently playing song in the menu bar
Stars: ✭ 93 (+481.25%)
Mutual labels:  menubar
KubeContext
Mac MenuBar App for Switching your K8s Context
Stars: ✭ 15 (-6.25%)
Mutual labels:  menubar
django-menu-generator
A straightforward menu generator for Django
Stars: ✭ 24 (+50%)
Mutual labels:  menubar
beoplay-macos-remote-gui
Remote control B&O Beoplay loudspeakers from macOS (PoC)
Stars: ✭ 14 (-12.5%)
Mutual labels:  menubar
osx-statusbar-countdown
⏳📅 A utility to count down to a date from your macOS menubar, written in Swift
Stars: ✭ 40 (+150%)
Mutual labels:  menubar
fishing-funds
基金,大盘,股票,虚拟货币状态栏显示小应用,基于Electron开发,支持MacOS,Windows,Linux客户端,数据源来自天天基金,蚂蚁基金,爱基金,腾讯证券,新浪基金等
Stars: ✭ 424 (+2550%)
Mutual labels:  menubar
macOS-PiholeShortcuts
Manage and monitor your Pi-hole® instance through your status bar
Stars: ✭ 43 (+168.75%)
Mutual labels:  menubar
Countdown
A countdown task App on macOS
Stars: ✭ 23 (+43.75%)
Mutual labels:  menubar

NSEventMonitor

Build Status dependencies Status devDependencies Status

Currently when building menubar apps with Electron, window.on('blur', ...) does not fire if user clicks on other menubar items leaving displayed window on screen.

Native macOS popovers usually hide if user clicks anywhere on screen. This extension attempts to fix that for Electron apps, so the following will never be the case anymore:

Example

import { NSEventMonitor, NSEventMask } from 'nseventmonitor';

let macEventMonitor = new NSEventMonitor();

window.on('blur', () => {
  window.hide();
});

window.on('show', () => {
  // start capturing global mouse events
  macEventMonitor.start((NSEventMask.leftMouseDown | NSEventMask.rightMouseDown), () => {
    window.hide();
  });
});

window.on('hide', () => {
  // stop capturing global mouse events
  macEventMonitor.stop();
});

To run example app:

$ cd example
$ npm i
$ npm start

Electron support

Electron comes with its own Node.js runtime, which may differ from the one installed on your desktop. Therefore all native modules have to be built specifically for Electron.

We strongly advise to use electron-builder and add a postinstall script to your package.json in order to automatically compile native modules for Electron:

electron-builder install-app-deps

Building from source

To compile the extension run the following command:

$ npm i --build-from-source

You can confirm everything built correctly by running the test suite.

To run tests:

$ npm test

Note: tests are currently disabled due to issues with automation on macOS.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].