public void RegisterShortcut(KeyCode key, string description, ShortcutItem.ShortcutFunction myFunctionPtr) { if (m_items.ContainsKey(key)) { if (DebugConsoleWindow.DeveloperMode) { Debug.Log("Attempting to register an already used shortcut key " + key); } return; } m_items.Add(key, new ShortcutItem(key.ToString(), description, myFunctionPtr)); m_itemsList.Add(m_items[key]); }
public void RegisterEditorShortcut(KeyCode key, string description, ShortcutItem.ShortcutFunction myKeyDownFunctionPtr, ShortcutItem.ShortcutFunction myKeyUpFunctionPtr = null) { if (m_editorShortcutsDict.ContainsKey(key)) { if (DebugConsoleWindow.DeveloperMode) { Debug.Log("Attempting to register an already used editor shortcut key " + key); } return; } m_editorShortcutsDict.Add(key, new ShortcutItem(key.ToString(), description, myKeyDownFunctionPtr, myKeyUpFunctionPtr)); m_editorShortcutsList.Add(m_editorShortcutsDict[key]); }
public void RegisterEditorShortcut(bool showOnList, EventModifiers modifiers, KeyCode key, string description, ShortcutItem.ShortcutFunction myKeyDownFunctionPtr, ShortcutItem.ShortcutFunction myKeyUpFunctionPtr = null) { if (m_editorShortcutsDict.ContainsKey(key)) { if (m_editorShortcutsDict[key].ContainsKey(modifiers)) { if (DebugConsoleWindow.DeveloperMode) { Debug.Log("Attempting to register an already used editor shortcut key " + key); } return; } } else { m_editorShortcutsDict.Add(key, new Dictionary <EventModifiers, ShortcutItem>()); } ShortcutItem item = new ShortcutItem(((modifiers == EventModifiers.None || modifiers == EventModifiers.FunctionKey) ? key.ToString() : modifiers + " + " + key), description, myKeyDownFunctionPtr, myKeyUpFunctionPtr); m_editorShortcutsDict[key].Add(modifiers, item); if (showOnList) { m_editorShortcutsList.Add(item); } }
public void RegisterEditorShortcut(bool showOnList, KeyCode key, string description, ShortcutItem.ShortcutFunction myKeyDownFunctionPtr, ShortcutItem.ShortcutFunction myKeyUpFunctionPtr = null) { if (m_editorNoModifiersShortcutsDict.ContainsKey(key)) { if (DebugConsoleWindow.DeveloperMode) { Debug.Log("Attempting to register an already used editor shortcut key " + key); } return; } ShortcutItem item = new ShortcutItem(key.ToString(), description, myKeyDownFunctionPtr, myKeyUpFunctionPtr); m_editorNoModifiersShortcutsDict.Add(key, item); if (showOnList) { m_editorShortcutsList.Add(item); } }