Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Viewport2Din3D problem #562

Open
pietru2004 opened this issue Nov 6, 2023 · 3 comments
Open

Viewport2Din3D problem #562

pietru2004 opened this issue Nov 6, 2023 · 3 comments

Comments

@pietru2004
Copy link
Contributor

when you interact with Viewport2Din3D the keyboard events are still used in it...
it is bit problematic for this use case #463

@Malcolmnixon
Copy link
Collaborator

There are other use cases such as passthrough VR keyboards where you do want the keys to go through - perhaps this should be an option on the Viewport2Din3D.

As a test could you see if the following change to viewport_2d_in_3d.gd solves your issue. If so we may want to consider adding a boolean "keyboard_input" property:

# Handler for input eventsd
func _input(event):
	if not (event is InputEventMouseButton) and not (event is InputEventKey):
		$Viewport.push_input(event)

@pietru2004
Copy link
Contributor Author

@Malcolmnixon this seams to fix my issue and the pointer seams to still work

Malcolmnixon added a commit to Malcolmnixon/godot-xr-tools that referenced this issue Nov 25, 2023
This PR fixes issue GodotVR#562 by allowing software control over whether keyboard or gamepad input is mapped into a Viewport2Din3D. Additionally this rejects all other types of input such as mouse, touch, gesture, screen-drag, etc.
@Malcolmnixon
Copy link
Collaborator

A put up a PR which allows better control and also rejects all other unwanted inputs.
image

I decided to support gamepad inputs as there seems to be a minor amount of interest to build virtual game-systems where legacy 2D games are played in VR.

Malcolmnixon added a commit to Malcolmnixon/godot-xr-tools that referenced this issue Nov 26, 2023
This PR fixes issue GodotVR#562 by allowing software control over whether keyboard or gamepad input is mapped into a Viewport2Din3D. Additionally this rejects all other types of input such as mouse, touch, gesture, screen-drag, etc.
Malcolmnixon added a commit that referenced this issue Nov 26, 2023
This PR fixes issue #562 by allowing software control over whether keyboard or gamepad input is mapped into a Viewport2Din3D. Additionally this rejects all other types of input such as mouse, touch, gesture, screen-drag, etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants