Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123 lines
3.4 KiB

  1. //#--------------------------------------------------------------
  2. //
  3. // File: SAKeypadController.cpp
  4. //
  5. // Synopsis: This file holds the implementation of the
  6. // CSAKeypadController class
  7. //
  8. // History: 11/15/2000 serdarun Created
  9. //
  10. // Copyright (C) 1999-2000 Microsoft Corporation
  11. // All rights reserved.
  12. //
  13. //#--------------------------------------------------------------
  14. #include "stdafx.h"
  15. #include "ldm.h"
  16. #include "SAKeypadController.h"
  17. /////////////////////////////////////////////////////////////////////////////
  18. // CSAKeypadController methods
  19. //++--------------------------------------------------------------
  20. //
  21. // Function: LoadDefaults
  22. //
  23. // Synopsis: This is the ISAKeypadController interface method
  24. // through which default keys codes are set
  25. //
  26. // Arguments: none
  27. //
  28. // Returns: HRESULT - success/failure
  29. //
  30. // History: serdarun Created 11/15/2000
  31. //
  32. // Called By: ldm service
  33. //
  34. //----------------------------------------------------------------
  35. STDMETHODIMP CSAKeypadController::LoadDefaults()
  36. {
  37. // TODO: Add your implementation code here
  38. int i = 0;
  39. while(i < iNumberOfKeys)
  40. {
  41. arbShiftKeys[i] = FALSE;
  42. if ( i == 0 )
  43. arbShiftKeys[i] = TRUE;
  44. i++;
  45. }
  46. arlMessages[0] = VK_TAB;
  47. arlMessages[1] = VK_TAB;
  48. arlMessages[2] = VK_LEFT;
  49. arlMessages[3] = VK_RIGHT;
  50. arlMessages[4] = -1;
  51. arlMessages[5] = VK_RETURN;
  52. return S_OK;
  53. } // end of CSAKeypadController::LoadDefaults method
  54. //++--------------------------------------------------------------
  55. //
  56. // Function: SetKey
  57. //
  58. // Synopsis: This is the ISAKeypadController interface method
  59. // through which specific keys codes are set
  60. //
  61. // Arguments: lKeyID: id of the key to be set
  62. // lMessage: message code to be set
  63. // fShiftKeyDown: state of the shift key
  64. //
  65. // Returns: HRESULT - success/failure
  66. //
  67. // History: serdarun Created 11/15/2000
  68. //
  69. // Called By: ldm service
  70. //
  71. //----------------------------------------------------------------
  72. STDMETHODIMP CSAKeypadController::SetKey(LONG lKeyID, LONG lMessage, BOOL fShiftKeyDown)
  73. {
  74. if ( (lKeyID < 0) || (lKeyID >= iNumberOfKeys) )
  75. return S_OK;
  76. arlMessages[lKeyID] = lMessage;
  77. arbShiftKeys[lKeyID] = fShiftKeyDown;
  78. return S_OK;
  79. } // end of CSAKeypadController::SetKey method
  80. //++--------------------------------------------------------------
  81. //
  82. // Function: GetKey
  83. //
  84. // Synopsis: This is the ISAKeypadController interface method
  85. // through which specific keys codes are received
  86. //
  87. // Arguments: lKeyID: id of the key to be received
  88. // lMessage: message code
  89. // fShiftKeyDown: state of the shift key
  90. //
  91. // Returns: HRESULT - success/failure
  92. //
  93. // History: serdarun Created 11/15/2000
  94. //
  95. // Called By: ldm service
  96. //
  97. //----------------------------------------------------------------
  98. STDMETHODIMP CSAKeypadController::GetKey(LONG lKeyID, LONG *lMessage, BOOL *fShiftKeyDown)
  99. {
  100. if ((!lMessage) || (!fShiftKeyDown))
  101. return E_POINTER;
  102. if ( (lKeyID < 0) || (lKeyID >= iNumberOfKeys) )
  103. return S_OK;
  104. *lMessage = arlMessages[lKeyID];
  105. *fShiftKeyDown = arbShiftKeys[lKeyID];
  106. return S_OK;
  107. } // end of CSAKeypadController::GetKey method