Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
electron-windows-osk
Advanced tools
This experimental package allows you to show, close, resize and position the built in on-screen Windows keyboard. Take a look at `export.js` to check out the API.
This experimental package allows you to show, close, resize and position the built in on-screen Windows keyboard.
Take a look at export.js
to check out the API.
Short example:
import WindowsOSK from 'electron-windows-osk';
const OSK = new WindowsOSK(browserWindowInstance);
// Open and position OSK on click in inputs.
document.addEventListener('click', (event) => {
if (event.target.tagName === 'INPUT' && event.target.tagName === 'TEXTAREA') {
const viewportOffset = event.target.getBoundingClientRect();
const inBrowserYOffset =
(
viewportOffset.top - // Element top offset.
window.scrollY // If the page is scrolled we need to substract the scroll y.
);
OSK.showFromEvent(inBrowserYOffset, event.target.clientHeight, 5);
// meteor-desktop: Desktop.send('virtualKeyboard', 'show', inBrowserYOffset, event.target.clientHeight, 5);
}
});
// Close the OSK on any other click.
document.addEventListener('click', (event) => {
if (event.target.tagName !== 'INPUT' && event.target.tagName !== 'TEXTAREA') {
OSK.close();
// meteor-desktop: Desktop.send('virtualKeyboard', 'close');
}
});
Example of meteor-desktop
module:
import WindowsOSK from 'electron-windows-osk';
export default class VirtualKeyboardModule {
constructor({ log, eventsBus, Module }) {
this.log = log;
let virtualKeyboardModule = new Module('virtualKeyboard');
eventsBus.on('windowCreated', (window) => {
this.window = window;
console.log(WindowsOSK);
this.windowsOSK = new WindowsOSK(window);
});
virtualKeyboardModule.on('show', this.showKeyboard.bind(this));
virtualKeyboardModule.on('close', this.closeKeyboard.bind(this));
this.windowsOSK = null;
}
showKeyboard(event, inBrowserYOffset, height, padding) {
this.windowsOSK.showFromEvent(inBrowserYOffset, height, padding);
}
closeKeyboard() {
this.windowsOSK.close();
}
};
FAQs
This experimental package allows you to show, close, resize and position the built in on-screen Windows keyboard. Take a look at `export.js` to check out the API.
The npm package electron-windows-osk receives a total of 3 weekly downloads. As such, electron-windows-osk popularity was classified as not popular.
We found that electron-windows-osk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.