Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to modify the keyboard control keys in the secondary development of TE

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

Xiaobian to share with you TE secondary development keyboard control keys how to modify, I believe most people still do not know how, so share this article for everyone's reference, I hope you read this article after a lot of harvest, let's go to understand it together!

Some operations such as forward and backward in TE can be realized by keyboard. These keys are defined by default in TE. In secondary development, these keys can be replaced.

Default keyboard action key list (help documentation):

A: Increase speed until maximum forward speed is reached

A: Double acceleration

Z: Reduce speed until maximum reverse speed is reached

Z: double deceleration

: Stop flying (speed set to zero)

S: Move up

S: Rapid rise

X: Move down

X: Rapid descent

Keyboard up and down arrows control camera tilt

Up arrow key: camera or flight angle up

Down arrow key: camera or fly angle down

Keyboard left and right arrow keys to control the direction of the aircraft

Left arrow key: Flight camera direction to left

Right arrow key: Flight camera direction right

Q: Slide left/zoom out

Q: Quickly slide left/zoom out

W: Slide right/zoom in

W: Swipe right quickly/zoom in

To realize TE control by the key defined by yourself, in the secondary development, TE's 3D window has an event by default: OnKeyboardMessage. In the program, realize this event. Take CS code as an example. Click on the back of the event on the winform window, and the backend code can realize the event.

private void axTE3DWindow1_OnKeyboardMessage(object sender, AxTerraExplorerX._ ITE3DWindowEvents_OnKeyboardMessageEvent e)

{

e.message = 258;

//This sentence is very important, set true, that is, do not implement the default keyboard keys

e.pbHandled = true;

//custom move according to e.keyCode value

switch (e.keyCode)

{

//keyboard A operation, to move left

case 65:

IPosition6 pos = sgworld.Navigate.GetPosition(AltitudeTypeCode.ATC_TERRAIN_RELATIVE);

double x = pos.Altitude * 0.2;

IPosition6 newpos = pos.Move(x, 270 + pos.Yaw, 0);/

newpos.Pitch = pos.Pitch;

newpos.Yaw = pos.Yaw;

sgworld.Navigate.SetPosition(newpos);

break;

//Other keyboard operations...............................................................................................

}

This way you can customize the operation of keyboard keys, the only requirement is that those up and down left and right movement, have to use their own methods to write.

The above is "TE secondary development keyboard control keys how to modify" all the content of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report