File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
ui/src/main/java/jme3utilities/ui Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -254,6 +254,25 @@ public void bind(String actionName, String usHotkeyName) {
254254 addActionName (actionName );
255255 }
256256
257+ /**
258+ * Bind the named action to the named hotkey, but don't map it yet. Any
259+ * existing binding for the hotkey is removed.
260+ *
261+ * @param actionName the name of the action (not null)
262+ * @param localHotkeyName the hotkey's local name (not null)
263+ */
264+ public void bindLocal (String actionName , String localHotkeyName ) {
265+ Validate .nonNull (actionName , "action name" );
266+ Validate .nonNull (localHotkeyName , "local hotkey name" );
267+ boolean hotkeyExists = (Hotkey .findLocal (localHotkeyName ) != null );
268+ Validate .require (hotkeyExists , "the local name of a hotkey" );
269+
270+ Hotkey hotkey = Hotkey .findLocal (localHotkeyName );
271+ String usHotkeyName = hotkey .usName ();
272+ hotkeyBindings .put (usHotkeyName , actionName );
273+ addActionName (actionName );
274+ }
275+
257276 /**
258277 * Test whether this input mode binds the specified hotkey.
259278 *
You can’t perform that action at this time.
0 commit comments