![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
on-screen-keyboard-detector
Advanced tools
Detects presence of the On-Screen-Keyboard in mobile browsers
Indirect detection of the presence of the on-screen keyboard (OSK) shown by mobile browsers when the user interacts with input controls on a webpage.
This approach employs the browsers layout and visual viewports (Explainer, MDN, Demo) to observe the appearance of the virtual keyboard.
Simplified, since it's introduction
Chrome's behaviour makes it necessary to also observe focusin
, focusout
, resize
and visibilitychange
events.
The indirect detection relying on viewport and window DOM events brings some limitations:
hidden
and visible
events are dispatched with a approximate 1 second delay.visible
keyboard.Because of these caveats, the straight-forward way of detecting blur
and focus
events on inputs should be explored before falling back on this project.
npm install on-screen-keyboard-detector
import { subscribe, isSupported } from 'on-screen-keyboard-detector';
if (isSupported()) {
const unsubscribe = subscribe(visibility => {
if (visibility === "hidden") {
// ...
}
else { // visibility === "visible"
// ...
}
});
// After calling unsubscribe() the callback will no longer be invoked.
unsubscribe();
}
Begins to observe browser events and invokes the provided callback function when a change in the keyboard visibility is detected.
Parameter | Type | Description |
---|---|---|
callback | function(String) | user-defined handler which receives the keyboard visibility changes |
function(): void
: Unsubscribes to receive updates
Returns true
if the browser runtime supports oskd.
PubSub is not part of this module and needs additional tools, e.g. emittery. See demo/pubsub.html
import {subscribe} from 'on-screen-keyboard-detector';
import Emitter from 'emittery';
const emitter = new Emitter();
subscribe(visibility => emitter.emit(visibility));
emitter.on('hidden', function() { /* ... */ });
emitter.on('visible', function() { /* ... */ });
package.json
)TEST_SERVER
in package.json
), E.g. run http-server in the project root folder http-server . --port 8081
For real devices make sure
adb start-server
), andadb devices -l
)adb tcpip 5555
and adb connect <test phone ip address>
(see "setup_test"
in package.json
)
Then run npm run test:chrome
.Connect a device where Remote Automatation
is enabled for Safari (see the Webkit blog). Then run npm run test:ios
iOS tests should be performed manually (see the demo folder), because Webdriver controlled Mobile Safari does not show the virtual keyboard
Ramda, and Most for the reactive functional infrastructure.
FAQs
Detects presence of the On-Screen-Keyboard in mobile browsers
The npm package on-screen-keyboard-detector receives a total of 0 weekly downloads. As such, on-screen-keyboard-detector popularity was classified as not popular.
We found that on-screen-keyboard-detector 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.