Forum

Manipulate Text object and intercept all keyboard entries

30 January 2019 02:22
Hello, I am trying to make a kind of 3D terminal.
I have a blender Text object that represent my terminal in a scene, and I would like to make it act as a console.

First I have to intercept all keyboard entries to make them act on the terminal, leaving only the mouse to interact with the 3D world.
So far I can see that at least the P letter always act as PAUSE for animations, and arrows are used to navigate in the world. Can I suppress it and intercept all keyboard entries to use them programmatically ?

Then I would like to dynamically change the text content of the Text object to reflect the typing. I can see how to do it with anchors, but not with a text object.

Sam
30 January 2019 21:35
This post describes how to disable the P-Key.

To "intercept keyboard entries", you can either disable camera controls or immobilize the camera (no panning, no movement).

Using the Blender text object is not recommended for multiple reasons, and I don't think you can change its text dynamically. So, instead of using mesh objects for letters, there are two better ways to do it:

1. Put out the letters in a DIV overlayed over the canvas. This is also how anchors work and rather simple. Of course, this only works if you have a fixed, straight-on (flat) camera view on the terminal screen.

2. Draw the letters on an image texture which is then projected on the terminal's mesh. This way, the letters will be part of the 3D scene, so you can allow camera movement. There already is a code example for this, the Canvas Texture. And here are guys discussing its code: https://www.blend4web.com/en/forums/topic/3696/
 
Please register or log in to leave a reply.