00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00027
00029 #ifndef __X3DKEYSENSOR_H__
00030 #define __X3DKEYSENSOR_H__
00031
00032
00033 #include "X3DKeyDeviceSensorNode.h"
00034 #include "SFInt32.h"
00035 #include "SFString.h"
00036
00037 namespace H3D {
00038
00085 class H3DAPI_API KeySensor : public X3DKeyDeviceSensorNode {
00086 public:
00087 typedef enum {
00088 F1 = 1,
00089 F2 = 2,
00090 F3 = 3,
00091 F4 = 4,
00092 F5 = 5,
00093 F6 = 6,
00094 F7 = 7,
00095 F8 = 8,
00096 F9 = 9,
00097 F10 = 10,
00098 F11 = 11,
00099 F12 = 12,
00100 HOME = 13,
00101 END = 14,
00102 PGUP = 15,
00103 PGDN = 16,
00104 UP = 17,
00105 DOWN = 18,
00106 LEFT = 19,
00107 RIGHT = 20
00108 } ActionKeys;
00109
00111 KeySensor( Inst< SFBool> _enabled = 0,
00112 Inst< SFNode> _metadata = 0,
00113 Inst< SFBool> _isActive = 0,
00114 Inst< SFInt32> _actionKeyPress = 0,
00115 Inst< SFInt32> _actionKeyRelease = 0,
00116 Inst< SFBool> _altKey = 0,
00117 Inst< SFBool> _controlKey = 0,
00118 Inst< SFBool> _shiftKey = 0,
00119 Inst< SFString> _keyPress = 0,
00120 Inst< SFString> _keyRelease = 0
00121 );
00122
00124 virtual void glutKeyboardUp( int stroke,
00125 int modifiers,
00126 bool special_key );
00127
00129 virtual void glutKeyboardDown( int stroke,
00130 int modifiers,
00131 bool special_key );
00132
00139 auto_ptr< SFInt32> actionKeyPress;
00140
00147 auto_ptr< SFInt32> actionKeyRelease;
00148
00150 auto_ptr< SFBool> altKey;
00151
00153 auto_ptr< SFBool> controlKey;
00154
00156 auto_ptr< SFBool> shiftKey;
00157
00164 auto_ptr< SFString> keyPress;
00165
00172 auto_ptr< SFString> keyRelease;
00173
00175 static H3DNodeDatabase database;
00176 };
00177 }
00178
00179 #endif