H3D::StringSensor Class Reference
[X3D node classes.]

A StringSensor node generates events as the user presses keys on the keyboard. More...

#include <H3D/StringSensor.h>

Inheritance diagram for H3D::StringSensor:

Inheritance graph

List of all members.

Public Member Functions

 StringSensor (Inst< SFBool > _deletionAllowed=0, Inst< SFBool > _enabled=0, Inst< SFNode > _metadata=0, Inst< SFString > _enteredText=0, Inst< SFString > _finalText=0, Inst< SFBool > _isActive=0)
 Constructor.
virtual void keyboardDown (int key, bool special_key)
 Function called when key is pressed.
virtual void keyboardUp (int key, bool special_key)
 Function called when key is released.

Public Attributes

auto_ptr< SFBooldeletionAllowed
 If a deletionAllowed has value TRUE, the previously entered character in the enteredText is removed when the backspace key is entered.
auto_ptr< SFStringenteredText
 enteredText events are generated as keys which produce characters are pressed on the keyboard.
auto_ptr< SFStringfinalText
 The finalText event is generated whenever the browser-recognized value for terminating a string is entered.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.


Detailed Description

A StringSensor node generates events as the user presses keys on the keyboard.

A StringSensor node can be enabled or disabled by sending it an enabled event with a value of TRUE or FALSE. If the StringSensor node is disabled, it does not track keyboard input or send events.

enteredText events are generated as keys which produce characters are pressed on the keyboard. The value of this event is the UTF-8 string entered including the latest character struck. The set of UTF-8 characters that can be generated will vary between different keyboards and different implementations.

If a deletionAllowed has value TRUE, the previously entered character in the enteredText is removed when the backspace key is entered. If deletionAllowed has value FALSE, characters may only be added to the string; deletion of characters shall not be allowed. Should the browser-recognized value for deleting the preceding character is entered, it shall be ignored.

The finalText event is generated whenever the browser-recognized value for terminating a string is entered; in H3D this is the enter key. When this recognition occurs, the finalText field generates an event with value equal to that of enteredText. After the finalText field event has been generated, the enteredText field is set to the empty string but no event is generated.

When the user begins typing, the StringSensor sends an isActive event with value TRUE. When the string is terminated, the StringSensor sends an isActive event with value FALSE.

The StringSensor is not affected by its position in the transformation hierarchy.


Member Data Documentation

If a deletionAllowed has value TRUE, the previously entered character in the enteredText is removed when the backspace key is entered.

Access type: inputOutput Default value: SFBool = TRUE
StringSensor_deletionAllowed.dot

Referenced by keyboardDown(), and StringSensor().

enteredText events are generated as keys which produce characters are pressed on the keyboard.

Access type: outputOnly StringSensor_enteredText.dot

Referenced by keyboardDown().

The finalText event is generated whenever the browser-recognized value for terminating a string is entered.

Access type: outputOnly StringSensor_finalText.dot

Referenced by keyboardDown().


The documentation for this class was generated from the following files:

Generated on Fri Nov 7 10:31:06 2008 for H3D API by  doxygen 1.5.7