🎮 Unity Study/Unity

[Unity][MenuItem hotkey(shortkey)] %(ctrl, cmd), #(shift), &(alt)...

ibelieveinme 2024. 1. 24. 17:38
728x90

 

To create a hotkey, use the following special characters: % (ctrl on Windows and Linux, cmd on macOS), ^ (ctrl on Windows, Linux, and macOS), # (shift), & (alt). If no special modifier key combinations are required, the key can be given after an underscore. For example, to create a menu with the hotkey Shift+Alt+G, use "MyMenu/Do Something #&g". To create a menu with hotkey G and no key modifiers pressed, use "MyMenu/Do Something _g". Hotkey text must be preceded by a space character. <tt>"MyMenu/Do_g"</tt> won't be interpreted as hotkey, while <tt>"MyMenu/Do _g"</tt> will.

 

 

https://docs.unity3d.com/ScriptReference/MenuItem.html

 

Unity - Scripting API: MenuItem

The MenuItem attribute turns any static function into a menu command. Only static functions can use the MenuItem attribute. To create a hotkey, use the following special characters: % (ctrl on Windows and Linux, cmd on macOS), ^ (ctrl on Windows, Linux, an

docs.unity3d.com

 

728x90