Gaia3D / mago3d-CMS

mago3D Project
http://www.mago3d.com/homepage/demo.do
Apache License 2.0
61 stars 30 forks source link

How to prevent objects from changing position? #158

Closed dcapeletti closed 5 years ago

dcapeletti commented 5 years ago

Hello, I attach two test videos in Mago3D, one using the mago3d test site and the other using the mago3D API implementation. https://peertube.video/videos/watch/eb668e7e-a9ce-4000-91b3-342bef372170 https://peertube.video/videos/watch/3b2427e5-7398-4a2c-989c-600ad0753112

In both sites, when I click on an object to get information and then start writing something for a notification, the object starts to change its position. I would like to know if it is possible to disable that behavior and how to do it.

This behavior happens with AWDS keys. I would like to prevent the object from changing position.

Thanks

shire75 commented 5 years ago

Hello.

We found that the mode, 'block moving & rotating object/building', does not block keyboard events used in moving & rotating a selected target. (There are 3 modes which control ways of moving targets. - 1. not allowing any moving/rotating 2. move/rotate a selected object 3. move/rotate a selected building - You can select one of 3 modes by API.)

So, we will fix it as soon as possible and commit.

Thanks very much for feedback this issue.

shire75 commented 5 years ago

Hello.

We fixed this issue and committed it to 'develop' branch.

But you have to keep it mind that keyboard events created during entering text into edit box will move/rotate selected target when the mode is not 'block moving & rotating object/building'. It is not in the context of API but event hooking/subclassing/propatation between html elements.

dcapeletti commented 5 years ago

Hello, thank you so much for the information you've given me. Luckily the solution was quick. I will try to merge the changes to check.

What is the name of the API function that allows you to control this?

Greetings

dcapeletti commented 5 years ago

Hello, I've made the merger of changes. I confirm that the problem has been resolved. Thanks

cheonjeongdae commented 5 years ago

Sorry for the delay. I kept busy with my work. Please refer to the following method.

stopPropagationOnInput('moveDataKey');

function stopPropagationOnInput(elementId){ document.getElementById(elementId).addEventListener('keydown',function(e) { e.stopPropagation(); }); document.getElementById(elementId).addEventListener('keyup',function(e) { e.stopPropagation(); }); }

dcapeletti commented 5 years ago

Hey, thanks for your answer. Now I understand better what the problem was about.