Fly navigation like in the editor in application

The AWSD keys should be automatically supported by the TCastleWalkNavigation .

See https://github.com/castle-engine/castle-engine/blob/master/src/transform/castlecameras.pas#L2906 for standard keys set up by the TCastleWalkNavigation .

You can always assign/change them manually too, by a line like MyWalkNavigation.Input_Jump.Assign(keyQ). (As it happens, Input_Jump is a bit special: it is for jumping when Gravity=true, or for flying up when Gravity=false. Similar for Input_Crouch.)

That said, from your other thread ( Antialiasing in TCastleControl on Delphi VCL Form? - #2 by michalis ) I guessed you may be using TCastleControl with VCL (in the context of this thread). And I tested, noticed and fix a bug related to this just now: Fix receiving keys like AWSD in TCastleControl on VCL · castle-engine/castle-engine@7ba299a · GitHub . We had some unfinished TODOs specifically for TCastleControl with VCL .

So, everything should work for you with new CGE. Please give Jenkins a few hours to perform automatic tests and then this version will be available for download from Download | Castle Game Engine . You can watch it by observing this page: Comparing snapshot...master · castle-engine/castle-engine · GitHub . When it will no longer show the commit “Fix receiving keys like AWSD in TCastleControl on VCL”, it means that commit is now part of CGE downloads.

P.S. In case of related question: To handle specifically arrow keys correctly, remember you have to call MyCastleControl.PreviewFormKeyDown, see examples/delphi/vcl. This is necessary specifically for arrow keys and space, which are handled in a special way by WinAPI and thus VCL. This hack is not necessary for TCastleControl on FMX.

1 Like