From 378e69cea0b2a4d3b1272406f635f8fc9bec2359 Mon Sep 17 00:00:00 2001 From: Jonathan Olson Date: Thu, 28 Mar 2024 15:21:22 -0600 Subject: [PATCH] Adding demo for two-press delayed (multi-hot-key) behavior, and added modifierKeys docs, see https://github.com/phetsims/scenery/issues/1621 --- js/input/Hotkey.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/input/Hotkey.ts b/js/input/Hotkey.ts index 22ce443e2..fff57e341 100644 --- a/js/input/Hotkey.ts +++ b/js/input/Hotkey.ts @@ -34,6 +34,11 @@ type SelfOptions = { // activated when this hotkey is present. // // Note that the release of a modifier key may "activate" the hotkey for "fire-on-hold", but not for "fire-on-down". + // + // NOTE: This is a generalization of the normal concept of "modifier key" (https://en.wikipedia.org/wiki/Modifier_key). + // It is a PhET-specific concept that allows other non-modifier keys to be used as modifiers. + // The standard modifier keys (ctrl/alt/meta/shift) are automatically handled by the hotkey system, but this can + // expand the set of modifier keys that can be used. modifierKeys?: EnglishKey[]; // A set of modifier keys that can be down and the hotkey will still fire. Essentially ignoring the modifier