While using TB, I've often found myself accidentally overwriting recently-edited entity properties with nonsense values like sd, es, fs, etc. from the movement keys.
This happens while moving the mouse back to the viewport after editing an entity field with the intent to immediately start moving around the scene: If I press a movement key before the viewport is focused with a mouse-down, the entity field gets overwritten.
What's worse is that it's easy to continue editing and focus other entities without realising that a given field has changed until I spot an error in either QBSP's compile output or the level itself during testing.
Having looked into the EntityAttributeTable code, it's evident that this behaviour is intentional since shortcuts like UV lock have special-case handling.
I realise this might be a me problem, but it's not one I've encountered in any other 3D editor as most of them either force the user to focus the viewport with RMB in order to move the camera, or defocus property fields after editing. I've started using Esc to defocus the field manually, but still find myself mangling properties on occasion.
TrenchBroom 2019.6 Build v2019.6 Release
(Also affects current master branch)
I'm happy to look at implementing something if this ends up being considered.
Initially I was going to suggest adding an 'input guard' checkbox in preferences that would filter all keys except for return, delete, backspace and the arrow keys when the entity editor is focused, but that doesn't seem like a very elegant way to fix it.
One route might be to employ some focus-follows-mouse type logic similar to the one employed by split viewports. Since TB doesn't force the user to hold RMB in order to move, handing focus back to the viewport when the mouse leaves the sidebar would solve the problem and also speed up workflow a little by allowing for immediate movement.
I haven't seen a lot of reports from other people having similar problems. If this is a problem that happens to only few people, I'd rather not change the current behavior (or add an option to change it). If it is something that bothers more people, we can consider it.
For info this happens to me ALL THE TIME, but I haven't reported it cause I was waiting to see if it was still relevant in the QT version (since it's a big UI overhaul).
As Shfty described, dropping in some movement keys into target/targetnames is really common, I've seen others complain about it occasionally as well.
No idea for an elegant fix though.
Ok, good to know it affects more people. I see the following possible solutions:
Responding to your suggestions in order :
I agree options 1 and 2 are not very good. I just listed them for completeness sake. Option 3 is most viable, maybe with the modifications you proposed. We'll have to see.
Re. each option:
I actually implemented this locally (filtering all keys save for arrows, return and row delete shortcuts) before opening this issue. It's functional, but makes things feel clunky when you mouse back over to the viewport and have all the alphanum keys do nothing until you click.
I agree that tying fly mode to RMB would be a bit cumbersome, since it's nice for fine adjustments.
Playing devil's advocate on this one: I feel like adding overrides specifically for the navigation keys also has the potential to confuse users. While movement key overwrites are the most common outcome, it would be a fairly specific extra rule to keep in mind, and doesn't cover other keys that the user may press during the mouse move such as tool switching, show/hide, etc.
A more top-level solution could be to offer a focus-follows-mouse preference with None, Viewport Only and All options:
I try to avoid adding such preferences if at all possible. Often they are the result of not taking the time to find an optimal solution to a particular problem such as this. If we can find a good solution that feels natural to most users, then we don't need any further preferences for this. I think that that would be preferrable.
Related: https://github.com/kduske/TrenchBroom/issues/2540
Regarding whether or not the first click should be consumed, this was an intentional change that I introduced because often times, you want to be able to give focus to the map view to make certain shortcuts work without changing the selection.
My initial request to change the first click consumption: https://github.com/kduske/TrenchBroom/issues/2042
I commented on discord:
Personally I think "focus follows mouse" at least for the map views/texture browser would be interesting to try:
if the map view is unfocused, you can mouse over it and do a keyboard shortcut without changing the selection
the other possibility is just you have to click to focus the map view, and the click also does a selection. This is pretty common (UE4 does this iirc)
with the assumption that it's less annoying to undo a selection change than have to click twice all the time
Blender does focus follows mouse
Agree I would rather not have preferences for this, we should try a solution and test it (post 2020.1).
Of all the solutions so far, I find "focus follows mouse" the most natural, and I think it also fixes the original issue best.
Yeah agreed