Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

ui5-lib-hotkeys

Latest version: v0.2.1

Overview

Last scanned
23 Nov 2026
Published
23 Nov 2026
npm package Publisher: wridge
0 Stars
0 Forks
4 Versions
315 Downloads
TypeScript Repo language

Scan summary

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.

  • Releases: 4 versions; the latest 3 were published within 3 days (21–23 Nov 2026).
  • Findings: No rules fired in version 0.2.1.
  • Downloads: 315 downloads.

Versions

4 versions published
Versions and the rules that fired in each
VersionPublishedStatus
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

No rules fired in 0.2.1

Findings

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.

README

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.

Table of Contents

  • Features
  • Installation
    • 1. Installed package + UI5 Tooling (default)
    • 2. Source package + UI5 Tooling transpilation
    • 3. Static middleware escape hatch
  • Quick Start
  • API Stability
  • HotkeyManager
    • Registration
    • Registration Options
    • Registration Handle
    • Registration Group
      • Groups and Lifecycle
      • Reducing Boilerplate with a Controller Extension
      • Scope Stacking
      • Popup Overlay Pattern
      • Router Integration (Group-Level)
      • FLP Component Pattern
    • Scope Management
    • Router Integration
    • Unhandled Key Callback
    • Target Elements
    • Suspend Guard
  • Sequences
  • KeyStateTracker
  • HotkeyRecorder
  • Validation
  • Utility Functions
  • Library Enums & Constants
    • ConflictBehavior Examples
  • Type-safe Hotkey Strings
  • Further Reading
  • Troubleshooting
  • Compared to sap.ui.core.CommandExecution
  • When NOT to Use This Library
  • License

Features

Core

  • Document-level shortcuts with no focus requirement, unlike sap.ui.core.CommandExecution
  • Scope stack for view-scoped, dialog-scoped, or fragment-scoped shortcuts
  • Two-pass matching where scoped handlers always take priority over global ones
  • Smart input suppression that auto-suppresses single-key shortcuts in text fields but allows Ctrl/Cmd combos
  • Cross-platform Mod key that resolves to Cmd on macOS, Ctrl on Windows/Linux
  • Conflict detection with configurable behavior: warn, error, replace, or allow
  • AltGr guard that prevents false matches on Windows international keyboards

Integrations

  • Router integration for automatic scope management tied to route changes
  • Dialog suppression with lazy-loaded sap.m.InstanceManager (no hard sap.m dependency)
  • Target element binding for element-scoped hotkeys

Advanced

  • Multi-key sequences (e.g., G then E) with configurable timeout
  • Hotkey recorder for "press a key" settings UIs
  • Held-key state tracking with macOS stuck-key fix
  • Hotkey validation with browser and SAP Fiori conflict warnings

Developer Experience

  • Type-safe Hotkey string type with IDE autocomplete for known key combinations
  • Live option updates via handle.setOptions() without re-registering
  • Platform-aware display formatting with native modifier symbols on macOS
  • Proper UI5 enum registration via DataType.registerEnum()

Robustness

  • IME composition guard for CJK input method events
  • Shadow DOM support via composedPath() for accurate event target detection
  • Key repeat filtering (on by default)
  • Callback error isolation (errors in handlers don't crash the manager)

Installation

Install from npm:

npm install ui5-lib-hotkeys

In this monorepo, dependencies are managed via npm workspaces (npm install at the root).

The package ships:

  • the UI5 source project (src/, ui5.yaml) for source-first development
  • the prebuilt distributable under dist/resources/ui5/hotkeys/
  • build metadata under dist/.ui5/build-manifest.json

That 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.

1. Installed package + UI5 Tooling (default)

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.hotkeys here, not the npm package name ui5-lib-hotkeys.
  • includeDependency is a build concern. ui5 serve can 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>
2. Source package + UI5 Tooling transpilation

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.libraries entry is required for ui5.hotkeys; this is a custom UI5 dependency, not a framework library.
  • Keep using the manifest.json dependency shown above.
  • If your app build should include the library resources in its own dist/, keep builder.settings.includeDependency: [ui5.hotkeys] in addition to the transpile setup.
3. Static middleware escape hatch

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:

  • This is mainly a dev-server/runtime option.
  • If you need the library resources inside the app build output as well, prefer mode 1 with 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.

Quick Start

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();

API Stability

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.

HotkeyManager

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
Registration
// 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).

Registration Options

OX Radar and Response Center

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.

Where it’s listed

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).

  • npm ui5-lib-hotkeys

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

Microsoft's Official agent framework Hijacked
AI & VibeSec

BREAKING: Hijacked Releases of Microsoft’s Official agent-framework Steals Azure and CI Credentials

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

Frame 2085668439 (1)
Group 1261154229