Jump to content

Binding console commands with key


photo

Recommended Posts

Hi,

I'm using Unigine 2.16.1
During initialization of the editor, I'm trying in Unigine Script to bind a key to a command. To do that, i'm following the console documentation and do the command "bind" with the function : 

engine.console.run("bind F10 world_reload");
to bind the command world_reload to the key F10

Once the editor is loaded, in the section console_bindings from the file default.user 

image.png.550de32d63e76201861011cf81f8bd64.png

And with the command ls I have :

image.png.4d5305bdae73cea2ba67672e1d1649b9.png

But nothing happen when i'm pressing F10

Moreover, by pressing F8, this command is used toggle render_show_landscape_terrain_vt_streaming, (I can't find the definition of that bind anywhere) and it will change correctly the value of render_show_landscape_terrain_vt_streaming in the same default.user file as above.


Any idea of what I am missing or doing wrong ?


Thanks in advance!

Pierre

Link to comment

Hello!

Actually, it will not work that way since the editor has its own bindings configuration which is stored separately and can be accessed through the settings menu (Settings -> Editor -> Hotkeys). Please navigate to the "Common" tab as shown in the image below to assign any desired key for the "Reload World" command.

image.png

The bindings you are trying to use are meant to be used only from the runtime application.

Thanks!

  • Thanks 1
Link to comment
52 minutes ago, Pierre_Bultingaire said:

Thanks for the answer!

Is there a way to add custom console command to the hotkeys in a custom preset ?

Unfortunately, currently it is not possible to customize shortcut commands in the editor of the current SDK version. However, there is good news: an API is currently being developed to add this feature in future versions. How important is it for you to have this feature now?

Thanks!

Link to comment
1 hour ago, bmyagkov said:

Unfortunately, currently it is not possible to customize shortcut commands in the editor of the current SDK version. However, there is good news: an API is currently being developed to add this feature in future versions. How important is it for you to have this feature now?

Thanks!

Ok sounds good, i'll leave it for now and come back to you later if I need.

Thanks!

  • Thanks 1
Link to comment
×
×
  • Create New...