Scan your whole stack
From OX Research Newsroom
Are you using ui5-lib-hotkeys?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.2.1
ui5-lib-hotkeys was last scanned on 23 Nov 2026 at version 0.2.1. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.2.1 LATEST | 23 Nov 2026 | No rules fired |
| 0.2.0 | 22 Nov 2026 | No rules fired |
| 0.1.1 | 21 Nov 2026 | No rules fired |
| 0.1.0 | 13 Sep 2026 | Not shown |
Findings for v0.2.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.2.1; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
Part of the ui5-keyboard monorepo. See also: ui5-lib-kiosk-keyboard and kiosk-keyboard-webc.
Declarative keyboard shortcut management for SAPUI5/OpenUI5 applications.
[!IMPORTANT] UI5 compatibility Declared floor: UI5 1.136, a long-term-maintenance (LTS) release and the lowest version SAP's UI5 tooling accepts in
manifest.json. The package is built, type-checked, and tested against 1.136. True implementation floor: UI5 1.120. The library only uses APIs available since 1.120 (DataType.registerEnum(),Lib.init({ apiVersion: 2 })), so apps pinned to an older LTS down to 1.120 work too.Lib.init()is available from 1.118, so it does not raise the floor.
A UI5 TypeScript library (ui5.hotkeys) providing document-level keyboard shortcuts with scope-based activation, cross-platform modifier normalization, multi-key sequences, hotkey recording, and proper UI5 lifecycle integration.
sap.ui.core.CommandExecutionCore
sap.ui.core.CommandExecutionMod key that resolves to Cmd on macOS, Ctrl on Windows/LinuxIntegrations
sap.m.InstanceManager (no hard sap.m dependency)Advanced
G then E) with configurable timeoutDeveloper Experience
Hotkey string type with IDE autocomplete for known key combinationshandle.setOptions() without re-registeringDataType.registerEnum()Robustness
composedPath() for accurate event target detectionInstall from npm:
npm install ui5-lib-hotkeys
In this monorepo, dependencies are managed via npm workspaces (npm install at the root).
The package ships:
src/, ui5.yaml) for source-first developmentdist/resources/ui5/hotkeys/dist/.ui5/build-manifest.jsonThat gives you 3 supported consumption modes. No project shim is required.
Before choosing a mode, declare the library in your app manifest.json:
{
"sap.ui5": {
"dependencies": {
"libs": {
"ui5.hotkeys": {}
}
}
}
}
Ensure your app's minUI5Version (under sap.ui5.dependencies) is at least 1.136, the libraries' declared LTS floor. The code only needs 1.120, so an app pinned to an older LTS down to 1.120 also works.
Recommended for published/runtime usage.
Install the package, keep the library in manifest.json, and let UI5 Tooling resolve it from node_modules.
npm install ui5-lib-hotkeys
If your app build should copy the library resources into the app dist/, add the UI5 project name to builder.settings.includeDependency:
builder:
settings:
includeDependency:
- ui5.hotkeys
[!NOTE]
- Use the UI5 project name
ui5.hotkeyshere, not the npm package nameui5-lib-hotkeys.includeDependencyis a build concern.ui5 servecan resolve the installed UI5 dependency without it.- The packaged build manifest exists so the distributable can be reused as a build result in dist-based setups instead of always rebuilding from source.
If you deploy the built app to a plain static server while bootstrapping UI5 from CDN, also map the library namespace to the copied resources/ folder:
<script
id="sap-ui-bootstrap"
src="https://sdk.openui5.org/resources/sap-ui-core.js"
data-sap-ui-resource-roots='{
"my.app": "./",
"ui5.hotkeys": "./resources/ui5/hotkeys/"
}'
data-sap-ui-on-init="module:sap/ui/core/ComponentSupport"
data-sap-ui-async="true"
></script>
Recommended for monorepos and local development when you want to work against the library source instead of the prebuilt distributable.
Enable dependency transpilation in both the build task and dev server middleware:
builder:
customTasks:
- name: ui5-tooling-transpile-task
afterTask: replaceVersion
configuration:
transpileDependencies: true # source-mode only: transpiles the library's shipped src/*.ts (dist needs none)
transformTypeScript:
allowDeclareFields: true # match the library build; keeps the TS controls' typed class fields
server:
customMiddleware:
- name: ui5-tooling-transpile-middleware
afterMiddleware: compression
configuration:
transpileDependencies: true
transformTypeScript:
allowDeclareFields: true
[!NOTE]
- No
framework.librariesentry is required forui5.hotkeys; this is a custom UI5 dependency, not a framework library.- Keep using the
manifest.jsondependency shown above.- If your app build should include the library resources in its own
dist/, keepbuilder.settings.includeDependency: [ui5.hotkeys]in addition to the transpile setup.
Use this when you want explicit runtime serving from the dependency's distributable and do not want the dependency to participate in your app's UI5 dependency resolution.
npm install -D ui5-middleware-servestatic
server:
customMiddleware:
- name: ui5-middleware-servestatic
afterMiddleware: compression
mountPath: /resources/ui5/hotkeys/
configuration:
npmPackagePath: ui5-lib-hotkeys/dist/resources/ui5/hotkeys
Notes:
includeDependency, or copy the resources explicitly as part of your deployment process.Lazy loading via "lazy": true and Lib.load() is supported but typically unnecessary; the library is lightweight (no CSS, no heavy dependencies) and best loaded eagerly at app startup.
import MessageToast from "sap/m/MessageToast";
import HotkeyManager from "ui5/hotkeys/HotkeyManager";
import type RegistrationGroup from "ui5/hotkeys/RegistrationGroup";
// In your Component.init():
const manager = new HotkeyManager();
// Create a group and wire up router integration
const hotkeys: RegistrationGroup = manager.createGroup();
hotkeys.enableRouterIntegration(this.getRouter());
// Register a global shortcut
hotkeys.register(
"Mod+S",
(event) => {
// Save logic - Cmd+S on Mac, Ctrl+S on Windows/Linux
MessageToast.show("Saved!");
},
{ description: "Save" },
);
// Register a view-scoped shortcut (scope = route name)
hotkeys.register(
"F5",
() => {
this.onRefresh();
},
{ scope: "detail", description: "Refresh detail" },
);
// Handles returned by the group are normal handles
const handle = hotkeys.register("Mod+D", () => nav(), { description: "Nav" });
handle.setOptions({ enabled: () => model.getProperty("/isDirty") });
// Clean up everything in one call (e.g., in Component.exit)
manager.destroy();
Recommended stable consumer imports:
import HotkeyManager from "ui5/hotkeys/HotkeyManager";
import type Router from "sap/ui/core/routing/Router";
import type RegistrationGroup from "ui5/hotkeys/RegistrationGroup";
import type KeyStateTracker from "ui5/hotkeys/KeyStateTracker";
import type HotkeyRecorder from "ui5/hotkeys/HotkeyRecorder";
import { formatForDisplay } from "ui5/hotkeys/format";
import { ConflictBehavior, GLOBAL_SCOPE, UnhandledReason } from "ui5/hotkeys/library";
import type { Hotkey, KeyboardDispatchGuard, KeyStateTrackerApi, ScopeHandle } from "ui5/hotkeys/types";
HotkeyRecorder is exported as a type and returned by manager.createRecorder(); its constructor is internal. manager.getKeyStateTracker() returns a KeyStateTrackerApi (the read-only tracker interface in ui5/hotkeys/types); the backing KeyStateTracker class is constructed internally.
Advanced modules are available but may change without a semver-stable guarantee: anything under ui5/hotkeys/internal/* is internal-only, and the re-export entry points (ui5/hotkeys/parse, ui5/hotkeys/match, ui5/hotkeys/platform, ui5/hotkeys/validate, ui5/hotkeys/constants) are non-stable, with ui5/hotkeys/format the supported exception.
The central manager that owns all keyboard shortcut registrations, DOM listeners, and scope state.
import HotkeyManager from "ui5/hotkeys/HotkeyManager";
const manager = new HotkeyManager();
The constructor takes an optional Platform (new HotkeyManager(Platform.Mac)) that drives Mod resolution and platform-specific dispatch guards; it defaults to detectPlatform().
| Method | Description |
|---|---|
register(hotkey, callback, options?) |
Register a shortcut or sequence (space-separated keys), returns a handle |
createGroup() |
Create a registration group for collective cleanup |
pushScope(scopeId) |
Push a scope onto the stack, returns a ScopeHandle (since 0.2.0) |
popScope(scopeId) |
Remove the topmost entry with this ID, wherever it sits |
getActiveScope() |
Get the current top-of-stack scope |
getScopeStack() |
Get a snapshot of the full scope stack (bottom-to-top) |
resetToGlobalScope() |
Pop all non-global scopes in one call |
getRegistrations() |
Get all active registrations (hotkeys and sequences) |
getRegistrationsForScope(scopeId) |
Filter registrations by scope (hotkeys and sequences) |
findRegistrations(predicate) |
Find registrations matching a predicate function |
getPlatform() |
Get the detected platform |
suspendDispatch(reason?) |
Suspend dispatch, returns a guard handle |
isDispatchSuspended() |
Whether dispatch is currently suspended |
createRecorder(options) |
Create a HotkeyRecorder instance |
getKeyStateTracker() |
Access the held-key state tracker |
setUnhandledHandler(callback) |
Set callback for unhandled key events |
addGenericRootId(id) |
Register an element ID as a generic focus root |
removeGenericRootId(id) |
Remove a previously registered generic root ID |
destroy() |
Full teardown: removes DOM listeners, finalizes all groups, clears all state |
// Simple key
manager.register("Escape", (event) => dialog.close());
// Modifier combo (Mod = Cmd on Mac, Ctrl on Windows/Linux)
manager.register("Mod+S", (event) => save());
// Multiple modifiers
manager.register("Ctrl+Shift+K", (event) => deleteLines());
// With full options
manager.register(
"F5",
(event, details) => {
console.log(`Hotkey "${details.hotkey}" fired in scope "${details.scope}"`);
refresh();
},
{
scope: "editor",
description: "Refresh editor",
enabled: () => !model.getProperty("/isLoading"),
ignoreRepeat: true,
},
);
The callback receives the KeyboardEvent and a HotkeyCallbackDetails object:
| Field | Type | Description |
|---|---|---|
hotkey |
string |
The hotkey string as registered (for a sequence, its steps joined by a space) |
parsedHotkey |
ParsedHotkey |
The parsed key and modifier flags (for a sequence, those of its last step) |
scope |
string |
The scope of the registration that fired |
Whitespace separates the steps of a sequence, so it cannot appear inside a single combination: "Ctrl+S" is one hotkey, "Ctrl+K Ctrl+S" is a two-step sequence, and "Ctrl + S" splits into the steps Ctrl, + and S, which register() rejects because the step Ctrl names no key.
Keyboard layouts. Matching follows the character the key types (event.key), not its position on the board. On a German QWERTZ keyboard Mod+Z fires on the key labelled Z, and on a French AZERTY keyboard the unshifted digit-row key that types & does not fire the hotkey "1". The physical key (event.code) is consulted only where a modifier rewrites the character: macOS Option+letter (Option+D types ∂, and still matches Alt+D), and a digit with Shift or Option held (Shift+4 types $, and still matches Shift+4).
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.