H3D API  2.4.1
StringSensor.h
Go to the documentation of this file.
1 // Copyright 2004-2019, SenseGraphics AB
3 //
4 // This file is part of H3D API.
5 //
6 // H3D API is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // H3D API is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with H3D API; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // A commercial license is also available. Please contact us at
21 // www.sensegraphics.com for more information.
22 //
23 //
27 //
29 #ifndef __X3DSTRINGSENSOR_H__
30 #define __X3DSTRINGSENSOR_H__
31 
32 
34 #include <H3D/SFInt32.h>
35 #include <H3D/SFString.h>
36 
37 namespace H3D {
38 
77  class H3DAPI_API StringSensor : public X3DKeyDeviceSensorNode {
78  public:
79 
81  StringSensor( Inst< SFBool > _deletionAllowed = 0,
82  Inst< SFBool > _enabled = 0,
83  Inst< SFNode > _metadata = 0,
84  Inst< SFString> _enteredText =0,
85  Inst< SFString> _finalText =0,
86  Inst< SFBool > _isActive = 0
87  );
88 
90  virtual void keyboardDown( int key, bool special_key);
91 
93  virtual void keyboardUp( int key, bool special_key ){
94  }
95 
103  H3DUniquePtr< SFBool> deletionAllowed;
104 
110  H3DUniquePtr< SFString> enteredText;
111 
117  H3DUniquePtr< SFString> finalText;
118 
121  };
122 }
123 
124 #endif
Contains the SFInt32 field class.
Contains the SFString field class.
Header file for X3DKeyDeviceSensorNode, X3D scene-graph node.
A StringSensor node generates events as the user presses keys on the keyboard.
Definition: StringSensor.h:77
H3DUniquePtr< SFBool > deletionAllowed
If a deletionAllowed has value TRUE, the previously entered character in the enteredText is removed w...
Definition: StringSensor.h:103
virtual void keyboardUp(int key, bool special_key)
Function called when key is released.
Definition: StringSensor.h:93
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: StringSensor.h:120
H3DUniquePtr< SFString > finalText
The finalText event is generated whenever the browser-recognized value for terminating a string is en...
Definition: StringSensor.h:117
H3DUniquePtr< SFString > enteredText
enteredText events are generated as keys which produce characters are pressed on the keyboard.
Definition: StringSensor.h:110
This abstract node type is the base type for all sensor node types which operate using key devices.
Definition: X3DKeyDeviceSensorNode.h:43
H3D API namespace.
Definition: Anchor.h:38
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194