ReactOS  0.4.15-dev-5496-g599ba9c
mouse.cpp File Reference
#include "precomp.h"
Include dependency graph for mouse.cpp:

Go to the source code of this file.

Functions

HRESULT STDMETHODCALLTYPE MouseKeys_Init (_In_ CSysTray *pSysTray)
 
HRESULT STDMETHODCALLTYPE MouseKeys_Shutdown (_In_ CSysTray *pSysTray)
 
HRESULT STDMETHODCALLTYPE MouseKeys_Update (_In_ CSysTray *pSysTray)
 

Variables

static MOUSEKEYS g_Mk
 
static UINT g_MkState
 
static HICON g_MkStateIcon
 

Function Documentation

◆ MouseKeys_Init()

HRESULT STDMETHODCALLTYPE MouseKeys_Init ( _In_ CSysTray pSysTray)

Definition at line 15 of file mouse.cpp.

16 {
17  TRACE("MouseKeys_Init!\n");
18 
19  return MouseKeys_Update(pSysTray);
20 }
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT STDMETHODCALLTYPE MouseKeys_Update(_In_ CSysTray *pSysTray)
Definition: mouse.cpp:43

Referenced by CSysTray::InitIcons().

◆ MouseKeys_Shutdown()

HRESULT STDMETHODCALLTYPE MouseKeys_Shutdown ( _In_ CSysTray pSysTray)

Definition at line 23 of file mouse.cpp.

24 {
25  TRACE("MouseKeys_Shutdown!\n");
26 
27  if (g_MkStateIcon)
28  {
31  }
32 
33  if (g_MkState)
34  {
35  g_MkState = 0;
36  pSysTray->NotifyIcon(NIM_DELETE, ID_ICON_MOUSE, g_MkStateIcon, L"MouseKeys");
37  }
38 
39  return S_OK;
40 }
static UINT g_MkState
Definition: mouse.cpp:11
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define L(x)
Definition: ntvdm.h:50
static HICON g_MkStateIcon
Definition: mouse.cpp:12
#define TRACE(s)
Definition: solgame.cpp:4
#define NIM_DELETE
Definition: shellapi.h:93
#define S_OK
Definition: intsafe.h:52
#define ID_ICON_MOUSE
Definition: precomp.h:36
#define NULL
Definition: types.h:112

Referenced by CSysTray::ShutdownIcons().

◆ MouseKeys_Update()

HRESULT STDMETHODCALLTYPE MouseKeys_Update ( _In_ CSysTray pSysTray)

Definition at line 43 of file mouse.cpp.

44 {
45  TRACE("MouseKeys_Update!\n");
46 
47  g_Mk.cbSize = sizeof(g_Mk);
49 
50  UINT state = 0;
52  {
54  {
56  {
57  case 0:
58  default:
60  break;
61  case MKF_LEFTBUTTONSEL:
63  break;
64  case MKF_LEFTBUTTONDOWN:
67  break;
68  case MKF_RIGHTBUTTONSEL:
70  break;
74  break;
77  break;
83  break;
87  break;
91  break;
92  }
93  }
94  else
95  {
97  }
98  }
99 
100  UINT uId = NIM_MODIFY;
101  if (state != g_MkState)
102  {
103  if (g_MkStateIcon)
104  {
107  }
108 
109  if (g_MkState == 0)
110  uId = NIM_ADD;
111 
112  g_MkState = state;
113  if (g_MkState)
114  {
116  }
117  }
118 
119  if (g_MkState == 0)
120  {
121  uId = NIM_DELETE;
122  }
123 
124  return pSysTray->NotifyIcon(uId, ID_ICON_MOUSE, g_MkStateIcon, L"MouseKeys");
125 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
static UINT g_MkState
Definition: mouse.cpp:11
#define SPI_GETMOUSEKEYS
Definition: winuser.h:1393
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define IDI_MOUSE_R_DOWN
Definition: resource.h:64
#define IDI_MOUSE_L_DOWN
Definition: resource.h:62
DWORD dwFlags
Definition: winuser.h:3402
#define MKF_INDICATOR
Definition: winuser.h:2137
#define IDI_MOUSE_R_ACTIVE
Definition: resource.h:63
#define IDI_MOUSE_DISABLED
Definition: resource.h:59
#define L(x)
Definition: ntvdm.h:50
#define IDI_MOUSE_LR_DOWN
Definition: resource.h:66
#define MKF_RIGHTBUTTONSEL
Definition: winuser.h:2143
#define IDI_MOUSE_LR_ACTIVE
Definition: resource.h:65
static HICON g_MkStateIcon
Definition: mouse.cpp:12
#define TRACE(s)
Definition: solgame.cpp:4
#define IDI_MOUSE_NOBTN
Definition: resource.h:60
#define NIM_DELETE
Definition: shellapi.h:93
#define MKF_LEFTBUTTONDOWN
Definition: winuser.h:2140
static MOUSEKEYS g_Mk
Definition: mouse.cpp:10
#define IDI_MOUSE_L_ACTIVE_R_DOWN
Definition: resource.h:67
#define IDI_MOUSE_L_ACTIVE
Definition: resource.h:61
static int state
Definition: maze.c:121
#define MKF_LEFTBUTTONSEL
Definition: winuser.h:2142
#define MKF_RIGHTBUTTONDOWN
Definition: winuser.h:2141
#define ID_ICON_MOUSE
Definition: precomp.h:36
#define MKF_MOUSEMODE
Definition: winuser.h:2144
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define IDI_MOUSE_R_ACTIVE_L_DOWN
Definition: resource.h:68
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define NIM_ADD
Definition: shellapi.h:91
UINT cbSize
Definition: winuser.h:3401
#define LoadIcon
Definition: winuser.h:5803
HINSTANCE g_hInstance
Definition: MainWindow.cpp:18
#define NIM_MODIFY
Definition: shellapi.h:92
#define MKF_MOUSEKEYSON
Definition: winuser.h:2132

Referenced by MouseKeys_Init(), and CSysTray::ProcessWindowMessage().

Variable Documentation

◆ g_Mk

MOUSEKEYS g_Mk
static

Definition at line 10 of file mouse.cpp.

Referenced by MouseKeys_Update().

◆ g_MkState

UINT g_MkState
static

Definition at line 11 of file mouse.cpp.

Referenced by MouseKeys_Shutdown(), and MouseKeys_Update().

◆ g_MkStateIcon

HICON g_MkStateIcon
static

Definition at line 12 of file mouse.cpp.

Referenced by MouseKeys_Shutdown(), and MouseKeys_Update().