kdj_singlish
Version:
KDJ Singlish is an app which created to help people to type in sinhala without making any mistakes. This will save your time and fix all the issues you are getting when you type. Just use it and let me know the issues.
38 lines (30 loc) • 1.36 kB
JavaScript
// In the renderer process:
var remote = require('electron').remote;
// `remote.require` since `Menu` is a main-process module.
var buildEditorContextMenu = remote.require('electron-editor-context-menu');
window.addEventListener('contextmenu', function(e) {
// Only show the context menu in text editors.
if (!e.target.closest('textarea, input, [contenteditable="true"]')) return;
var menu = buildEditorContextMenu();
// The 'contextmenu' event is emitted after 'selectionchange' has fired but possibly before the
// visible selection has changed. Try to wait to show the menu until after that, otherwise the
// visible selection will update after the menu dismisses and look weird.
setTimeout(function() {
menu.popup(remote.getCurrentWindow());
}, 30);
});
const mouseCirlcle = document.createElement('div');
mouseCirlcle.style.position = 'absolute';
mouseCirlcle.style.background = 'red';
mouseCirlcle.style.borderRadius = '80%';
mouseCirlcle.style.opacity = '0.5';
mouseCirlcle.style.width = '15px';
mouseCirlcle.style.height = '15px';
document.body.appendChild(mouseCirlcle);
document.body.addEventListener('mousemove', (event) => {
mouseCirlcle.style.top = event.clientY + 10 + 'px';
mouseCirlcle.style.left = event.clientX + 10 + 'px';
});
// const {
// trackEvent
// } = require('./analytics');