microsoft / MixedRealityToolkit-Unity

This repository is for the legacy Mixed Reality Toolkit (MRTK) v2. For the latest version of the MRTK please visit https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity
https://aka.ms/mrtkdocs
MIT License
6k stars 2.12k forks source link

ManualGazeControl arrow keys not working #7636

Closed MartinOrtiz closed 4 years ago

MartinOrtiz commented 4 years ago

In inspector for camera -> Manual Gaze Control -> Keyboard,Supported is checked and enabled.

I run more or less an empty scene with a plane and one 3D object. The mouse look works fine, but the arrow keys don't work

These are all initialized properly and are not null public AxisController KeyboardXYRotationAxisControl; public AxisController KeyboardXZRotationAxisControl; public AxisController KeyboardXYTranslationAxisControl; public AxisController KeyboardXZTranslationAxisControl;

keveleigh commented 4 years ago

Is this for the HoloToolkit component? ManualGazeControl has been replaced with ManualCameraControl and the input simulation service in MRTK.

We don't really support the HoloToolkit anymore. Offhand, I can't think of a reason why ManualGazeControl shouldn't be working the way you describe. I'd say just make sure the AxisControllers are properly assigned and also properly set (check that the AxisType is what you expect, etc)

MartinOrtiz commented 4 years ago

I am switching back and forth between HoloToolkit and the MRTK, because all the e-books only cover HoloToolKit. Plus I wanted to use it outside of both, that is, in a regular project (because the mouse look is nicely done, and if I could just get the moving part working, I would be happy).

It is very difficult to debug, because the debugging process intercepts the keystrokes as well inside of VS. The AxisType = mouse.... (it is initialized to it). Even if I disable the mouse support, and only enable the key support, it's still "mouse".''

All the AxisControllers are initialized....at first, I did not do that, but then I fixed it...and again, the mouse looking part works great,....love it....but there is no joy in HoloLand because the arrow keys do not work....

MartinOrtiz commented 4 years ago

Do I have to do anything or modify anything as far as input in the Unity 3D project settings?

keveleigh commented 4 years ago

The AxisType = mouse.... (it is initialized to it)

Sounds like you might need to update the KeyboardXYRotationAxisControl etc to be one of the keyboard settings instead of mouse.

ManualCameraControl.unity should be set up properly, to give you an idea.

Do I have to do anything or modify anything as far as input in the Unity 3D project settings?

You shouldn't need to.

MartinOrtiz commented 4 years ago

How do I move forward or backward with just the mouse? I can look around with mouse, but not move with mouse, aren't I supposed to be able to move with the mouse as well?

MartinOrtiz commented 4 years ago

if (KeyboardSupported) { ,,,,................ Vector3 keyboardXYTranslate = KeyboardXYTranslationAxisControl.GetDisplacementVector3(); ,,,,................ }

MartinOrtiz commented 4 years ago

Ugh, I accidentally "closed", how do I unclose?

MartinOrtiz commented 4 years ago

(thx) keyboardXYTranslate always returns back (0.0, 0.0, 0.0}

Vector3 keyboardXYTranslate = KeyboardXYTranslationAxisControl.GetDisplacementVector3(); results in keyboardXYTranslate = (0.0, 0.0, 0.0}

MartinOrtiz commented 4 years ago

axisType = AxisType.Mouse; axisType is initialize to mouse, and never re-assigned to anything else... What should I use to test it with keyboard? axisType = AxisType.Keyboard8426; <---- should I try this?

keveleigh commented 4 years ago

I'm not sure about moving with the mouse. I don't remember that being supported, but it's been a while since I've look at HTK.

What should I use to test it with keyboard? axisType = AxisType.Keyboard8426; <---- should I try this?

Worth trying! That should use the numpad for movement. I think WASD is an option as well. ManualCameraControl.unity should be set up properly, to give you an idea. Check the keyboard AxisControllers there.

MartinOrtiz commented 4 years ago

I will look at ManualCameraControl

MartinOrtiz commented 4 years ago

Yes, MRTK, uses the classic WASD +QE approach..... In MRTK, the WASD + QE works great, as well at the mouse looking. Would it be easy to pull out the "gaze" stuff so I could use it in a regular project? (non-AR project) For HoloToolKit, it looked easy to do that....(except for the arrow key problem)

MartinOrtiz commented 4 years ago

OK, I know what's wrong....

MartinOrtiz commented 4 years ago

I initialized the Manual Gaze Control script sc1

But forgot to initialize the Axis Controller scripts (well they were, but incorrectly)

sc2
MartinOrtiz commented 4 years ago

I don't care about using the keyboard for rotations....

But what are the correct settings for the keyboard?

MartinOrtiz commented 4 years ago

For the XY and XZ ROTATION, I set the axis types to "none"

sc3

For the XY TRANSLATION I set the axis type to "Keyboard QE"

sc4

For the XY TRANSLATION I set the axis type to "Keyboard WASD"

sc5
MartinOrtiz commented 4 years ago

To go up and/or down I use the "Q" and "E", so that's working now...

The "A" key goes left The "D" key goes right But the "W" and "S" keys go up and down, instead of forward and backward?

MartinOrtiz commented 4 years ago

Oops....I double checked...The "Q" and "E" go left and right too, not up and down....

MartinOrtiz commented 4 years ago

OK....I think I got it working correctly now...

I had to correct the "Axis 0 Destination" and the "Axis 1 Destination" for the XY and XZ translations,.

julenka commented 4 years ago

Looks like this has been resolved based on last comment in discussion