Inspect.js updated to not operate while the Create app is active

I’ve updated my version of the inspect.js scritp to not operate while the Create app is active. This, in order to avoid unexpected Alt-duplicating the entity currently being edited if you try to orbit it.

Unfortunately, the Create app still uses the Alt key for duplicating. It should really use the Shift key, IMHO.

Script details: http://ctrlaltstudio.com/hifi/inspect

2 Likes

I thought that you had a PR that would have changed the duplicate function to the Shift key? Why was that not approved?

I am not sure that just disabling inspect.js when Create is active really solves much, I guess it stops making unwanted copies but it still requires you to exit Create when you need to change the camera view.

What is so hard about changing Create to swap to Shift from Alt? For years I have been complaining about this and I’ve never been given any kind of reasonable explanation for it.

Without being told any reason for doing it the way it is, I came to the conclusion that it was deliberately done just to make it harder to use. And the only reason I could think of why this would be the case is to make it harder for people from certain other virtual worlds to make or place things in HiFi.

Various people complained about Create using the Alt key from time to time, and I lodged a bug report / feature request but it never went anywhere. Not for any particular reason as far as I know; I imagine it was more from inertia and/or other things viewed as more important to spend time on.

I tried to do some building in a domain the other day but got seriously annoyed at the duplicates that piled up, so I made the modification to at least try to improve the situation. Yes, it is a pain having to toggle Create off and on to move the camera but at least you don’t have to keep checking for duplicates.

Code-wise, I expect that changing Create’s duplicate to the Shift key wouldn’t be hard. I doubt that a PR doing this would be accepted, though: inertia and all that. It could perhaps be worth a try.

Things were done differently - inspect.js’s panning was back-to-front initially, and remember the weird grid of handles at the base of each entity? - but I don’t know that this was deliberate; it may have just been the whim of the developers at the time.

I’m thinking I might look at getting my old edit.js up and running again. The Create app really annoys me.

Could you not just have inspect.js use shift when in Create? I know it messes with inertia and what not but I use inspect.js a fair amount when in Create. I can modify it myself to make it work for me but just thought other people might also accept such a change.

Might be able to swap inspect’s use of the Alt and Shift keys. (It uses all three control keys: Alt, Shift, and Ctrl.)

Another possible way forward might be to add a proposal in the “Open-Source Project Proposals” list: change Create to use Shift key to duplicate entities, or if this isn’t acceptable (e.g., because it will annoy people who are used to using Alt) add an option to use the Shift key to duplicate.

I’ll try to have a look at these two things later today.

Getting inspect.js to work “properly” with the Create app…

It is possible to swap Alt / Shift / Ctrl keys in inspect.js.

Regarding the Create app, some change is needed no matter what keys are used in inspect.js …

A) Create uses the Shift key to display X and Z axes to move the entity along, so can’t swap Alt and Shift keys in inspect.js unless change Create to use the Ctrl key for these “railroad” axes.

B) Create doesn’t use the Ctrl key per se, so could swap Alt and Ctrl keys in inspect.js. However, would need to change Create to not translate entity if Ctrl is pressed.

C) Could retain Alt for iinspect.js if change Create to use Ctrl for duplicating entities and not translate entity if Alt is pressed.

All options require modifications to both inspect.js and the Create app.

My preferences…

  1. My first preference would be C.

  2. My second preference would be B plus have Create add a menu option, “Duplicate entities with Ctrl instead of Alt”, and make inspect.js also read the menu setting to adjust its use of keys to match. People used to using Alt to duplicate entities could have the menu option false; people used to using Alt to cam about could have the menu option true.

  3. My third preference would be B on its own.

I would not want Ctrl to be used for the copy entity function because the Ctrl key is used to orbit vertically around the mouse click point.

When clicking the left mouse button while pressing Alt and moving the mouse left and right: the camera view orbits around the click point horizontally and when moving the mouse forward and backward, the camera view zooms in and out.

When clicking the left mouse button while pressing Alt and then holding the Ctrl key down too, the camera view then orbits vertically on the click point when moving the mouse forward and backward instead of zooming.

I am using your inspect.js and also your edit.js. I don’t see any action at all when pressing the shift key. I am not sure what you mean about displaying the X and Z axes, maybe it was added after you modified the edit.js?

What ever the reason, I (and many others) would much rather have the shift key used for the copy function rather than using Ctrl and thus breaking the orbit vertical mode.

At one point I heard arguments about how it affects users in HMDs. I don’t think this really applies because there are no Alt, Ctrl or Shift keys on hand controllers and any editing done with hand controllers is inherently different than editing with a mouse and keyboard.

Shift key is part of desktop grab. It is used to constrain motion. When edit is activated everything is able to be grabbed, that is what he means.

Selecting is one thing, copying is another. Try this on your desktop: hold down Shift and click on something and drag. If you left click it moves it, if you right click you get option to move or copy.

Shift left click or shift left click drag, adds to selection. But once you shift click on what you have selected, you either are coping it or moving it.

The point I’ve been trying to make is: the reason for camera navigation is to allow for seeing things from different points of view.

To do that you need to be able to control camera zoom, and orbit in two dimensions around a clicked on object. To only do only part of it is not the solution.

And besides. How often are you going to be selecting multiple entities and copying them? Would not Ctrl C be a better choice? Ctrl C and Ctrl V are pretty much standard shortcuts for copy and paste now. Shift drag is not.

The Shift key displaying X & Z “railroad” axes is in High Fidelity’s Create app, not my old edit.js script. (My post above about getting inspect.js to work “properly” with the Create app doesn’t have anything to do with my edit.js script.) To see these axes: activate Create, click on an entity to select it and release, click-and-hold on the entity (not any of the edit handles displayed) then press the Shift key. The “railroad” axes are displayed.

All options A, B, and C include all current inspect.js behaviour (including orbiting up/down). Using “Ctrl for duplicating entities” in option C, for example, is only relevant if you have Ctrl pressed * when you mouse-down *; if you’re orbiting with inspect, Ctrl will orbit you up/down as expected and won’t duplicate the entity you’re orbiting.

Options not requiring any change to inspect.js (except reverting the change whereby it is disabled when the Create app is active) …

C: Change the Create app to use Ctrl+mouse-down to duplicate entities (instead of Alt+mouse-down), and not do anything for Alt+mouse-down.

D: Change the Create app to use Shift+mouse-down to duplicate entities (instead of Alt+mouse-down), and the Ctrl key to toggle the display the “railroad” axes (instead of the Shift key), and not do anything for Alt+mouse-down.

Perhaps it would be better to propose just these in case High Fidelity says “OK” to one of them.

Make the Create app work nicely with inspect.js and derivatives:

http://roadmap.highfidelity.com/open-source-project-proposals/p/make-the-create-app-work-nicely-with-inspectjs-and-derivatives

2 Likes