KeySensor.h

Go to the documentation of this file.
00001 
00002 //    Copyright 2004, SenseGraphics AB
00003 //
00004 //    This file is part of H3D API.
00005 //
00006 //    H3D API is free software; you can redistribute it and/or modify
00007 //    it under the terms of the GNU General Public License as published by
00008 //    the Free Software Foundation; either version 2 of the License, or
00009 //    (at your option) any later version.
00010 //
00011 //    H3D API is distributed in the hope that it will be useful,
00012 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 //    GNU General Public License for more details.
00015 //
00016 //    You should have received a copy of the GNU General Public License
00017 //    along with H3D API; if not, write to the Free Software
00018 //    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 //
00020 //    A commercial license is also available. Please contact us at 
00021 //    www.sensegraphics.com for more information.
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

Generated on Thu Aug 24 12:38:33 2006 for H3D API by  doxygen 1.4.5