tkeymap.cpp
上传用户:tigerk9
上传日期:2020-03-10
资源大小:237k
文件大小:2k
源码类别:

Telnet客户端

开发平台:

Visual C++

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //Telnet Win32 : an ANSI telnet client.
  3. //Copyright (C) 1998-2000 Paul Brannan
  4. //Copyright (C) 1998 I.Ioannou
  5. //Copyright (C) 1997 Brad Johnson
  6. //
  7. //This program is free software; you can redistribute it and/or
  8. //modify it under the terms of the GNU General Public License
  9. //as published by the Free Software Foundation; either version 2
  10. //of the License, or (at your option) any later version.
  11. //
  12. //This program is distributed in the hope that it will be useful,
  13. //but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. //GNU General Public License for more details.
  16. //
  17. //You should have received a copy of the GNU General Public License
  18. //along with this program; if not, write to the Free Software
  19. //Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. //
  21. //I.Ioannou
  22. //roryt@hol.gr
  23. //
  24. ///////////////////////////////////////////////////////////////////////////
  25. /////////////////////////////////////////////////////////
  26. //     Class TkeyMap - Key Mappings                    //
  27. //                   - kept in an array container      //
  28. //     originally part of KeyTrans.cpp                 //
  29. /////////////////////////////////////////////////////////
  30. #include "tkeymap.h"
  31. KeyMap::KeyMap(DWORD state, DWORD code): map(0,0,sizeof(TKeyDef)),
  32.                                          key(NULL,state,code) {};
  33. KeyMap::KeyMap(TKeyDef&tk):map(0,0,sizeof(TKeyDef)){
  34.   key = tk;
  35. };
  36. KeyMap::KeyMap(TKeyDef&tk, string& t):map(0,0,sizeof(TKeyDef)), orig(t){
  37.   key = tk;
  38. };
  39. int KeyMap::operator==(const KeyMap & t) const{
  40.     return key == t.key;
  41. };
  42. KeyMap& KeyMap::operator = (const KeyMap& t){
  43.      key = t.key;
  44.      map = t.map;
  45.      orig = t.orig;
  46.      return (*this);
  47. };
  48. #ifndef __BORLANDC__
  49. bool operator<(const KeyMap &t1, const KeyMap &t2) {
  50. return t1.key < t2.key;
  51. }
  52. #endif
  53. KeyMap::~KeyMap() {
  54. };