aws / lumberyard

Amazon Lumberyard is a free AAA game engine deeply integrated with AWS and Twitch – with full source.
Other
2.02k stars 540 forks source link

Allow modifing shortcuts for moving in the Perpective window #486

Open guidra-rev opened 4 years ago

guidra-rev commented 4 years ago

Hi,

Currently French developers can't walk around in the perspective window. The default shortcuts are WASD, this works well for QWERTY keyboards, but other layouts, such as AZERTY use ZQSD instead. The editor allows exporting keyboard shortcuts, but it does not export the ones described.

Please allow the modification of these shortcuts, or maybe even better, make a preset for different keyboard layouts.

AMZN-alexpete commented 4 years ago

Thank you for your feedback @guidra-rev, to work around this issue in the meantime you can modify the keys in CRenderViewport::ProcessKeys() https://github.com/aws/lumberyard/blob/04063d6e326eccc20512820c173664f5cdc076f0/dev/Code/Sandbox/Editor/RenderViewport.cpp#L3112

If you assign keys that are already bound to other functionality you may need to change those bindings as well.

protypangel commented 3 years ago

Thank you for your feedback @guidra-rev, to work around this issue in the meantime you can modify the keys in CRenderViewport::ProcessKeys()

https://github.com/aws/lumberyard/blob/04063d6e326eccc20512820c173664f5cdc076f0/dev/Code/Sandbox/Editor/RenderViewport.cpp#L3112

If you assign keys that are already bound to other functionality you may need to change those bindings as well.

I did it but that doesnt work : image image image

AMZN-alexpete commented 3 years ago

@guidra-rev Q is already used for other inputs (to move the camera 'down' in the viewport), did you change the code in https://github.com/aws/lumberyard/blob/8c5e39005bb9a3fa0b63afb6ab8d114f3a197846/dev/Code/Sandbox/Editor/RenderViewport.cpp#L3425 ? What happens if you use an unused key?

hultonha commented 3 years ago

Hey @guidra-rev and @protypangel!

Not sure if you have seen the news about O3DE (successor to Lumberyard) but in it we have a new camera system where you can tweak the controls (it's not currently exposed to the UI unfortunately, but we have a new thing called the 'Settings Registry' that you can edit and add custom controls.

In that file (stored in json format) you can add overrides for key values - the file is located here <project-root>/Registry/editorpreferences.setreg - you can see all the values listed in this file EditorViewportSettings.cpp (e.g. constexpr AZStd::string_view CameraTranslateForwardIdSetting = "/Amazon/Preferences/Editor/Camera/CameraTranslateForwardId"; - this defaults to keyboard_key_alphanumeric_W but can be overridden in the settings file like to...

{
    "Amazon": {
        "Preferences": {
            "Editor": {
                "Camera": {
                      "CameraTranslateForwardId": "keyboard_key_alphanumeric_Q"
                      ... etc...
                }
            }
        }
    }
}

In future we're going to expose an Editor for this but it is technically possible now. Let me know if you have any questions