Search Unity

Shortcut Manager Feature Preview

Discussion in 'Editor Workflows' started by smcclelland, Sep 11, 2018.

  1. smcclelland

    smcclelland

    Administrator

    Joined:
    Dec 19, 2016
    Posts:
    147
    Hi all, we'd like your feedback on the Shortcut Manager - a way for Unity users to visualise, customise, and get an overview of their hotkeys in the editor. For an overview of this new feature, please take a look at the following video for details :



    We're working on getting a shareable build out to everyone but in the meantime we wanted to at least give you an overview to get some insights, have you raise questions, and iterate on any feedback you have.

    Thanks!
     
  2. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    789
    Looks nice, I really like that it's visual. One thing I think that would be nice is that if you select a key that's already assigned (at the top) it takes you to it (at the bottom). This way if someone is new to unity and go in and select keys it will show them what it's for as well as users who assigned keys that they don't remember what they do. Thinking about it that would only work for single keys and for shortcuts that use multiple keys this won't work.

    Maybe make it a mode? (A toggle somewhere) that when selected it will use something like the shift + alt sticky mode (when you select a key it highlights the others it was combined with then you can select 1-2 more keys to display the shortcut assigned) Sounds kinda messy here so I hope the point gets across well and it could be implemented and not be as confusing.
     
    Norimoo likes this.
  3. derianmeyer

    derianmeyer

    Joined:
    Nov 17, 2016
    Posts:
    2
    Looks great! Thanks for the update. I don't have any suggestions yet... until I start using it :)
     
  4. smcclelland

    smcclelland

    Administrator

    Joined:
    Dec 19, 2016
    Posts:
    147
    @Grimreaper358 Great feedback! So to clarify, you'd like us to provide the ability to find the associated commands to a specific hotkey or a set of keys (A, Shift+A, CMD+Shift+A)?

    @derianmeyer Absolutely looking forward to getting a live build in everyones hands to play with :)
     
    Lars-Steenhoff and AlanMattano like this.
  5. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    789
    Yes, exactly that I was thinking.
     
  6. smcclelland

    smcclelland

    Administrator

    Joined:
    Dec 19, 2016
    Posts:
    147
    Awesome - I've got a few ideas I can throw around and post back a few mockups to see if they jive with what you're after :)
     
  7. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    789
    Sweet, looking forward to that as well as using it.
     
  8. Shrubokrant

    Shrubokrant

    Joined:
    Oct 2, 2016
    Posts:
    80
    That's great! I almost added such a feature to my plugin MonKey Commander, so I'm glad I didn't then :D
    Does this include menu items, and is it possible for plugins to access these shortcuts from code, or add their own to the list?
     
  9. smcclelland

    smcclelland

    Administrator

    Joined:
    Dec 19, 2016
    Posts:
    147
    It does indeed include menu items as well as an API that lets you describe your own contexts, specify hotkeys within your custom context, etc. I'll dig up a link to the API documentation and attach it for your input :D
     
  10. Shrubokrant

    Shrubokrant

    Joined:
    Oct 2, 2016
    Posts:
    80
    sounds really great! I was waiting for such a thing for a long time, thanks a lot ^^
     
  11. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    Looks great!

    Nice, that's really good. Is it also possible to specify shortcuts to static functions without having them on a MenuItem? There's some shortcuts I want available at all times that has an entry in the menu simply to give them a shortcut. If I could just bind the function without creating a menu entry, that would clear a lot of menu clutter.
     
    AlanMattano likes this.
  12. smcclelland

    smcclelland

    Administrator

    Joined:
    Dec 19, 2016
    Posts:
    147
    Yup, you can bind to the function directly through the API or this interface if you wanted to.
     
    AlanMattano likes this.
  13. sschoener

    sschoener

    Joined:
    Aug 18, 2014
    Posts:
    73
    Great, I'm really looking forward to this feature!
    Something that I am wondering about: Currently, a lot of Unity's internal 'user actions' (let's call them that for lack of a better term) are not easily accessible to code. For example, there is no way to get *all* entries from the File menu from the main menu bar simply because they are not added to that method from managed code and the MenuItem attribute. Will this new feature also mean that there will be easier access to this? My point is that in an ideal world, each action that can be triggered via the mouse can also be potentially accessed via a hotkey and via code. This would require scripts to be able to *also* access which context is currently active and what actions are valid in that very context. Using this, it would be able to more easily create alternative methods to navigate and work with the editor. (Speech recognized editor commands, anyone? ;) =P )
     
  14. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    You can execute any menu item through EditorApplication.ExecuteMenuItem:

    Code (csharp):
    1. EditorApplication.ExecuteMenuItem("Help/About Unity");
    Of course, getting direct access to a tree of the menus so you could reorder/change the built-in ones as you want would be very nice.
     
    sschoener likes this.
  15. sschoener

    sschoener

    Joined:
    Aug 18, 2014
    Posts:
    73
    Thank you Baste :) I am aware of this, but it doesn't generally help you to discover actions. My tools make use of that feature heavily, but I am not sure whether it is stable w.r.t. localization of the editor (will that also open the help in the Chinese version of the editor? I have no clue! :( ) and it also is quite support-heavy (i.e. I have to update the tool for every new non-MenuItem action). Additionally, there are actions that may be valid in the current situation but they may *only* be reachable via hotkey right now. My case is one for a uniform interface that largely does not distinguish on how the editor is being controlled :)
     
    SugoiDev and Baste like this.
  16. leo-carneiro

    leo-carneiro

    Unity Technologies

    Joined:
    Sep 1, 2011
    Posts:
    49
    @sschoener
    That is the general direction we want to go, we would like for all of our UI to go through some kind of command system, but we are not there yet. That was not the primary goal of the Shortcut Manager, but it does gets us one step closer, since now there is a way to declare an action, enumerate them and bind to them in a very generic way.

    The Shortcut Manager does have a public API that lets you enumerate all available actions, and let you programatically bind to those actions, but at the moment there is no API to execute a given action.

    Do you have a specific goal in mind for having access to those commands? While its not something we are focusing in at the moment, it is something we discuss a lot internally, and would be great to understand your use case so whenever we start work on this area we can make sure to take your use case in consideration :)

    Cheers!
     
  17. sschoener

    sschoener

    Joined:
    Aug 18, 2014
    Posts:
    73
    @leo-carneiro Thanks for your reply :) I have built a small command-prompt for myself where I can just type in whatever I want to do and it will suggest possible actions, display their hotkeys etc. This saves a lot of time when looking for something specific in the menus ("Where did they put the Package Manager in the new organization of the menus?") and greatly helps to learn hotkeys (the first ten times you type it in, but after that, you will likely know the hotkey). Think Ctrl+Shift+P from VSCode, but for Unity :) (also super slick, fast, responsive, with non-blocking asset search, scene search etc. :) I'm very excited about it right now! ;) )
    This means that I'd ideally want to execute those actions programmatically, yes, and have access to their name, associated hotkey (if any) and ideally a short description (optional). Additionally, it would be great if there was a way to either only list the commands that are valid within a given context (not necessarily the current one, maybe?) or filter them accordingly. :)

    Edit: I only now realize that this post makes excessive use of emotes/smileys. Take it as my attempt to make sure that my posts come across as benevolent and constructive as I always intend them to be :)
     
    SugoiDev and Baste like this.
  18. leo-carneiro

    leo-carneiro

    Unity Technologies

    Joined:
    Sep 1, 2011
    Posts:
    49
    @sschoener thanks for sharing, it does sounds like an interest project!

    We have taken notes so whenever we are ready to take the next step in this area we can make sure that your use case is represented :)

    As soon as we have the Shortcut Manager API documentation online I will be posting here to make sure you can give us feedback on it as well.
     
  19. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,501
    Feedback for @smcclelland and @leo-carneiro . Include mouse buttons.
    Provide the ability to associate commands to the middle mouse button and a specific hotkey. (Example: "F" and/or "Middle Mouse").

    One thing that I'm always fighting for is to include the "F" focus looking at the selected object using the middle mouse button as a universal standard because is a big time-saving in a 3D environment.

    When you press and hold the middle mouse button you pan as usual.
    When you press fast the middle mouse button you focus as if F is press.

    I also suggest assigning by default "F" focus command to the middle mouse.

    By the way, Focus look-at command action is always too far from the selected object.
    Is it possible to add a zoom slider so that the user can decide the amount of zoom (or camera dolly)?

    Ps: Provide the ability to associate commands when double click middle and left mouse to expand mouse capacity.
    Actual focus zoom
    UnityFocusZoom.png
    Suggested focus zoom
     
    Last edited: Oct 31, 2018
    DeoSsin and Lars-Steenhoff like this.
  20. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    Yes to the above, ability to customise mouse clicks and modifiers.

    And also allow Wacom tables to use pressure finally.

    So finally we are going to get what Maya has had for 10 years.

    A way for artist to work the way they want. to customise the workflow to the way they want.
     
  21. smcclelland

    smcclelland

    Administrator

    Joined:
    Dec 19, 2016
    Posts:
    147
    Thanks for the feedback!

    Mouse commands are always interesting from a customization perspective, though difficult to pull off outside of hardware vendor applications or third-party tools. I'm curious to understand more of why you see the frame command on MMB as faster or more accessible than 'F'?

    The focus bug is something we're aware of and I'll bug the team for that area to see if we can make it a bit more stable and predictable.

    Generally, mouse keys are restricted from accessing systems like these as they're core interaction models or standards. Maya, for example, doesn't allow the remapping of its navigation or mouse buttons, that needs to be performed outside of the application either at the OS level or through hardware vendor tools. To clarify though, what sort of things do you want to customize through clicks? If there are conflicts at the mouse level, is there a way you'd want to resolve those?

    @Lars-Steenhoff for pressure sensitivity with Wacom we're looking at the new input system as a way of exposing access to those sorts of things. Our hope is through the new input system we can route things like pressure sensitivity from the Wacom interface, through the system to the editor tools.
     
    Lars-Steenhoff likes this.
  22. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    Yes the new input system can be a solution for tablet pressure,
    I really want to ask that unity needs leads the way here.

    So that terrain painting is using pressure by default and there is no relying on third parties to come with a solution.

    I'm using a plugin right now, but this one does not work in 2019 anymore and is deprecated now.
    It can be used for painting terrain and tree height for example

     
  23. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,501

    The best option and less distractive is to use the LMB double-clicking the object to "Frame (centre) selection".
    Much faster than selecting the object and then after looking the keyboard press [F]. And use the MMB for ContexMenu or custom.

    MMB to frame centre selected and focus the game object is a good compromise.

    Difficult to explain with my poor English; Story. Each 3D app was using different key "F"-"Frame (centre) selection", Tab, spacebar, "L" (Look at), double-clicking the object, using the star MMB and moving up, etc... changing software tool was hard to follow and remember (Is still like this).
    In a 3D environment, I was pressing all the time
    • "Frame (centre) selection" or Look At
    • Do the last action (Rhino )
    • And using the star with actions (Alias, Maya)
    But "Frame (centre) selection" was the only one that was not using the mouse buttons. So in my workflow, I migrate it to the MMB. And after that, I never turn that back because was so comfortable: Building cars and sailboats there was no time. It was intuitive, simple to do and I became much faster and relax. It becomes intuitive when you use it when there is a long run without using the keyboard. When you are good or you are in contemplation mode, you do not press control-z to undo and your hand sometimes finish (looking other users) holding the head, holding a glass, a baby (my case), other smoking. The F (and L in other soft) are far away from the control-key where usually is the small finger. Using only the right hand for a long run, let you feel more freedom to do other with your left. In some soft, the MMB is there doing nothing. When you are just contemplating thinking about what you have done and elaborating what you are going to do you are in a relaxed stage moving the environment using only the mouse. Is very disconcerting to look for and find the F with the left hand (some users look the keyboard). In the 90s smokers have also more problems.

    That was one of the reasons I emigrated out of Alias then Maya. Is a great tool but is old and not updated. I know a lot of programmes that allow the remapping of its navigation or mouse buttons. The new Unity Input?

    Unity Functions? Or link it to a Unity Key? Allowed Asset store content creators to be creative.

    A toggle close to the mouse option to turn off that particular MB with info note explanation of the possible conflicts at the mouse level?
     
    Last edited: Jan 31, 2019
  24. leo-carneiro

    leo-carneiro

    Unity Technologies

    Joined:
    Sep 1, 2011
    Posts:
    49
    As Shawn said thanks for the feedback, and please keep it coming.

    While we go through them, I just would like to let everybody following this thread know that the Shortcut Manager is included in the 2019.1 alpha that can be found here: https://unity3d.com/beta/2019.1

    The API docs can be found at https://docs.unity3d.com/2019.1/Doc...rence/ShortcutManagement.ShortcutManager.html

    We are working on the manual at the moment, once we have something that's ready to be shared I will also be putting a link here.

    Cheers!
     
    Last edited: Nov 6, 2018
    AlanMattano and benoitd_unity like this.
  25. arvzg

    arvzg

    Joined:
    Jun 28, 2009
    Posts:
    619
    I just upgraded to 2018.3b10 and something called
    ShortcutManagerEditor/ConflictResolver.cs 
    has stopped me from overriding Ctrl+Alt+F (Move to View) behaviour to use my own code.

    Code (CSharp):
    1. Shortcut conflict detected for key binding Ctrl+Alt+F.
    2. Please resolve the conflict by rebinding one or more of the following shortcuts:
    3. GameObject/Move To View 2D (Ctrl+Alt+F)
    4. GameObject/Move To View (Ctrl+Alt+F)
    5. UnityEditor.EditorApplication:Internal_CallGlobalEventHandler()
    Previously in 2018.2 I had some editor code that adds a new MenuItem with a shortcut:

    Code (CSharp):
    1. [MenuItem("GameObject/Move To View 2D %&f", false, 10)]
    And the priority of 10 must be higher than the priority of the default MoveToView, as this successfully overridden it and called my MoveToView2D code instead.

    But in 2018.3 ConflictResolver.cs seems to have broken this :(

    Any possible solutions?
     
  26. leo-carneiro

    leo-carneiro

    Unity Technologies

    Joined:
    Sep 1, 2011
    Posts:
    49
    Can you submit a bug? I don't think there is anything you can do in 18.3 at the moment to workaround that... In 19.1 you will be able to remap any menu item, so you would be able to remap the builtin "GameObject/Move To View" to something else, or even nothing.
     
    arvzg likes this.
  27. arvzg

    arvzg

    Joined:
    Jun 28, 2009
    Posts:
    619
    Will do, thanks
     
  28. sunrisebacon

    sunrisebacon

    Joined:
    Jul 15, 2017
    Posts:
    16
    I'm new to Unity and this is the first feature I was looking for.
    Please also add a way to configure mouse bindings.

    Thanks for making such a great tool!
     
  29. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,501
    Select Frame & Orbite

    @smcclelland Actually, it's not possible to relax in the 3D environment because you need to press Alt + LMB to rotate and orbit around. You need the two sides of your brain ;)

    If I'm able to customise the mouse buttons, I will use the scene view to inspect the 3D game object just using only the right hand and mouse. So that I do not use the left hand at all. I call this contemplative mode. It is very relaxing using just one hand.

    • I move MMB to [F] frame selected, look at the GO
    • I will move that Orbit function to the RMB to orbit around that game object

    1. LMB: select game object
    2. MMB: frame center or look at
    3. RMB: Orbite around
    A Flythrough mode switcher can help to go from Contemplating Orbit mode to Flythrough mode.

    Ps: Another alternative is to take out the Alt key from Orbite combination and just use the LMB when dragging to Orbite around. This prevents on selecting things by accident. And use the shift as usual of box selecting?
     
    Last edited: Feb 1, 2019
  30. Ziflin

    Ziflin

    Joined:
    Mar 12, 2013
    Posts:
    132
    I saw context mentioned above, but no description. We have several
    [MenuItems]
    that we're using for shortcuts inside just the scene view. Because MenuItems are global we are unable to use single-key shortcuts as they may interfere with other UI controls (text boxes, etc). So could someone explain if this is addressed and what would be required code-side to fix it -- or if we should be using something besides MenuItem?

    (Also there was a small bug introduced in 2018.3 with MenuItems in that if the key is specified as an uppercase letter, the input system things you should press Shift, but the actual menu entry does not show that shift is required. Using lower case letters works as intended, but I thought I'd mention it.)
     
  31. _karl

    _karl

    Joined:
    Feb 6, 2017
    Posts:
    13
    The Shortcut Manager is super cool and intuitive. :)

    Another question [maybe off-topic]:
    Are there plans to make parts of the Shortcut feature available for "non-editor" use also?
    Big parts of the code (at least that I have seen in the UnityCsReference) is good structured and capsuled, so that it could be used in my own unity program as well. But the fact that all the code is in the UnityEditor namespace makes the difference, because that would not be compiled when I make a build.

    Hopefully I have made clear what I meant.. :confused:
     
  32. kalineh

    kalineh

    Joined:
    Dec 23, 2015
    Posts:
    241
    Some initial feedback from a quick check profiler -- it's slow to scan everything on startup. It would be nice to not pay the cost of this scan if not using the system, or disable completely for startup time gains for larger projects.

    We internally ban LINQ because it's pretty slow and generates a lot of garbage, I do see a lot of it in deep profile stacks on editor code. It's usually pretty trivial to replace with non-LINQ that does the same except faster. There's probably an easy 10s or 100s ms startup time savings trimming out some the LINQ code.
     

    Attached Files:

    SugoiDev likes this.
  33. SugoiDev

    SugoiDev

    Joined:
    Mar 27, 2013
    Posts:
    395
    Oh man, I feel you.

    There's quite a few issues with Unity's performance that arise purely from scanning all assemblies/types or all directories/files. And LINQ being incorrectly used. I've seen string comparisons being done hundreds of thousands of times where they should be done at most a few thousand times. Also, most of those issues scale at best linearly in time with either number of types or the number of files. This makes Unity suffer a lot with medium to large projects. It's such a pity.
     
  34. smcclelland

    smcclelland

    Administrator

    Joined:
    Dec 19, 2016
    Posts:
    147
    So contexts basically allow Editor Windows to register their own contexts and respond to events only when that context is active (i.e. the window has focus). At some point, we'd like to expand this to things like tools and possibly menus so if you have any requirements or requests feel free to add them here.

    Hmmm... interesting. Do you have bug ID we could look at or point a developer to? And it's only in 2018.3 for you?
     
  35. Ziflin

    Ziflin

    Joined:
    Mar 12, 2013
    Posts:
    132
    @smcclelland - Sorry I don't think I ever submitted the bug with using an uppercase letter for [MenuItem], but I believe it's still there in the later 2018.3 builds.

    I think the context sounds like it could handle most of our issues. Trying to get a single key (with no modifiers like Ctrl/Alt) to work for our tools while *only* working in the scene view is quite painful right now. So if there was a way to say do something like:

    [MenuItem("GameObject/Snap Object To Ground _g", "SceneView")]

    Where "SceneView" is a context that is active only when the SceneView has focus, then that would certainly simplify things considerably and allow binding of keys that are not currently possible.
     
  36. dotsquid

    dotsquid

    Joined:
    Aug 11, 2016
    Posts:
    224
    Thanks for such a great feature!
    As far as I understand, the only way to register a shortcut via script is to use a ShortcutAttribute. And there is no other way to do that if, for instance, I don't really know the number of shortcuts I need?
    You may ask how is that possible that I don't know the exact number of shortcuts.
    Take a look at my tiny tool to control timeScale in editor https://github.com/dotsquid/ChronoHelper In the extended version (not public yet) it's possible to create any number of control buttons. And it would be great if I could map a shortcut for each button. But the only way I see with the current system is to have some number (lets say 10) of predefined static methods which will either trigger a correspondind button if it does exist or do nothing. This may work but it does not look really flexible.
    I totally realize that my situation is quite specific, but any comment would be appreciated.
     
  37. smcclelland

    smcclelland

    Administrator

    Joined:
    Dec 19, 2016
    Posts:
    147
    All good, I'll loop back with our QA team and see if we've got an internal case or still repro in the later 18.3 and 19.1 builds.

    Yeah, that's the idea at least behind having a context system is you can basically register against a given situation/context that the shortcut would be relevant. It makes contextual tools much more user-friendly because you're not hitting keys wondering if you're going to get a conflict. Another one for me to loop back with the dev team on :)

    -s
     
  38. @smcclelland Hi, I've just noticed, that the Hierarchy features (rename game object, duplicate game object and new subscene from selection) are missing from the Shortcut editor. Possible because they do not have main menu entries. Could you please take a look if it's possible to add them so we can customize their shortcut when the focus is on the hierarchy? Or maybe I'm missing something. But if they are not there they always occupy the F2, CTRL-D shortcuts (rename, duplicate respectively)?
     
  39. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
    Hey there, just found out about the Shortcut Manager (because the default shortcut of Quicksearch doesn't work on German keyboard layout).

    This lead me here, because it seems (from the first look at least) that not much thought has been put into localization here yet. I'm on a Windows system which is set to English, but I have a german keyboard with german keyboard layout. The shortcut manager presents itself with a preview of an english keyboard though:

    upload_2019-5-13_11-1-13.png

    After seeing this, I suspected issues and played a bit with assigning shortcuts. Basically most of the non-standard ones (e.g. +#'*`´^) show a wrongly assigned text in the "Shortcut" field. For example, in the case above, what I pressed on my keyboard was "Alt + #" and it just shows as "Alt + /".

    Also, multiple keys result in "Alt + \" being displayed:
    ^ (key with ^°)
    < (key with <>|)

    This also results in me not being able to assign ^ and < to different shortcuts (I press ^ and Unity says "the key Alt + \ is assigned to ... " (note that the wording is incorrect, it's not a "key" its a combination of keys)

    The deeper issue here is, of course, that some keys are not available on specific keyboard layouts and thus it's always a pain to deal with localization. I do hope that you have a plan here to
    a) show the right keyboard layout
    b) have some nice and hopefully automatic re-assignment of keys to different locales
    c) potentially show devs which keys they should ideally not use as default, because it won't work on a different layout

    Example for an issue (that's why I'm here):
    QuickSearch for Unity didn't work for me. The default shortcut is Alt + '. The letter does exist on a german keyboard (it's shift + #), but the shortcut still didn't work.
    I went into Shortcut Manager to set a new shortcut but noted that I couldn't use "Alt + <" because Unity said that "Alt + \ is already used". After some tinkering I found out it's because I have another shortcut on "Alt + ^" and that maps to the same "Alt + \" for some reason.

    I'm a UX designer, and I'm gonna use that example in lectures - if that's not a good example of a bad user journey I don't know what is :)
     
    EricLampi likes this.
  40. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
  41. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,188
    How can I assign one of the modifier keys as the one and only key for a shortcut? For example, I would like to implement "Hold Shift and Mouse Left Button Drag" for my custom editor tool, but it looks as if I can only assign a modifier together with a second regular keycode.
     
  42. Flying_Banana

    Flying_Banana

    Joined:
    Jun 19, 2019
    Posts:
    29
    I'm playing around with the new system, and encountered the pain with the context. I'm trying to extend the tilemap editor by associating shortcuts with specific brushes.

    First of all the document on context is quite lacking, I got a warning message when I tried to use my brush's editor as the context, that context must be null, a subclass of EditorWindow, or implementer of IShortcutToolContext.

    IShortcutToolContext is internal, so I can't use it.

    Taking a step back, I guess having the shortcut share the context of the tilemap palette editor would be fine too. Sadly most of Unity's editor windows are marked as internal, therefore inaccessible to my editor script.

    Would be nice if IShortcutToolContext is visible.
     
  43. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
    As a follow-up to my post about internationalization above - just randomly stumbled upon the "Unicode Common Locale Data Repository" which happens to have lists of everything keyboard-key-mapping related - e.g. an actual list of which characters are available on which keyboards and vice versa.
    I think this could enable giving hints to "Shortcut Creators" (e.g. people deciding on default shortcuts for their assetstore packages) about on which / how many international keyboards a specific default shortcut should work.
    Link: http://cldr.unicode.org/index/charts/keyboards
     
    Last edited: Jun 24, 2019
  44. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    So I can't find any examples out there on how to use the API version of this.

    EDIT: Apparently the few examples are littered in a couple of select topics, but no complete examples exist.

    So for anyone else having trouble with figuring this out too, just remember the "using UnityEditor.ShortcutManagement;" and the respective shortcut attribute and context can be null for a general shortcut press.
     
    Last edited: Aug 1, 2019
  45. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    Hi kalineh, I'll fix that performance issue ASAP. Our call to
    AssetDatabase.FindAssets("t:DefaultAsset")
    is probably returning to many assets to then be filtered by extension. Also LINQ doesn't help either. In most cases it should take 0 time because most project don't even have .mode files, so most user are paying an enumeration that is not even worth it :(

    We'll fix that for the next release and backport the fix up to 2019.2.

    Out of curiosity can you do a search/query to the asset database
    t:DefaultAsset
    in your project and tell me how many results you are getting back? Looking at your image it seems to around ~10000?

    Thanks,
     
    Last edited: Jul 31, 2019
  46. MrLucid72

    MrLucid72

    Joined:
    Jan 12, 2016
    Posts:
    992
    Hmm, how come there's no option to ignore the conflict mgr for that combo?

    Eg, I have this done on purpose:

    Let's say I WANT CTRL+S to both save and run my own file (ScriptableObjects don't write to disk as often as they should upon changes - a bit buggy). This would resolve all my issues.

    However, this stupid window keeps coming up that I can't ignore. We should be given the option to ignore this specific combo (eg, we know and we want this to happen).

    (Off-topic: That low-res, pixelized yellow warning icon is sorta hideous haha - but I think that's removed in 2019.2?)
     
    Lars-Steenhoff likes this.
  47. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,252
    @jonathans42 Can you provide some simple examples of adding custom shortcuts for our own editor methods via the API?

    i.e. How do I add a new ShortCutAttribute to the current profile once I have a reference to the ShortcutManager.instance?
     
    Last edited: Aug 7, 2019
  48. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    Hi, do you mean without binding a [Shortcut(...)] attribute to to a method? You would like to do late binding of shortcuts?
     
  49. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    Is it intentional that custom shoutcuts doesn't work when the Game View has focus?
     
  50. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514