"Fossies" - the Fresh Open Source Software Archive

Member "tvnserver-2.0.4/rfb/RfbKeySym.h" (3 Aug 2011, 2510 Bytes) of archive /windows/misc/tvnserver-2.0.4-src.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "RfbKeySym.h" see the Fossies "Dox" file reference documentation.

    1 // Copyright (C) 2008, 2009, 2010 GlavSoft LLC.
    2 // All rights reserved.
    3 //
    4 //-------------------------------------------------------------------------
    5 // This file is part of the TightVNC software.  Please visit our Web site:
    6 //
    7 //                       http://www.tightvnc.com/
    8 //
    9 // This program is free software; you can redistribute it and/or modify
   10 // it under the terms of the GNU General Public License as published by
   11 // the Free Software Foundation; either version 2 of the License, or
   12 // (at your option) any later version.
   13 //
   14 // This program is distributed in the hope that it will be useful,
   15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
   16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   17 // GNU General Public License for more details.
   18 //
   19 // You should have received a copy of the GNU General Public License along
   20 // with this program; if not, write to the Free Software Foundation, Inc.,
   21 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
   22 //-------------------------------------------------------------------------
   23 //
   24 
   25 #ifndef __RFBKEYSYM_H__
   26 #define __RFBKEYSYM_H__
   27 
   28 #include "RfbKeySymListener.h"
   29 #include "util/Keymap.h"
   30 
   31 class RfbKeySym
   32 {
   33 public:
   34   RfbKeySym(RfbKeySymListener *extKeySymListener);
   35   virtual ~RfbKeySym();
   36 
   37   void sendModifier(unsigned char virtKey, bool down);
   38 
   39   void processKeyEvent(unsigned short virtKey, unsigned int addKeyData);
   40   void processCharEvent(WCHAR charCode, unsigned int addKeyData);
   41   void processFocusRestoration();
   42   void processFocusLoss();
   43 
   44   void sendCtrlAltDel();
   45 
   46 private:
   47   void clearKeyState();
   48 
   49   void releaseMeta();
   50   void restoreMeta();
   51   void releaseModifier(unsigned char modifier);
   52   void restoreModifier(unsigned char modifier);
   53   void releaseModifiers();
   54   void restoreModifiers();
   55 
   56   bool isPressed(unsigned char virtKey);
   57 
   58   unsigned char distinguishLeftRightModifier(unsigned char virtKey,
   59                                              bool isRightHint);
   60 
   61   void checkAndSendDiff(unsigned char virtKey, unsigned char state);
   62 
   63   virtual void sendKeySymEvent(unsigned int rfbKeySym, bool down);
   64 
   65   virtual void sendVerbatimKeySymEvent(unsigned int rfbKeySym, bool down);
   66 
   67   RfbKeySymListener *m_extKeySymListener;
   68 
   69   unsigned char m_viewerKeyState[256];
   70 
   71   unsigned char m_serverKeyState[256];
   72   bool m_leftMetaIsPressed;
   73   bool m_rightMetaIsPressed;
   74 
   75   Keymap m_keyMap;
   76   bool m_allowProcessCharEvent;
   77 };
   78 
   79 #endif