• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

XKeymacs for 64bit Windows


Commit MetaInfo

Revisióne3e40c9641fe308f8854218b548d9e4c2cc517ae (tree)
Tiempo2011-05-27 08:44:02
AutorKazuhiro Fujieda <fujieda@user...>
CommiterKazuhiro Fujieda

Log Message

Give main roles to 32bit version and simplify 64bit version.

Add 64bit versions of CXkeymacsApp and CMainFrame. xkeymacs64.exe
consists of these classes. xkeymacs.exe launches xkeymacs64.exe on
WOW64 and controls it through a named pipe.

xkeymacs.dll and xkeymacs64.dll share the properties through a
temporary file. xkeymacs64.exe enables the keyboard hook after it
reads the properties.

Cambiar Resumen

Diferencia incremental

--- a/xkeymacs/mainfrm.cpp
+++ b/xkeymacs/mainfrm.cpp
@@ -206,6 +206,7 @@ int CMainFrame::OnCreate(const LPCREATESTRUCT lpCreateStruct)
206206 AfxGetApp()->GetProfileInt(CString(), CString(MAKEINTRESOURCE(IDS_REG_ENTRY_CHANGE_CURSOR)), 0));
207207
208208 CXkeymacsDll::SetHooks();
209+ CXkeymacsDll::EnableKeyboardHook();
209210 StartPollThread();
210211
211212 return 0;
@@ -527,6 +528,7 @@ void CMainFrame::OnQuit()
527528
528529 CXkeymacsDll::ReleaseHooks();
529530 TerminatePollThread();
531+ static_cast<CXkeymacsApp *>(AfxGetApp())->SendIPCMessage(XKEYMACS_EXIT);
530532 DeleteAllShell_NotifyIcon();
531533
532534 PostQuitMessage(0);
@@ -578,6 +580,9 @@ void CMainFrame::OnReset()
578580 CXkeymacsDll::SetHooks();
579581 TerminatePollThread();
580582 StartPollThread();
583+ CXkeymacsApp *pApp = static_cast<CXkeymacsApp *>(AfxGetApp());
584+ if (!pApp->SendIPCMessage(XKEYMACS_RESET))
585+ pApp->Create64bitProcess(); // try to restart 64bit app
581586 }
582587
583588 void CMainFrame::OnHelpFinder()
--- /dev/null
+++ b/xkeymacs/mainfrm64.cpp
@@ -0,0 +1,30 @@
1+#include "stdafx.h"
2+#include "mainfrm64.h"
3+
4+IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
5+
6+CMainFrame::CMainFrame()
7+{
8+ // register window class
9+ WNDCLASS stWndClass;
10+ CString szClassName(MAKEINTRESOURCE(AFX_IDS_APP_TITLE));
11+
12+ stWndClass.style = CS_BYTEALIGNWINDOW;
13+ stWndClass.lpfnWndProc = &AfxWndProc;
14+ stWndClass.cbClsExtra = 0;
15+ stWndClass.cbWndExtra = 0;
16+ stWndClass.hInstance = AfxGetInstanceHandle();
17+ stWndClass.hIcon = NULL;
18+ stWndClass.hCursor = NULL;
19+ stWndClass.hbrBackground = (HBRUSH)COLOR_BACKGROUND;
20+ stWndClass.lpszMenuName = NULL;
21+ stWndClass.lpszClassName = szClassName;
22+
23+ AfxRegisterClass(&stWndClass);
24+
25+ // make window
26+ CRect rect(0, 0, 100, 100);
27+
28+ Create(szClassName, CString(MAKEINTRESOURCE(AFX_IDS_APP_TITLE)), WS_OVERLAPPEDWINDOW | WS_MINIMIZE, rect);
29+}
30+
--- /dev/null
+++ b/xkeymacs/mainfrm64.h
@@ -0,0 +1,16 @@
1+#ifndef AFX_MAINFRM64_H_INCLUDED
2+#define AFX_MAINFRM64_H_INCLUDED
3+
4+#if _MSC_VER > 1000
5+#pragma once
6+#endif // _MSC_VER > 1000
7+
8+class CMainFrame: public CFrameWnd
9+{
10+public:
11+ CMainFrame();
12+protected:
13+ DECLARE_DYNCREATE(CMainFrame)
14+};
15+
16+#endif // AFX_MAINFRM64_H_INCLUDED
--- a/xkeymacs/profile.cpp
+++ b/xkeymacs/profile.cpp
@@ -822,6 +822,12 @@ void CProfile::SetDllData()
822822 CXkeymacsDll::SetEnableCUA(nApplicationID, m_XkeymacsData[nApplicationID].GetEnableCUA());
823823 CXkeymacsDll::Set326Compatible(nApplicationID, m_XkeymacsData[nApplicationID].Get326Compatible());
824824 }
825+ CXkeymacsApp *pApp = static_cast<CXkeymacsApp *>(AfxGetApp());
826+ if (!pApp->IsWow64())
827+ return;
828+ if (!CXkeymacsDll::SaveConfig())
829+ return;
830+ pApp->SendIPCMessage(XKEYMACS_RELOAD);
825831 }
826832
827833 void CProfile::ReadKeyBind(int *const pnCommandType, int *const pnKey, LPCTSTR szKeyBind)
--- a/xkeymacs/resource.h
+++ b/xkeymacs/resource.h
@@ -31,7 +31,7 @@
3131 #define IDC_REG_ENTRY_IGNORE_META_CTRL 29
3232 #define IDC_REG_ENTRY_IGNORE_C_X 30
3333 #define IDS_ERR_SAVE_DATA 31
34-#define IDS_ERR_WINDOWS_VERSION 32
34+#define IDS_ERR_32BIT 32
3535 #define IDS_ERR_IMPORT 33
3636 #define IDS_ERR_EXPORT 34
3737 #define IDC_REG_ENTRY_ENABLE_CUA 35
--- a/xkeymacs/xkeymacs-vc10x64.vcxproj
+++ b/xkeymacs/xkeymacs-vc10x64.vcxproj
@@ -173,22 +173,78 @@
173173 </ResourceCompile>
174174 </ItemDefinitionGroup>
175175 <ItemGroup>
176- <ClCompile Include="104keyboard.cpp" />
177- <ClCompile Include="109keyboard.cpp" />
178- <ClCompile Include="about.cpp" />
179- <ClCompile Include="data.cpp" />
180- <ClCompile Include="dotxkeymacs.cpp" />
181- <ClCompile Include="key.cpp" />
182- <ClCompile Include="keyboardlayout.cpp" />
183- <ClCompile Include="mainfrm.cpp" />
184- <ClCompile Include="optionsdlg.cpp" />
185- <ClCompile Include="profile.cpp" />
186- <ClCompile Include="properties.cpp" />
187- <ClCompile Include="propertiesadvanced.cpp" />
188- <ClCompile Include="propertiesbasic.cpp" />
189- <ClCompile Include="propertieslist.cpp" />
190- <ClCompile Include="stdafx.cpp" />
191- <ClCompile Include="xkeymacs.cpp" />
176+ <ClCompile Include="104keyboard.cpp">
177+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
178+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
179+ </ClCompile>
180+ <ClCompile Include="109keyboard.cpp">
181+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
182+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
183+ </ClCompile>
184+ <ClCompile Include="about.cpp">
185+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
186+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
187+ </ClCompile>
188+ <ClCompile Include="data.cpp">
189+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
190+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
191+ </ClCompile>
192+ <ClCompile Include="dotxkeymacs.cpp">
193+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
194+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
195+ </ClCompile>
196+ <ClCompile Include="key.cpp">
197+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
198+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
199+ </ClCompile>
200+ <ClCompile Include="keyboardlayout.cpp">
201+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
202+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
203+ </ClCompile>
204+ <ClCompile Include="mainfrm.cpp">
205+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
206+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
207+ </ClCompile>
208+ <ClCompile Include="mainfrm64.cpp">
209+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
210+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
211+ </ClCompile>
212+ <ClCompile Include="optionsdlg.cpp">
213+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
214+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
215+ </ClCompile>
216+ <ClCompile Include="profile.cpp">
217+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
218+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
219+ </ClCompile>
220+ <ClCompile Include="properties.cpp">
221+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
222+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
223+ </ClCompile>
224+ <ClCompile Include="propertiesadvanced.cpp">
225+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
226+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
227+ </ClCompile>
228+ <ClCompile Include="propertiesbasic.cpp">
229+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
230+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
231+ </ClCompile>
232+ <ClCompile Include="propertieslist.cpp">
233+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
234+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
235+ </ClCompile>
236+ <ClCompile Include="stdafx.cpp">
237+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
238+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
239+ </ClCompile>
240+ <ClCompile Include="xkeymacs.cpp">
241+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
242+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
243+ </ClCompile>
244+ <ClCompile Include="xkeymacs64.cpp">
245+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
246+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
247+ </ClCompile>
192248 </ItemGroup>
193249 <ItemGroup>
194250 <ClInclude Include="104keyboard.h" />
@@ -199,6 +255,7 @@
199255 <ClInclude Include="key.h" />
200256 <ClInclude Include="keyboardlayout.h" />
201257 <ClInclude Include="mainfrm.h" />
258+ <ClInclude Include="mainfrm64.h" />
202259 <ClInclude Include="optionsdlg.h" />
203260 <ClInclude Include="profile.h" />
204261 <ClInclude Include="properties.h" />
@@ -208,6 +265,7 @@
208265 <ClInclude Include="resource.h" />
209266 <ClInclude Include="stdafx.h" />
210267 <ClInclude Include="xkeymacs.h" />
268+ <ClInclude Include="xkeymacs64.h" />
211269 </ItemGroup>
212270 <ItemGroup>
213271 <ResourceCompile Include="xkeymacs.rc" />
--- a/xkeymacs/xkeymacs-vc10x64.vcxproj.filters
+++ b/xkeymacs/xkeymacs-vc10x64.vcxproj.filters
@@ -60,9 +60,15 @@
6060 <ClCompile Include="data.cpp">
6161 <Filter>Source Files</Filter>
6262 </ClCompile>
63+ <ClCompile Include="mainfrm64.cpp">
64+ <Filter>Source Files</Filter>
65+ </ClCompile>
6366 <ClCompile Include="about.cpp">
6467 <Filter>Source Files</Filter>
6568 </ClCompile>
69+ <ClCompile Include="xkeymacs64.cpp">
70+ <Filter>Source Files</Filter>
71+ </ClCompile>
6672 </ItemGroup>
6773 <ItemGroup>
6874 <ClInclude Include="104keyboard.h">
@@ -113,9 +119,15 @@
113119 <ClInclude Include="data.h">
114120 <Filter>Header Files</Filter>
115121 </ClInclude>
122+ <ClInclude Include="mainfrm64.h">
123+ <Filter>Header Files</Filter>
124+ </ClInclude>
116125 <ClInclude Include="about.h">
117126 <Filter>Header Files</Filter>
118127 </ClInclude>
128+ <ClInclude Include="xkeymacs64.h">
129+ <Filter>Header Files</Filter>
130+ </ClInclude>
119131 </ItemGroup>
120132 <ItemGroup>
121133 <ResourceCompile Include="xkeymacs.rc">
--- a/xkeymacs/xkeymacs-vc10x86.vcxproj
+++ b/xkeymacs/xkeymacs-vc10x86.vcxproj
@@ -173,22 +173,78 @@
173173 </ResourceCompile>
174174 </ItemDefinitionGroup>
175175 <ItemGroup>
176- <ClCompile Include="104keyboard.cpp" />
177- <ClCompile Include="109keyboard.cpp" />
178- <ClCompile Include="about.cpp" />
179- <ClCompile Include="data.cpp" />
180- <ClCompile Include="dotxkeymacs.cpp" />
181- <ClCompile Include="key.cpp" />
182- <ClCompile Include="keyboardlayout.cpp" />
183- <ClCompile Include="mainfrm.cpp" />
184- <ClCompile Include="optionsdlg.cpp" />
185- <ClCompile Include="profile.cpp" />
186- <ClCompile Include="properties.cpp" />
187- <ClCompile Include="propertiesadvanced.cpp" />
188- <ClCompile Include="propertiesbasic.cpp" />
189- <ClCompile Include="propertieslist.cpp" />
190- <ClCompile Include="stdafx.cpp" />
191- <ClCompile Include="xkeymacs.cpp" />
176+ <ClCompile Include="104keyboard.cpp">
177+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
178+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
179+ </ClCompile>
180+ <ClCompile Include="109keyboard.cpp">
181+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
182+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
183+ </ClCompile>
184+ <ClCompile Include="about.cpp">
185+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
186+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
187+ </ClCompile>
188+ <ClCompile Include="data.cpp">
189+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
190+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
191+ </ClCompile>
192+ <ClCompile Include="dotxkeymacs.cpp">
193+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
194+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
195+ </ClCompile>
196+ <ClCompile Include="key.cpp">
197+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
198+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
199+ </ClCompile>
200+ <ClCompile Include="keyboardlayout.cpp">
201+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
202+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
203+ </ClCompile>
204+ <ClCompile Include="mainfrm.cpp">
205+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
206+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
207+ </ClCompile>
208+ <ClCompile Include="mainfrm64.cpp">
209+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
210+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
211+ </ClCompile>
212+ <ClCompile Include="optionsdlg.cpp">
213+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
214+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
215+ </ClCompile>
216+ <ClCompile Include="profile.cpp">
217+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
218+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
219+ </ClCompile>
220+ <ClCompile Include="properties.cpp">
221+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
222+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
223+ </ClCompile>
224+ <ClCompile Include="propertiesadvanced.cpp">
225+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
226+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
227+ </ClCompile>
228+ <ClCompile Include="propertiesbasic.cpp">
229+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
230+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
231+ </ClCompile>
232+ <ClCompile Include="propertieslist.cpp">
233+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
234+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
235+ </ClCompile>
236+ <ClCompile Include="stdafx.cpp">
237+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
238+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
239+ </ClCompile>
240+ <ClCompile Include="xkeymacs.cpp">
241+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
242+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
243+ </ClCompile>
244+ <ClCompile Include="xkeymacs64.cpp">
245+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
246+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
247+ </ClCompile>
192248 </ItemGroup>
193249 <ItemGroup>
194250 <ClInclude Include="104keyboard.h" />
@@ -199,6 +255,7 @@
199255 <ClInclude Include="key.h" />
200256 <ClInclude Include="keyboardlayout.h" />
201257 <ClInclude Include="mainfrm.h" />
258+ <ClInclude Include="mainfrm64.h" />
202259 <ClInclude Include="optionsdlg.h" />
203260 <ClInclude Include="profile.h" />
204261 <ClInclude Include="properties.h" />
@@ -208,6 +265,7 @@
208265 <ClInclude Include="resource.h" />
209266 <ClInclude Include="stdafx.h" />
210267 <ClInclude Include="xkeymacs.h" />
268+ <ClInclude Include="xkeymacs64.h" />
211269 </ItemGroup>
212270 <ItemGroup>
213271 <ResourceCompile Include="xkeymacs.rc" />
--- a/xkeymacs/xkeymacs-vc10x86.vcxproj.filters
+++ b/xkeymacs/xkeymacs-vc10x86.vcxproj.filters
@@ -60,9 +60,15 @@
6060 <ClCompile Include="data.cpp">
6161 <Filter>Source Files</Filter>
6262 </ClCompile>
63+ <ClCompile Include="mainfrm64.cpp">
64+ <Filter>Source Files</Filter>
65+ </ClCompile>
6366 <ClCompile Include="about.cpp">
6467 <Filter>Source Files</Filter>
6568 </ClCompile>
69+ <ClCompile Include="xkeymacs64.cpp">
70+ <Filter>Source Files</Filter>
71+ </ClCompile>
6672 </ItemGroup>
6773 <ItemGroup>
6874 <ClInclude Include="104keyboard.h">
@@ -113,9 +119,15 @@
113119 <ClInclude Include="data.h">
114120 <Filter>Header Files</Filter>
115121 </ClInclude>
122+ <ClInclude Include="mainfrm64.h">
123+ <Filter>Header Files</Filter>
124+ </ClInclude>
116125 <ClInclude Include="about.h">
117126 <Filter>Header Files</Filter>
118127 </ClInclude>
128+ <ClInclude Include="xkeymacs64.h">
129+ <Filter>Header Files</Filter>
130+ </ClInclude>
119131 </ItemGroup>
120132 <ItemGroup>
121133 <ResourceCompile Include="xkeymacs.rc">
--- a/xkeymacs/xkeymacs.cpp
+++ b/xkeymacs/xkeymacs.cpp
@@ -28,6 +28,7 @@ END_MESSAGE_MAP()
2828 CXkeymacsApp::CXkeymacsApp()
2929 {
3030 m_hMutex = NULL;
31+ m_bIsWow64 = FALSE;
3132 }
3233
3334 /////////////////////////////////////////////////////////////////////////////
@@ -46,16 +47,12 @@ BOOL CXkeymacsApp::InitInstance()
4647 // If you are not using these features and wish to reduce the size
4748 // of your final executable, you should remove from the following
4849 // the specific initialization routines you do not need.
49-#ifdef _WIN64
50- m_hMutex = CreateMutex(FALSE, 0, CString(MAKEINTRESOURCE(AFX_IDS_APP_TITLE)) + _T("64"));
51-#else
5250 m_hMutex = CreateMutex(FALSE, 0, CString(MAKEINTRESOURCE(AFX_IDS_APP_TITLE)));
53-#endif
54- if (GetLastError() == ERROR_ALREADY_EXISTS) {
55- CloseHandle(m_hMutex);
51+ if (GetLastError() == ERROR_ALREADY_EXISTS) {
52+ CloseHandle(m_hMutex);
5653 m_hMutex = NULL;
57- return FALSE;
58- }
54+ return FALSE;
55+ }
5956
6057 #ifdef _AFXDLL
6158 Enable3dControls(); // Call this when using MFC in a shared DLL
@@ -83,12 +80,60 @@ BOOL CXkeymacsApp::InitInstance()
8380 SetClassLongPtr(m_pMainWnd->m_hWnd, GCLP_HICON, (LONG_PTR)LoadIcon(IDR_MAINFRAME));
8481
8582 // set registry key
86- CProfile::InitDllData();
8783 CUtils::InitCUtils();
84+ if (!Create64bitProcess())
85+ return FALSE;
86+ CProfile::InitDllData();
87+
88+ return TRUE;
89+}
90+
91+BOOL CXkeymacsApp::IsWow64()
92+{
93+ return m_bIsWow64;
94+}
8895
96+BOOL CXkeymacsApp::Create64bitProcess()
97+{
98+ typedef BOOL (WINAPI *PFIsWow64Process)(HANDLE, PBOOL);
99+ PFIsWow64Process func = (PFIsWow64Process)GetProcAddress(GetModuleHandle(_T("kernel32")), _T("IsWow64Process"));
100+ if (!func)
101+ return TRUE; // IsWow64Process not exists
102+ if (!func(GetCurrentProcess(), &m_bIsWow64))
103+ return FALSE; // error
104+ if (!m_bIsWow64)
105+ return TRUE; // do nothing
106+
107+ TCHAR szFileName[MAX_PATH];
108+ if (!GetModuleFileName(NULL, szFileName, sizeof(szFileName)))
109+ return FALSE;
110+ TCHAR szDrive[_MAX_DRIVE], szDir[_MAX_DIR], szFile[_MAX_FNAME], szExt[_MAX_EXT];
111+ if (_tsplitpath_s(szFileName, szDrive, szDir, szFile, szExt) ||
112+ _tcscat_s(szFile, _T("64")) ||
113+ _tmakepath_s(szFileName, szDrive, szDir, szFile, szExt))
114+ return FALSE;
115+
116+ STARTUPINFO si;
117+ ZeroMemory(&si, sizeof(si));
118+ si.cb = sizeof(si);
119+ PROCESS_INFORMATION pi;
120+ ZeroMemory(&pi, sizeof(pi));
121+ if (!CreateProcess(szFileName, NULL, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
122+ return FALSE;
123+ // close unused handles
124+ CloseHandle(pi.hProcess);
125+ CloseHandle(pi.hThread);
89126 return TRUE;
90127 }
91128
129+BOOL CXkeymacsApp::SendIPCMessage(DWORD msg)
130+{
131+ if (!m_bIsWow64)
132+ return TRUE;
133+ DWORD ack, read;
134+ return CallNamedPipe(IPC_PIPE, &msg, sizeof(msg), &ack, sizeof(DWORD), &read, 10000);
135+}
136+
92137 int CXkeymacsApp::ExitInstance()
93138 {
94139 if (m_hMutex) {
--- a/xkeymacs/xkeymacs.h
+++ b/xkeymacs/xkeymacs.h
@@ -37,9 +37,13 @@ public:
3737 // NOTE - the ClassWizard will add and remove member functions here.
3838 // DO NOT EDIT what you see in these blocks of generated code !
3939 //}}AFX_MSG
40+ BOOL IsWow64();
41+ BOOL SendIPCMessage(DWORD msg);
42+ BOOL Create64bitProcess();
4043 DECLARE_MESSAGE_MAP()
4144 private:
4245 HANDLE m_hMutex;
46+ BOOL m_bIsWow64;
4347 };
4448
4549 //{{AFX_INSERT_LOCATION}}
--- a/xkeymacs/xkeymacs.rc
+++ b/xkeymacs/xkeymacs.rc
@@ -1056,7 +1056,7 @@ END
10561056
10571057 STRINGTABLE DISCARDABLE
10581058 BEGIN
1059- IDS_ERR_WINDOWS_VERSION "XKeymacs はこのバージョンの Windows をサポートしておりません。"
1059+ IDS_ERR_32BIT "32ビット版の xkeymacs.exe を実行してください。"
10601060 IDS_ERR_IMPORT "%s\nファイルが見つかりません。\n指定したファイル名が正しいかどうか確認してください。"
10611061 IDS_ERR_EXPORT "設定の書き出しに失敗しました。"
10621062 IDC_REG_ENTRY_ENABLE_CUA "Enable CUA"
@@ -2874,7 +2874,7 @@ END
28742874
28752875 STRINGTABLE DISCARDABLE
28762876 BEGIN
2877- IDS_ERR_WINDOWS_VERSION "XKeymacs does not support the Windows of this version."
2877+ IDS_ERR_32BIT "Please start 32bit version of xkeymacs.exe."
28782878 IDS_ERR_IMPORT "%s\nFile not found.\nPlease verify the correct file name was given."
28792879 IDS_ERR_EXPORT "Failed to export properties."
28802880 IDC_REG_ENTRY_ENABLE_CUA "Enable CUA"
--- /dev/null
+++ b/xkeymacs/xkeymacs64.cpp
@@ -0,0 +1,90 @@
1+#include "stdafx.h"
2+#include "xkeymacs64.h"
3+#include "mainfrm64.h"
4+
5+CXkeymacsApp::CXkeymacsApp()
6+{
7+ m_hMutex = NULL;
8+}
9+
10+CXkeymacsApp theApp;
11+
12+static UINT PollIPCMessage(LPVOID lpParam);
13+
14+BOOL CXkeymacsApp::InitInstance()
15+{
16+ HANDLE h32 = CreateMutex(FALSE, 0, CString(MAKEINTRESOURCE(AFX_IDS_APP_TITLE)));
17+ if (GetLastError() != ERROR_ALREADY_EXISTS) {
18+ AfxMessageBox(CString(MAKEINTRESOURCE(IDS_ERR_32BIT)));
19+ CloseHandle(h32);
20+ return FALSE;
21+ }
22+ CloseHandle(h32);
23+ m_hMutex = CreateMutex(FALSE, 0, CString(MAKEINTRESOURCE(AFX_IDS_APP_TITLE)) + _T("64"));
24+ if (GetLastError() == ERROR_ALREADY_EXISTS) {
25+ CloseHandle(m_hMutex);
26+ m_hMutex = NULL;
27+ return FALSE;
28+ }
29+
30+ m_pMainWnd = new CMainFrame;
31+ m_pMainWnd->ShowWindow(SW_HIDE);
32+ m_pMainWnd->UpdateWindow();
33+ SetClassLongPtr(m_pMainWnd->m_hWnd, GCLP_HICON, (LONG_PTR)LoadIcon(IDR_MAINFRAME));
34+
35+ CUtils::InitCUtils();
36+ AfxBeginThread(PollIPCMessage, NULL);
37+ CXkeymacsDll::SetHooks();
38+ return TRUE;
39+}
40+
41+UINT PollIPCMessage(LPVOID lpParam)
42+{
43+ HANDLE hPipe = CreateNamedPipe(IPC_PIPE, PIPE_ACCESS_DUPLEX, PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE, 1, 512, 512, 0, NULL);
44+ if (hPipe == INVALID_HANDLE_VALUE)
45+ return 1;
46+ for (; ;) {
47+ if (ConnectNamedPipe(hPipe, NULL) ? FALSE : (GetLastError() != ERROR_PIPE_CONNECTED))
48+ break;
49+ DWORD msg;
50+ DWORD read;
51+ if (!ReadFile(hPipe, &msg, sizeof(msg), &read, NULL) || read != sizeof(msg))
52+ break;
53+ DWORD written, nul = 0;
54+ if (!WriteFile(hPipe, &nul, sizeof(DWORD), &written, NULL) || written != sizeof(DWORD)
55+ || !FlushFileBuffers(hPipe) || !DisconnectNamedPipe(hPipe))
56+ break;
57+ switch (msg)
58+ {
59+ case XKEYMACS_EXIT:
60+ goto exit;
61+ break;
62+ case XKEYMACS_RELOAD:
63+ if (CXkeymacsDll::LoadConfig())
64+ CXkeymacsDll::EnableKeyboardHook();
65+ break;
66+ case XKEYMACS_RESET:
67+ CXkeymacsDll::ReleaseHooks();
68+ CXkeymacsDll::SetHooks();
69+ break;
70+ }
71+ }
72+exit:
73+ CloseHandle(hPipe);
74+ CXkeymacsDll::ReleaseHooks();
75+ ExitProcess(0);
76+ return 0;
77+}
78+
79+int CXkeymacsApp::ExitInstance()
80+{
81+ if (m_hMutex) {
82+ CloseHandle(m_hMutex);
83+
84+ m_pMainWnd->DestroyWindow();
85+ delete m_pMainWnd;
86+ m_pMainWnd = NULL;
87+ }
88+
89+ return CWinApp::ExitInstance();
90+}
--- /dev/null
+++ b/xkeymacs/xkeymacs64.h
@@ -0,0 +1,25 @@
1+#ifndef AFX_XKEYMACS64_H_INCLUDED
2+#define AFX_XKEYMACS64_H_INCLUDED
3+
4+#if _MSC_VER > 1000
5+#pragma once
6+#endif // _MSC_VER > 1000
7+
8+#include "resource.h"
9+
10+class CXkeymacsApp : public CWinApp
11+{
12+public:
13+ CXkeymacsApp();
14+// Overrides
15+ // ClassWizard generated virtual function overrides
16+ //{{AFX_VIRTUAL(CXkeymacsApp)
17+ public:
18+ virtual BOOL InitInstance();
19+ virtual int ExitInstance();
20+ //}}AFX_VIRTUAL
21+private:
22+ HANDLE m_hMutex;
23+};
24+
25+#endif // AFX_XKEYMACS64_H_INCLUDED
--- a/xkeymacsdll/ipc.h
+++ b/xkeymacsdll/ipc.h
@@ -11,5 +11,26 @@ struct ICONMSG {
1111 TCHAR szTip[128];
1212 };
1313
14+struct CONFIG {
15+ int nMessage;
16+ BOOL b326Compatible[MAX_APP];
17+ TCHAR szWindowText[MAX_APP][WINDOW_TEXT_LENGTH];
18+ TCHAR szFunctionDefinition[MAX_FUNCTION][MAX_DEFINITION];
19+ int nFunctionID[MAX_APP][MAX_COMMAND_TYPE][MAX_KEY];
20+ BOOL bEnableCUA[MAX_APP];
21+ BOOL bUseDialogSetting[MAX_APP];
22+ BOOL bIgnoreUndefinedC_x[MAX_APP];
23+ BOOL bIgnoreUndefinedMetaCtrl[MAX_APP];
24+ int nSettingStyle[MAX_APP];
25+ int nKillRingMax[MAX_APP];
26+ TCHAR szSpecialApp[MAX_APP][CLASS_NAME_LENGTH];
27+ int nCommandID[MAX_APP][MAX_COMMAND_TYPE][MAX_KEY];
28+ BOOL bAtIbeamCursorOnly[MAX_APP][MAX_COMMAND_TYPE][MAX_KEY];
29+ BOOL b106Keyboard;
30+};
31+
32+enum XKEYMACS_IPC { XKEYMACS_EXIT, XKEYMACS_RELOAD, XKEYMACS_RESET };
33+
1434 #define ICON_PIPE _T("\\\\.\\pipe\\XKEYMACS_ICON")
35+#define IPC_PIPE _T("\\\\.\\pipe\\XKEYMACS_IPC")
1536 #endif
--- a/xkeymacsdll/xkeymacsdll.cpp
+++ b/xkeymacsdll/xkeymacsdll.cpp
@@ -201,39 +201,23 @@ DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
201201 HHOOK CXkeymacsDll::m_hHookCallWndRet = NULL;
202202 HHOOK CXkeymacsDll::m_hHookGetMessage = NULL;
203203 HHOOK CXkeymacsDll::m_hHookShell = NULL;
204- int CXkeymacsDll::m_nCommandID[MAX_APP][MAX_COMMAND_TYPE][MAX_KEY] = {'\0'};
205- BOOL CXkeymacsDll::m_bAtIbeamCursorOnly[MAX_APP][MAX_COMMAND_TYPE][MAX_KEY] = {'\0'};
206- int CXkeymacsDll::m_nFunctionID[MAX_APP][MAX_COMMAND_TYPE][MAX_KEY] = {'\0'};
207- TCHAR CXkeymacsDll::m_szSpecialApp[MAX_APP][CLASS_NAME_LENGTH] = {'\0'};
208- TCHAR CXkeymacsDll::m_szWindowText[MAX_APP][WINDOW_TEXT_LENGTH] = {'\0'};
209204 BOOL CXkeymacsDll::m_bRightControl = FALSE;
210205 BOOL CXkeymacsDll::m_bRightAlt = FALSE;
211206 BOOL CXkeymacsDll::m_bRightShift = FALSE;
212207 BOOL CXkeymacsDll::m_bHook = TRUE;
213208 BOOL CXkeymacsDll::m_bDefiningMacro = FALSE;
214- int CXkeymacsDll::m_nKillRingMax[MAX_APP] = {'\0'};
215- BOOL CXkeymacsDll::m_bUseDialogSetting[MAX_APP] = {'\0'};
216209 CList<CClipboardSnap *, CClipboardSnap *> CXkeymacsDll::m_oKillRing;
217210 CObList CXkeymacsDll::m_Macro;
218211 int CXkeymacsDll::m_nKillRing = 0;
219212 int CXkeymacsDll::m_nOriginal[MAX_COMMAND_TYPE][MAX_KEY] = {'\0'};
220213 int CXkeymacsDll::m_nApplicationID = 0;
221- int CXkeymacsDll::m_nSettingStyle[MAX_APP] = {'\0'};
222- BOOL CXkeymacsDll::m_bIgnoreUndefinedMetaCtrl[MAX_APP] = {'\0'};
223- BOOL CXkeymacsDll::m_bIgnoreUndefinedC_x[MAX_APP] = {'\0'};
224-// int CXkeymacsDll::m_nPassThrough = 0;
225- TCHAR CXkeymacsDll::m_szApplicationName[MAX_PATH] = {'\0'};
226- TCHAR CXkeymacsDll::m_szOldApplicationName[MAX_PATH] = {'\0'};
227- BOOL CXkeymacsDll::m_bEnableCUA[MAX_APP] = {'\0'};
228- TCHAR CXkeymacsDll::m_szFunctionDefinition[MAX_FUNCTION][MAX_DEFINITION] = {'\0'};
229214 int CXkeymacsDll::m_nAccelerate = 0;
230215 int CXkeymacsDll::m_nKeyboardSpeed = 31;
231216 HCURSOR CXkeymacsDll::m_hCursor[MAX_STATUS] = {'\0'};
232217 HCURSOR CXkeymacsDll::m_hCurrentCursor = NULL;
233218 BOOL CXkeymacsDll::m_bCursor = FALSE;
234- BOOL CXkeymacsDll::m_b326Compatible[MAX_APP] = {'\0'};
235- BOOL CXkeymacsDll::m_b106Keyboard = FALSE;
236219 TCHAR CXkeymacsDll::m_M_xTip[128] = "";
220+ CONFIG CXkeymacsDll::m_Config = {0};
237221 #pragma data_seg()
238222
239223 //////////////////////////////////////////////////////////////////////
@@ -250,16 +234,52 @@ CXkeymacsDll::~CXkeymacsDll()
250234
251235 }
252236
237+BOOL CXkeymacsDll::SaveConfig()
238+{
239+ TCHAR szTmp[MAX_PATH];
240+ if (!GetTempPath(MAX_PATH, szTmp))
241+ return FALSE;
242+ if (_tmakepath_s(szTmp, NULL, szTmp, _T("xkeymacs"), _T("tmp")))
243+ return FALSE;
244+ HANDLE hFile = CreateFile(szTmp, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
245+ if (hFile == INVALID_HANDLE_VALUE)
246+ return FALSE;
247+ DWORD written;
248+ BOOL res = WriteFile(hFile, &m_Config, sizeof(m_Config), &written, NULL) || written != sizeof(m_Config);
249+ CloseHandle(hFile);
250+ return res;
251+}
252+
253+BOOL CXkeymacsDll::LoadConfig()
254+{
255+ TCHAR szTmp[MAX_PATH];
256+ if (!GetTempPath(MAX_PATH, szTmp))
257+ return FALSE;
258+ if (_tmakepath_s(szTmp, NULL, szTmp, _T("xkeymacs"), _T("tmp")))
259+ return FALSE;
260+ HANDLE hFile = CreateFile(szTmp, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
261+ if (hFile == INVALID_HANDLE_VALUE)
262+ return FALSE;
263+ DWORD read;
264+ BOOL res = ReadFile(hFile, &m_Config, sizeof(m_Config), &read, NULL) && read == sizeof(m_Config);
265+ CloseHandle(hFile);
266+ return res;
267+}
268+
253269 // set hooks
254270 void CXkeymacsDll::SetHooks()
255271 {
256- m_bEnableKeyboardHook = TRUE;
257272 m_hHookCallWnd = SetWindowsHookEx(WH_CALLWNDPROC, (HOOKPROC)CallWndProc, g_hDllInst, 0);
258273 m_hHookCallWndRet = SetWindowsHookEx(WH_CALLWNDPROCRET, (HOOKPROC)CallWndRetProc, g_hDllInst, 0);
259274 m_hHookGetMessage = SetWindowsHookEx(WH_GETMESSAGE, (HOOKPROC)GetMsgProc, g_hDllInst, 0);
260275 m_hHookShell = SetWindowsHookEx(WH_SHELL, (HOOKPROC)ShellProc, g_hDllInst, 0);
261276 }
262277
278+void CXkeymacsDll::EnableKeyboardHook()
279+{
280+ m_bEnableKeyboardHook = TRUE;
281+}
282+
263283 void CXkeymacsDll::SetKeyboardHook()
264284 {
265285 if (!g_hHookKeyboard)
@@ -306,8 +326,8 @@ void CXkeymacsDll::SetKeyboardHookFlag(BOOL bFlag)
306326 } else {
307327 msg.nState = STATUS_DISABLE_WOCQ;
308328 }
309- if (m_nSettingStyle[m_nApplicationID] == SETTING_DISABLE
310- || (!_tcsicmp(m_szSpecialApp[m_nApplicationID], _T("Default"))
329+ if (m_Config.nSettingStyle[m_nApplicationID] == SETTING_DISABLE
330+ || (!_tcsicmp(m_Config.szSpecialApp[m_nApplicationID], _T("Default"))
311331 && CUtils::IsDefaultIgnoreApplication())) {
312332 msg.nState = STATUS_DISABLE;
313333 m_hCurrentCursor = m_hCursor[STATUS_DISABLE];
@@ -665,16 +685,16 @@ void CXkeymacsDll::InitKeyboardProc(BOOL bImeComposition)
665685
666686 CUtils::SetApplicationName(bImeComposition);
667687
668- if (_tcsnicmp(m_szSpecialApp[m_nApplicationID], CUtils::GetApplicationName(), 0xF) || !IsMatchWindowText(m_szWindowText[m_nApplicationID])) { // PROCESSENTRY32 has only 0xF bytes of Name
688+ if (_tcsnicmp(m_Config.szSpecialApp[m_nApplicationID], CUtils::GetApplicationName(), 0xF) || !IsMatchWindowText(m_Config.szWindowText[m_nApplicationID])) { // PROCESSENTRY32 has only 0xF bytes of Name
669689 m_nApplicationID = -1;
670690
671691 for (int nApplicationID = 0; nApplicationID < MAX_APP; ++nApplicationID) {
672- if (!_tcsnicmp(m_szSpecialApp[nApplicationID], CUtils::GetApplicationName(), 0xF) && IsMatchWindowText(m_szWindowText[nApplicationID])) {
692+ if (!_tcsnicmp(m_Config.szSpecialApp[nApplicationID], CUtils::GetApplicationName(), 0xF) && IsMatchWindowText(m_Config.szWindowText[nApplicationID])) {
673693
674694 if (m_nApplicationID < 0
675- || CUtils::GetWindowTextType(m_szWindowText[m_nApplicationID]) < CUtils::GetWindowTextType(m_szWindowText[nApplicationID])
676- || CUtils::GetWindowTextType(m_szWindowText[m_nApplicationID]) == CUtils::GetWindowTextType(m_szWindowText[nApplicationID])
677- && _tcscmp(m_szWindowText[m_nApplicationID], m_szWindowText[nApplicationID]) <= 0) {
695+ || CUtils::GetWindowTextType(m_Config.szWindowText[m_nApplicationID]) < CUtils::GetWindowTextType(m_Config.szWindowText[nApplicationID])
696+ || CUtils::GetWindowTextType(m_Config.szWindowText[m_nApplicationID]) == CUtils::GetWindowTextType(m_Config.szWindowText[nApplicationID])
697+ && _tcscmp(m_Config.szWindowText[m_nApplicationID], m_Config.szWindowText[nApplicationID]) <= 0) {
678698 m_nApplicationID = nApplicationID;
679699 }
680700 }
@@ -682,7 +702,7 @@ void CXkeymacsDll::InitKeyboardProc(BOOL bImeComposition)
682702
683703 if (m_nApplicationID < 0) {
684704 for (int nApplicationID = 0; nApplicationID < MAX_APP; ++nApplicationID) {
685- if (!_tcsicmp(m_szSpecialApp[nApplicationID], _T("Default"))) {
705+ if (!_tcsicmp(m_Config.szSpecialApp[nApplicationID], _T("Default"))) {
686706 m_nApplicationID = nApplicationID;
687707 break;
688708 }
@@ -694,15 +714,15 @@ void CXkeymacsDll::InitKeyboardProc(BOOL bImeComposition)
694714 }
695715 }
696716
697- if (m_nSettingStyle[m_nApplicationID] != SETTING_DISABLE
698- && (_tcsicmp(m_szSpecialApp[m_nApplicationID], _T("Default")) || !CUtils::IsDefaultIgnoreApplication())
717+ if (m_Config.nSettingStyle[m_nApplicationID] != SETTING_DISABLE
718+ && (_tcsicmp(m_Config.szSpecialApp[m_nApplicationID], _T("Default")) || !CUtils::IsDefaultIgnoreApplication())
699719 && !bImeComposition
700720 && CUtils::IsDialog()) {
701721 // Use Dialog Setting
702- if (m_bUseDialogSetting[m_nApplicationID]) {
722+ if (m_Config.bUseDialogSetting[m_nApplicationID]) {
703723 int nOriginalApplicationID = m_nApplicationID;
704724 for (m_nApplicationID = 0; m_nApplicationID < MAX_APP; ++m_nApplicationID) {
705- if (!_tcsicmp(m_szSpecialApp[m_nApplicationID], _T("Dialog"))) {
725+ if (!_tcsicmp(m_Config.szSpecialApp[m_nApplicationID], _T("Dialog"))) {
706726 break;
707727 }
708728 }
@@ -803,8 +823,8 @@ LRESULT CALLBACK CXkeymacsDll::KeyboardProc(int nCode, WPARAM wParam, LPARAM lPa
803823 || nKey == VK_LMENU
804824 || nKey == VK_RMENU) {
805825 for (int i = 0; i < MAX_COMMAND_TYPE; ++i) {
806- if (Commands[m_nCommandID[m_nApplicationID][i][nKey]].fCommand
807- && (Commands[m_nCommandID[m_nApplicationID][i][nKey]].fCommand != CCommands::MetaAlt
826+ if (Commands[m_Config.nCommandID[m_nApplicationID][i][nKey]].fCommand
827+ && (Commands[m_Config.nCommandID[m_nApplicationID][i][nKey]].fCommand != CCommands::MetaAlt
808828 || nKey != VK_MENU && nKey != VK_LMENU && nKey != VK_RMENU)) {
809829 goto HOOK;
810830 }
@@ -824,12 +844,12 @@ LRESULT CALLBACK CXkeymacsDll::KeyboardProc(int nCode, WPARAM wParam, LPARAM lPa
824844 goto DO_NOTHING;
825845 }
826846
827- if (m_nSettingStyle[m_nApplicationID] == SETTING_DISABLE) {
847+ if (m_Config.nSettingStyle[m_nApplicationID] == SETTING_DISABLE) {
828848 goto DO_NOTHING;
829849 }
830850
831851 // Do Nothing for Meadow, Mule for Win32, ... if those use default setting.
832- if (!_tcsicmp(m_szSpecialApp[m_nApplicationID], _T("Default"))
852+ if (!_tcsicmp(m_Config.szSpecialApp[m_nApplicationID], _T("Default"))
833853 && CUtils::IsDefaultIgnoreApplication()) {
834854 goto DO_NOTHING;
835855 }
@@ -864,9 +884,9 @@ LRESULT CALLBACK CXkeymacsDll::KeyboardProc(int nCode, WPARAM wParam, LPARAM lPa
864884
865885 // Ignore undefined C-x ?
866886 if (nCommandType & CONTROLX) {
867- if (Commands[m_nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == NULL
868- && m_nFunctionID[m_nApplicationID][nCommandType][nKey] < 0) {
869- if (m_bIgnoreUndefinedC_x[m_nApplicationID]) {
887+ if (Commands[m_Config.nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == NULL
888+ && m_Config.nFunctionID[m_nApplicationID][nCommandType][nKey] < 0) {
889+ if (m_Config.bIgnoreUndefinedC_x[m_nApplicationID]) {
870890 CCommands::Reset(GOTO_HOOK);
871891 goto HOOK;
872892 }
@@ -876,9 +896,9 @@ LRESULT CALLBACK CXkeymacsDll::KeyboardProc(int nCode, WPARAM wParam, LPARAM lPa
876896
877897 // Ignore undefined Meta Ctrl+?
878898 if (CCommands::bM_() && (nCommandType & CONTROL)) {
879- if (Commands[m_nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == NULL
880- && m_nFunctionID[m_nApplicationID][nCommandType][nKey] < 0) {
881- if (m_bIgnoreUndefinedMetaCtrl[m_nApplicationID]) {
899+ if (Commands[m_Config.nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == NULL
900+ && m_Config.nFunctionID[m_nApplicationID][nCommandType][nKey] < 0) {
901+ if (m_Config.bIgnoreUndefinedMetaCtrl[m_nApplicationID]) {
882902 if (Original(CONTROL, nKey)) {
883903 Original(CONTROL, nKey, -1);
884904 goto DO_NOTHING;
@@ -910,17 +930,17 @@ LRESULT CALLBACK CXkeymacsDll::KeyboardProc(int nCode, WPARAM wParam, LPARAM lPa
910930 }
911931 }
912932
913- if (Commands[m_nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == CCommands::EnableOrDisableXKeymacs) {
933+ if (Commands[m_Config.nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == CCommands::EnableOrDisableXKeymacs) {
914934 SetKeyboardHookFlag(!m_bHook);
915935 goto HOOK;
916936 }
917- if (Commands[m_nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == CCommands::EnableXKeymacs) {
937+ if (Commands[m_Config.nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == CCommands::EnableXKeymacs) {
918938 if (!m_bHook) {
919939 SetKeyboardHookFlag(!m_bHook);
920940 }
921941 goto HOOK;
922942 }
923- if (Commands[m_nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == CCommands::DisableXKeymacs) {
943+ if (Commands[m_Config.nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == CCommands::DisableXKeymacs) {
924944 if (m_bHook) {
925945 SetKeyboardHookFlag(!m_bHook);
926946 }
@@ -936,42 +956,42 @@ LRESULT CALLBACK CXkeymacsDll::KeyboardProc(int nCode, WPARAM wParam, LPARAM lPa
936956
937957 if (lParam & BEING_RELEASED) {
938958 // ignore
939- } else if (Commands[m_nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == CCommands::BackwardChar) {
959+ } else if (Commands[m_Config.nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == CCommands::BackwardChar) {
940960 if (index) {
941961 --index;
942962 }
943963 goto HOOKX;
944- } else if (Commands[m_nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == CCommands::BeginningOfLine) {
964+ } else if (Commands[m_Config.nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == CCommands::BeginningOfLine) {
945965 index = 0;
946966 goto HOOKX;
947- } else if (Commands[m_nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == CCommands::DeleteBackwardChar) {
967+ } else if (Commands[m_Config.nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == CCommands::DeleteBackwardChar) {
948968 if (index) {
949969 --index;
950970 memmove(&szPath[index], &szPath[index + 1], _tcslen(szPath) - index);
951971 SetM_xTip(szPath);
952972 }
953973 goto HOOKX;
954- } else if (Commands[m_nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == CCommands::DeleteChar) {
974+ } else if (Commands[m_Config.nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == CCommands::DeleteChar) {
955975 if (index < _tcslen(szPath)) {
956976 memmove(&szPath[index], &szPath[index + 1], _tcslen(szPath) - index);
957977 SetM_xTip(szPath);
958978 }
959979 goto HOOKX;
960- } else if (Commands[m_nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == CCommands::EndOfLine) {
980+ } else if (Commands[m_Config.nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == CCommands::EndOfLine) {
961981 index = _tcslen(szPath);
962982 goto HOOKX;
963- } else if (Commands[m_nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == CCommands::ForwardChar) {
983+ } else if (Commands[m_Config.nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == CCommands::ForwardChar) {
964984 if (index < _tcslen(szPath)) {
965985 ++index;
966986 }
967987 goto HOOKX;
968- } else if (Commands[m_nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == CCommands::KeyboardQuit) {
988+ } else if (Commands[m_Config.nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == CCommands::KeyboardQuit) {
969989 CCommands::bM_x(FALSE);
970990 index = 0;
971991 memset(szPath, 0, sizeof(szPath));
972992 goto HOOK;
973993 } else if (nKey == VK_RETURN
974- || Commands[m_nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == CCommands::Newline) {
994+ || Commands[m_Config.nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == CCommands::Newline) {
975995 InvokeM_x(szPath);
976996
977997 CCommands::bM_x(FALSE);
@@ -1006,47 +1026,47 @@ LRESULT CALLBACK CXkeymacsDll::KeyboardProc(int nCode, WPARAM wParam, LPARAM lPa
10061026 }
10071027 }
10081028
1009- if (Commands[m_nCommandID[m_nApplicationID][nCommandType & ~CONTROL][nKey]].fCommand == CCommands::OneShotModifierCtrl) {
1029+ if (Commands[m_Config.nCommandID[m_nApplicationID][nCommandType & ~CONTROL][nKey]].fCommand == CCommands::OneShotModifierCtrl) {
10101030 nOneShotModifier[nKey] = VK_LCONTROL;
10111031 DepressKey(nOneShotModifier[nKey]);
10121032 bCherryOneShotModifier = TRUE;
10131033 goto HOOK;
1014- } else if (Commands[m_nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == CCommands::OneShotModifierCtrlRepeat) {
1034+ } else if (Commands[m_Config.nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == CCommands::OneShotModifierCtrlRepeat) {
10151035 nOneShotModifier[nKey] = VK_LCONTROL;
10161036 DepressKey(nOneShotModifier[nKey]);
10171037 bCherryOneShotModifier = TRUE;
10181038 goto HOOK;
1019- } else if (Commands[m_nCommandID[m_nApplicationID][nCommandType & ~CONTROL][nKey]].fCommand == CCommands::OneShotModifierCtrlRepeat) {
1039+ } else if (Commands[m_Config.nCommandID[m_nApplicationID][nCommandType & ~CONTROL][nKey]].fCommand == CCommands::OneShotModifierCtrlRepeat) {
10201040 ReleaseKey(nOneShotModifier[nKey]);
10211041 bCherryOneShotModifier = FALSE;
10221042 Kdu(nKey);
10231043 goto HOOK;
1024- } else if (Commands[m_nCommandID[m_nApplicationID][nCommandType & ~META][nKey]].fCommand == CCommands::OneShotModifierAlt) {
1044+ } else if (Commands[m_Config.nCommandID[m_nApplicationID][nCommandType & ~META][nKey]].fCommand == CCommands::OneShotModifierAlt) {
10251045 nOneShotModifier[nKey] = VK_LMENU;
10261046 DepressKey(nOneShotModifier[nKey]);
10271047 bCherryOneShotModifier = TRUE;
10281048 goto HOOK;
1029- } else if (Commands[m_nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == CCommands::OneShotModifierAltRepeat) {
1049+ } else if (Commands[m_Config.nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == CCommands::OneShotModifierAltRepeat) {
10301050 nOneShotModifier[nKey] = VK_LMENU;
10311051 DepressKey(nOneShotModifier[nKey]);
10321052 bCherryOneShotModifier = TRUE;
10331053 goto HOOK;
1034- } else if (Commands[m_nCommandID[m_nApplicationID][nCommandType & ~META][nKey]].fCommand == CCommands::OneShotModifierAltRepeat) {
1054+ } else if (Commands[m_Config.nCommandID[m_nApplicationID][nCommandType & ~META][nKey]].fCommand == CCommands::OneShotModifierAltRepeat) {
10351055 ReleaseKey(nOneShotModifier[nKey]);
10361056 bCherryOneShotModifier = FALSE;
10371057 Kdu(nKey);
10381058 goto HOOK;
1039- } else if (Commands[m_nCommandID[m_nApplicationID][nCommandType & ~SHIFT][nKey]].fCommand == CCommands::OneShotModifierShift) {
1059+ } else if (Commands[m_Config.nCommandID[m_nApplicationID][nCommandType & ~SHIFT][nKey]].fCommand == CCommands::OneShotModifierShift) {
10401060 nOneShotModifier[nKey] = VK_SHIFT;
10411061 DepressKey(nOneShotModifier[nKey]);
10421062 bCherryOneShotModifier = TRUE;
10431063 goto HOOK;
1044- } else if (Commands[m_nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == CCommands::OneShotModifierShiftRepeat) {
1064+ } else if (Commands[m_Config.nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand == CCommands::OneShotModifierShiftRepeat) {
10451065 nOneShotModifier[nKey] = VK_SHIFT;
10461066 DepressKey(nOneShotModifier[nKey]);
10471067 bCherryOneShotModifier = TRUE;
10481068 goto HOOK;
1049- } else if (Commands[m_nCommandID[m_nApplicationID][nCommandType & ~SHIFT][nKey]].fCommand == CCommands::OneShotModifierShiftRepeat) {
1069+ } else if (Commands[m_Config.nCommandID[m_nApplicationID][nCommandType & ~SHIFT][nKey]].fCommand == CCommands::OneShotModifierShiftRepeat) {
10501070 ReleaseKey(nOneShotModifier[nKey]);
10511071 bCherryOneShotModifier = FALSE;
10521072 Kdu(nKey);
@@ -1062,15 +1082,15 @@ LRESULT CALLBACK CXkeymacsDll::KeyboardProc(int nCode, WPARAM wParam, LPARAM lPa
10621082 }
10631083 }
10641084
1065- if (0 <= m_nFunctionID[m_nApplicationID][nCommandType][nKey]
1066- && m_nFunctionID[m_nApplicationID][nCommandType][nKey] < MAX_FUNCTION
1067- && _tcslen(m_szFunctionDefinition[m_nFunctionID[m_nApplicationID][nCommandType][nKey]])) {
1068- CallFunction(m_nFunctionID[m_nApplicationID][nCommandType][nKey]);
1085+ if (0 <= m_Config.nFunctionID[m_nApplicationID][nCommandType][nKey]
1086+ && m_Config.nFunctionID[m_nApplicationID][nCommandType][nKey] < MAX_FUNCTION
1087+ && _tcslen(m_Config.szFunctionDefinition[m_Config.nFunctionID[m_nApplicationID][nCommandType][nKey]])) {
1088+ CallFunction(m_Config.nFunctionID[m_nApplicationID][nCommandType][nKey]);
10691089 CCommands::Reset(GOTO_HOOK);
10701090 goto HOOK;
10711091 }
10721092
1073- if (!Commands[m_nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand) {
1093+ if (!Commands[m_Config.nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand) {
10741094 if (nKey == VK_CONTROL
10751095 || nKey == VK_LCONTROL
10761096 || nKey == VK_RCONTROL
@@ -1103,12 +1123,12 @@ LRESULT CALLBACK CXkeymacsDll::KeyboardProc(int nCode, WPARAM wParam, LPARAM lPa
11031123 }
11041124
11051125 if (CCommands::IsTemporarilyDisableXKeymacs()
1106- && Commands[m_nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand != CCommands::KeyboardQuit) {
1126+ && Commands[m_Config.nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand != CCommands::KeyboardQuit) {
11071127 CCommands::SetTemporarilyDisableXKeymacs(FALSE);
11081128 goto DO_NOTHING;
11091129 }
11101130
1111- if (m_bAtIbeamCursorOnly[m_nApplicationID][nCommandType][nKey]) {
1131+ if (m_Config.bAtIbeamCursorOnly[m_nApplicationID][nCommandType][nKey]) {
11121132 CURSORINFO cursorinfo = { sizeof(cursorinfo) };
11131133 if (GetCursorInfo(&cursorinfo) && cursorinfo.flags && cursorinfo.hCursor != LoadCursor(NULL, IDC_IBEAM)) {
11141134 goto DO_NOTHING;
@@ -1121,7 +1141,7 @@ LRESULT CALLBACK CXkeymacsDll::KeyboardProc(int nCode, WPARAM wParam, LPARAM lPa
11211141
11221142 if (!bLocked) {
11231143 bLocked = TRUE;
1124- fCommand = Commands[m_nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand;
1144+ fCommand = Commands[m_Config.nCommandID[m_nApplicationID][nCommandType][nKey]].fCommand;
11251145 RECURSIVE_COMMAND:
11261146 switch (fCommand()) {
11271147 case GOTO_DO_NOTHING:
@@ -1218,46 +1238,46 @@ void CXkeymacsDll::SetModifierIcons()
12181238
12191239 void CXkeymacsDll::SetApplicationName(int nApplicationID, CString szApplicationName)
12201240 {
1221- ZeroMemory(m_szSpecialApp[nApplicationID], sizeof(m_szSpecialApp[nApplicationID]));
1222- _tcsncpy(m_szSpecialApp[nApplicationID], szApplicationName, sizeof(m_szSpecialApp[nApplicationID]));
1241+ ZeroMemory(m_Config.szSpecialApp[nApplicationID], sizeof(m_Config.szSpecialApp[nApplicationID]));
1242+ _tcsncpy(m_Config.szSpecialApp[nApplicationID], szApplicationName, sizeof(m_Config.szSpecialApp[nApplicationID]));
12231243 }
12241244
12251245 void CXkeymacsDll::SetWindowText(int nApplicationID, CString szWindowText)
12261246 {
1227- ZeroMemory(m_szWindowText[nApplicationID], sizeof(m_szWindowText[nApplicationID]));
1228- _tcsncpy(m_szWindowText[nApplicationID], szWindowText, sizeof(m_szWindowText[nApplicationID]));
1247+ ZeroMemory(m_Config.szWindowText[nApplicationID], sizeof(m_Config.szWindowText[nApplicationID]));
1248+ _tcsncpy(m_Config.szWindowText[nApplicationID], szWindowText, sizeof(m_Config.szWindowText[nApplicationID]));
12291249 }
12301250
12311251 void CXkeymacsDll::SetCommandID(int nApplicationID, int nCommandType, int nKey, int nCommandID)
12321252 {
1233- m_nCommandID[nApplicationID][nCommandType][nKey] = nCommandID;
1253+ m_Config.nCommandID[nApplicationID][nCommandType][nKey] = nCommandID;
12341254 }
12351255
12361256 void CXkeymacsDll::SetAtIbeamCursorOnly(int nApplicationID, int nCommandType, int nKey, BOOL bAtIbeamCursorOnly)
12371257 {
1238- m_bAtIbeamCursorOnly[nApplicationID][nCommandType][nKey] = bAtIbeamCursorOnly;
1258+ m_Config.bAtIbeamCursorOnly[nApplicationID][nCommandType][nKey] = bAtIbeamCursorOnly;
12391259 }
12401260
12411261 void CXkeymacsDll::SetKillRingMax(int nApplicationID, int nKillRingMax)
12421262 {
1243- m_nKillRingMax[nApplicationID] = nKillRingMax;
1263+ m_Config.nKillRingMax[nApplicationID] = nKillRingMax;
12441264 }
12451265
12461266 void CXkeymacsDll::SetUseDialogSetting(int nApplicationID, BOOL bUseDialogSetting)
12471267 {
1248- m_bUseDialogSetting[nApplicationID] = bUseDialogSetting;
1268+ m_Config.bUseDialogSetting[nApplicationID] = bUseDialogSetting;
12491269 }
12501270
12511271 // Clear data of nApplicationID
12521272 void CXkeymacsDll::Clear(int nApplicationID)
12531273 {
12541274 if (0 <= nApplicationID && nApplicationID < MAX_APP) {
1255- ZeroMemory(m_szSpecialApp[nApplicationID], sizeof(m_szSpecialApp[nApplicationID]));
1256- ZeroMemory(m_nCommandID[nApplicationID], sizeof(m_nCommandID[nApplicationID]));
1257- ZeroMemory(m_bAtIbeamCursorOnly[nApplicationID], sizeof(m_bAtIbeamCursorOnly[nApplicationID]));
1258- m_nKillRingMax[nApplicationID] = 0;
1259- m_bUseDialogSetting[nApplicationID] = FALSE;
1260- m_nSettingStyle[nApplicationID] = 0;
1275+ ZeroMemory(m_Config.szSpecialApp[nApplicationID], sizeof(m_Config.szSpecialApp[nApplicationID]));
1276+ ZeroMemory(m_Config.nCommandID[nApplicationID], sizeof(m_Config.nCommandID[nApplicationID]));
1277+ ZeroMemory(m_Config.bAtIbeamCursorOnly[nApplicationID], sizeof(m_Config.bAtIbeamCursorOnly[nApplicationID]));
1278+ m_Config.nKillRingMax[nApplicationID] = 0;
1279+ m_Config.bUseDialogSetting[nApplicationID] = FALSE;
1280+ m_Config.nSettingStyle[nApplicationID] = 0;
12611281 } else {
12621282 ASSERT(0);
12631283 }
@@ -1287,7 +1307,7 @@ BOOL CXkeymacsDll::IsDepressedModifier(int (__cdecl *Modifier)(void), BOOL bPhys
12871307 do {
12881308 if (IsValidKey(bVk)
12891309 && IsDown(bVk, bPhysicalKey)
1290- && Commands[m_nCommandID[m_nApplicationID][NONE][bVk]].fCommand == Modifier) {
1310+ && Commands[m_Config.nCommandID[m_nApplicationID][NONE][bVk]].fCommand == Modifier) {
12911311 return TRUE;
12921312 }
12931313 } while (++bVk);
@@ -1329,7 +1349,7 @@ BOOL CXkeymacsDll::IsMeta()
13291349
13301350 void CXkeymacsDll::AddKillRing(BOOL bNewData)
13311351 {
1332- if (m_nKillRingMax[m_nApplicationID] == 0) {
1352+ if (m_Config.nKillRingMax[m_nApplicationID] == 0) {
13331353 return;
13341354 }
13351355
@@ -1359,7 +1379,7 @@ void CXkeymacsDll::AddKillRing(BOOL bNewData)
13591379
13601380 m_nKillRing = 0;
13611381
1362- if (m_nKillRingMax[m_nApplicationID] < m_oKillRing.GetCount()) {
1382+ if (m_Config.nKillRingMax[m_nApplicationID] < m_oKillRing.GetCount()) {
13631383 CClipboardSnap *pSnap = m_oKillRing.GetTail();
13641384 delete pSnap;
13651385 pSnap = NULL;
@@ -1371,7 +1391,7 @@ void CXkeymacsDll::AddKillRing(BOOL bNewData)
13711391 // Return FALSE if there is no more data
13721392 CClipboardSnap* CXkeymacsDll::GetKillRing(CClipboardSnap* pSnap, BOOL bForce)
13731393 {
1374- if (m_nKillRingMax[m_nApplicationID] == 0) {
1394+ if (m_Config.nKillRingMax[m_nApplicationID] == 0) {
13751395 return NULL;
13761396 }
13771397
@@ -1481,27 +1501,27 @@ int CXkeymacsDll::GetMickey(int nDifferential, int nThreshold1, int nThreshold2,
14811501
14821502 void CXkeymacsDll::SetSettingStyle(int nApplicationID, int nSettingStyle)
14831503 {
1484- m_nSettingStyle[nApplicationID] = nSettingStyle;
1504+ m_Config.nSettingStyle[nApplicationID] = nSettingStyle;
14851505 }
14861506
14871507 void CXkeymacsDll::SetIgnoreUndefinedMetaCtrl(int nApplicationID, BOOL bIgnoreUndefinedMetaCtrl)
14881508 {
1489- m_bIgnoreUndefinedMetaCtrl[nApplicationID] = bIgnoreUndefinedMetaCtrl;
1509+ m_Config.bIgnoreUndefinedMetaCtrl[nApplicationID] = bIgnoreUndefinedMetaCtrl;
14901510 }
14911511
14921512 void CXkeymacsDll::SetIgnoreUndefinedC_x(int nApplicationID, BOOL bIgnoreUndefinedC_x)
14931513 {
1494- m_bIgnoreUndefinedC_x[nApplicationID] = bIgnoreUndefinedC_x;
1514+ m_Config.bIgnoreUndefinedC_x[nApplicationID] = bIgnoreUndefinedC_x;
14951515 }
14961516
14971517 void CXkeymacsDll::SetEnableCUA(int nApplicationID, BOOL bEnableCUA)
14981518 {
1499- m_bEnableCUA[nApplicationID] = bEnableCUA;
1519+ m_Config.bEnableCUA[nApplicationID] = bEnableCUA;
15001520 }
15011521
15021522 BOOL CXkeymacsDll::GetEnableCUA()
15031523 {
1504- return m_bEnableCUA[m_nApplicationID];
1524+ return m_Config.bEnableCUA[m_nApplicationID];
15051525 }
15061526
15071527 void CXkeymacsDll::DefiningMacro(BOOL bDefiningMacro)
@@ -1621,12 +1641,12 @@ void CXkeymacsDll::CallMacro() // for debug
16211641
16221642 void CXkeymacsDll::Set106Keyboard(BOOL b106Keyboard)
16231643 {
1624- m_b106Keyboard = b106Keyboard;
1644+ m_Config.b106Keyboard = b106Keyboard;
16251645 }
16261646
16271647 BOOL CXkeymacsDll::Is106Keyboard()
16281648 {
1629- return m_b106Keyboard;
1649+ return m_Config.b106Keyboard;
16301650 }
16311651
16321652 int CXkeymacsDll::IsPassThrough(BYTE nKey)
@@ -1634,7 +1654,7 @@ int CXkeymacsDll::IsPassThrough(BYTE nKey)
16341654 BYTE bVk = 0;
16351655 do {
16361656 if (IsDown(bVk)
1637- && (Commands[m_nCommandID[m_nApplicationID][NONE][bVk]].fCommand == CCommands::PassThrough)) {
1657+ && (Commands[m_Config.nCommandID[m_nApplicationID][NONE][bVk]].fCommand == CCommands::PassThrough)) {
16381658 if (bVk == nKey) {
16391659 return GOTO_HOOK;
16401660 }
@@ -1658,13 +1678,13 @@ void CXkeymacsDll::SetFunctionKey(int nFunctionID, int nApplicationID, int nComm
16581678 return;
16591679 }
16601680
1661- m_nFunctionID[nApplicationID][nCommandType][nKey] = nFunctionID;
1681+ m_Config.nFunctionID[nApplicationID][nCommandType][nKey] = nFunctionID;
16621682 }
16631683
16641684 void CXkeymacsDll::ClearFunctionDefinition()
16651685 {
1666- memset(m_nFunctionID, -1, sizeof(m_nFunctionID));
1667- memset(m_szFunctionDefinition, 0, sizeof(m_szFunctionDefinition));
1686+ memset(m_Config.nFunctionID, -1, sizeof(m_Config.nFunctionID));
1687+ memset(m_Config.szFunctionDefinition, 0, sizeof(m_Config.szFunctionDefinition));
16681688 }
16691689
16701690 void CXkeymacsDll::SetFunctionDefinition(int nFunctionID, CString szDefinition)
@@ -1673,8 +1693,8 @@ void CXkeymacsDll::SetFunctionDefinition(int nFunctionID, CString szDefinition)
16731693 return;
16741694 }
16751695
1676- memset(m_szFunctionDefinition[nFunctionID], 0, sizeof(m_szFunctionDefinition[nFunctionID]));
1677- _stprintf(m_szFunctionDefinition[nFunctionID], _T("%s"), szDefinition);
1696+ memset(m_Config.szFunctionDefinition[nFunctionID], 0, sizeof(m_Config.szFunctionDefinition[nFunctionID]));
1697+ _stprintf(m_Config.szFunctionDefinition[nFunctionID], _T("%s"), szDefinition);
16781698
16791699 return;
16801700
@@ -1685,7 +1705,7 @@ void CXkeymacsDll::CallFunction(int nFunctionID)
16851705 {
16861706 CArray<KeyBind, KeyBind> keybinds;
16871707
1688- if (nFunctionID < 0 || MAX_FUNCTION <= nFunctionID || !_tcslen(m_szFunctionDefinition[nFunctionID])) {
1708+ if (nFunctionID < 0 || MAX_FUNCTION <= nFunctionID || !_tcslen(m_Config.szFunctionDefinition[nFunctionID])) {
16891709 return;
16901710 }
16911711
@@ -1693,18 +1713,18 @@ void CXkeymacsDll::CallFunction(int nFunctionID)
16931713 BOOL bIsAltDown = CXkeymacsDll::IsDown(VK_MENU);
16941714 BOOL bIsShiftDown = CXkeymacsDll::IsDown(VK_SHIFT);
16951715
1696- if (m_szFunctionDefinition[nFunctionID][0] == _T('"') && m_szFunctionDefinition[nFunctionID][_tcslen(m_szFunctionDefinition[nFunctionID]) - 1] == _T('"')) {
1697- for (unsigned int i = 1; i < _tcslen(m_szFunctionDefinition[nFunctionID]) - 1; ++i) { // skip '"'
1716+ if (m_Config.szFunctionDefinition[nFunctionID][0] == _T('"') && m_Config.szFunctionDefinition[nFunctionID][_tcslen(m_Config.szFunctionDefinition[nFunctionID]) - 1] == _T('"')) {
1717+ for (unsigned int i = 1; i < _tcslen(m_Config.szFunctionDefinition[nFunctionID]) - 1; ++i) { // skip '"'
16981718 keybinds.Add(ParseKey(nFunctionID, i));
16991719 }
1700- } else if (m_szFunctionDefinition[nFunctionID][0] == _T('[') && m_szFunctionDefinition[nFunctionID][_tcslen(m_szFunctionDefinition[nFunctionID]) - 1] == _T(']')) {
1701- for (unsigned int i = 1; i < _tcslen(m_szFunctionDefinition[nFunctionID]) - 1; ++i) { // skip '[' and ']'
1702- if (m_szFunctionDefinition[nFunctionID][i] == _T('?')) { // [?f ?o ?o]
1720+ } else if (m_Config.szFunctionDefinition[nFunctionID][0] == _T('[') && m_Config.szFunctionDefinition[nFunctionID][_tcslen(m_Config.szFunctionDefinition[nFunctionID]) - 1] == _T(']')) {
1721+ for (unsigned int i = 1; i < _tcslen(m_Config.szFunctionDefinition[nFunctionID]) - 1; ++i) { // skip '[' and ']'
1722+ if (m_Config.szFunctionDefinition[nFunctionID][i] == _T('?')) { // [?f ?o ?o]
17031723 ++i;
17041724 keybinds.Add(ParseKey(nFunctionID, i));
17051725 } else { // [ControlCharacter]
17061726 for (int nKeyID = 0; nKeyID < sizeof(ControlCharacters) / sizeof(ControlCharacters[0]); ++nKeyID) {
1707- if (!_tcsncmp(m_szFunctionDefinition[nFunctionID] + i, ControlCharacters[nKeyID].name, _tcslen(ControlCharacters[nKeyID].name))) {
1727+ if (!_tcsncmp(m_Config.szFunctionDefinition[nFunctionID] + i, ControlCharacters[nKeyID].name, _tcslen(ControlCharacters[nKeyID].name))) {
17081728 KeyBind keybind = {NONE, ControlCharacters[nKeyID].bVk};
17091729 keybinds.Add(keybind);
17101730 i += _tcslen(ControlCharacters[nKeyID].name);
@@ -1726,8 +1746,8 @@ void CXkeymacsDll::CallFunction(int nFunctionID)
17261746 const int nCommandType = keybinds.GetAt(i).nCommandType;
17271747 const BYTE bVk = keybinds.GetAt(i).bVk;
17281748
1729- if (nCommandType < MAX_COMMAND_TYPE && Commands[m_nCommandID[m_nApplicationID][nCommandType][bVk]].fCommand) {
1730- if (Commands[m_nCommandID[m_nApplicationID][nCommandType][bVk]].fCommand == CCommands::ExecuteExtendedCommand) {
1749+ if (nCommandType < MAX_COMMAND_TYPE && Commands[m_Config.nCommandID[m_nApplicationID][nCommandType][bVk]].fCommand) {
1750+ if (Commands[m_Config.nCommandID[m_nApplicationID][nCommandType][bVk]].fCommand == CCommands::ExecuteExtendedCommand) {
17311751 bM_x = TRUE;
17321752 } else if (!bInitialized) {
17331753 if (bIsCtrlDown) {
@@ -1745,8 +1765,8 @@ void CXkeymacsDll::CallFunction(int nFunctionID)
17451765
17461766 bInitialized = TRUE;
17471767 }
1748-// CUtils::Log("CallFunction: Command Name: %s", Commands[m_nCommandID[m_nApplicationID][nCommandType][bVk]].szCommandName);
1749- while (Commands[m_nCommandID[m_nApplicationID][nCommandType][bVk]].fCommand() == GOTO_RECURSIVE) {
1768+// CUtils::Log("CallFunction: Command Name: %s", Commands[m_Config.nCommandID[m_nApplicationID][nCommandType][bVk]].szCommandName);
1769+ while (Commands[m_Config.nCommandID[m_nApplicationID][nCommandType][bVk]].fCommand() == GOTO_RECURSIVE) {
17501770 ;
17511771 }
17521772 } else if (bM_x) {
@@ -1833,14 +1853,14 @@ KeyBind CXkeymacsDll::ParseKey(const int nFunctionID, unsigned int &i)
18331853 {
18341854 KeyBind keybind = {NONE};
18351855
1836- if (m_szFunctionDefinition[nFunctionID][i] == _T('\\')) {
1856+ if (m_Config.szFunctionDefinition[nFunctionID][i] == _T('\\')) {
18371857 ++i;
18381858 BOOL bFound = FALSE;
18391859 do {
18401860 bFound = FALSE;
18411861 for (int ModifierID = 0; ModifierID < sizeof(Modifiers) / sizeof(Modifiers[0]); ++ModifierID) {
1842- if (!_tcsncmp(m_szFunctionDefinition[nFunctionID] + i, Modifiers[ModifierID].name, _tcslen(Modifiers[ModifierID].name))
1843- && _tcslen(Modifiers[ModifierID].name) < _tcslen(m_szFunctionDefinition[nFunctionID] + i)) {
1862+ if (!_tcsncmp(m_Config.szFunctionDefinition[nFunctionID] + i, Modifiers[ModifierID].name, _tcslen(Modifiers[ModifierID].name))
1863+ && _tcslen(Modifiers[ModifierID].name) < _tcslen(m_Config.szFunctionDefinition[nFunctionID] + i)) {
18441864 keybind.nCommandType |= Modifiers[ModifierID].id;
18451865 i+= _tcslen(Modifiers[ModifierID].name);
18461866 bFound = TRUE;
@@ -1848,12 +1868,12 @@ KeyBind CXkeymacsDll::ParseKey(const int nFunctionID, unsigned int &i)
18481868 }
18491869 } while (bFound);
18501870 }
1851- if (IsShift(m_szFunctionDefinition[nFunctionID][i]) && !(keybind.nCommandType & (WIN_CTRL | WIN_ALT | WIN_WIN))) {
1871+ if (IsShift(m_Config.szFunctionDefinition[nFunctionID][i]) && !(keybind.nCommandType & (WIN_CTRL | WIN_ALT | WIN_WIN))) {
18521872 keybind.nCommandType |= SHIFT;
18531873 }
18541874
18551875 for (int nKeyID = 0; nKeyID < sizeof(ControlCharacters) / sizeof(ControlCharacters[0]); ++nKeyID) {
1856- if (!_tcsncmp(m_szFunctionDefinition[nFunctionID] + i, ControlCharacters[nKeyID].name, _tcslen(ControlCharacters[nKeyID].name))) {
1876+ if (!_tcsncmp(m_Config.szFunctionDefinition[nFunctionID] + i, ControlCharacters[nKeyID].name, _tcslen(ControlCharacters[nKeyID].name))) {
18571877 i += _tcslen(ControlCharacters[nKeyID].name);
18581878 break;
18591879 }
@@ -1861,7 +1881,7 @@ KeyBind CXkeymacsDll::ParseKey(const int nFunctionID, unsigned int &i)
18611881 if (nKeyID < sizeof(ControlCharacters) / sizeof(ControlCharacters[0])) {
18621882 keybind.bVk = ControlCharacters[nKeyID].bVk;
18631883 } else {
1864- keybind.bVk = a2v(m_szFunctionDefinition[nFunctionID][i]);
1884+ keybind.bVk = a2v(m_Config.szFunctionDefinition[nFunctionID][i]);
18651885 }
18661886
18671887 return keybind;
@@ -1880,7 +1900,7 @@ BOOL CXkeymacsDll::IsShift(TCHAR nAscii)
18801900 case _T('&'):
18811901 return TRUE;
18821902 case _T('\''):
1883- return m_b106Keyboard;
1903+ return m_Config.b106Keyboard;
18841904 case _T('('):
18851905 case _T(')'):
18861906 case _T('*'):
@@ -1893,18 +1913,18 @@ BOOL CXkeymacsDll::IsShift(TCHAR nAscii)
18931913 case _T('0'): case _T('1'): case _T('2'): case _T('3'): case _T('4'): case _T('5'): case _T('6'): case _T('7'): case _T('8'): case _T('9'):
18941914 return FALSE;
18951915 case _T(':'):
1896- return !m_b106Keyboard;
1916+ return !m_Config.b106Keyboard;
18971917 case _T(';'):
18981918 return FALSE;
18991919 case _T('<'):
19001920 return TRUE;
19011921 case _T('='):
1902- return m_b106Keyboard;
1922+ return m_Config.b106Keyboard;
19031923 case _T('>'):
19041924 case _T('?'):
19051925 return TRUE;
19061926 case _T('@'):
1907- return !m_b106Keyboard;
1927+ return !m_Config.b106Keyboard;
19081928 case _T('A'): case _T('B'): case _T('C'): case _T('D'): case _T('E'): case _T('F'): case _T('G'): case _T('H'): case _T('I'): case _T('J'):
19091929 case _T('K'): case _T('L'): case _T('M'): case _T('N'): case _T('O'): case _T('P'): case _T('Q'): case _T('R'): case _T('S'): case _T('T'):
19101930 case _T('U'): case _T('V'): case _T('W'): case _T('X'): case _T('Y'): case _T('Z'):
@@ -1914,11 +1934,11 @@ BOOL CXkeymacsDll::IsShift(TCHAR nAscii)
19141934 case _T(']'):
19151935 return FALSE;
19161936 case _T('^'):
1917- return !m_b106Keyboard;
1937+ return !m_Config.b106Keyboard;
19181938 case _T('_'):
19191939 return TRUE;
19201940 case _T('`'):
1921- return m_b106Keyboard;
1941+ return m_Config.b106Keyboard;
19221942 case _T('a'): case _T('b'): case _T('c'): case _T('d'): case _T('e'): case _T('f'): case _T('g'): case _T('h'): case _T('i'): case _T('j'):
19231943 case _T('k'): case _T('l'): case _T('m'): case _T('n'): case _T('o'): case _T('p'): case _T('q'): case _T('r'): case _T('s'): case _T('t'):
19241944 case _T('u'): case _T('v'): case _T('w'): case _T('x'): case _T('y'): case _T('z'):
@@ -1941,7 +1961,7 @@ BYTE CXkeymacsDll::a2v(TCHAR nAscii)
19411961 case _T('!'):
19421962 return '1';
19431963 case _T('"'):
1944- return m_b106Keyboard ? '2' : (BYTE) 0xde; // VK_OEM_7
1964+ return m_Config.b106Keyboard ? '2' : (BYTE) 0xde; // VK_OEM_7
19451965 case _T('#'):
19461966 return '3';
19471967 case _T('$'):
@@ -1949,15 +1969,15 @@ BYTE CXkeymacsDll::a2v(TCHAR nAscii)
19491969 case _T('%'):
19501970 return '5';
19511971 case _T('&'):
1952- return m_b106Keyboard ? '6' : '7';
1972+ return m_Config.b106Keyboard ? '6' : '7';
19531973 case _T('\''):
1954- return m_b106Keyboard ? '7' : (BYTE) 0xde; // VK_OEM_7
1974+ return m_Config.b106Keyboard ? '7' : (BYTE) 0xde; // VK_OEM_7
19551975 case _T('('):
1956- return m_b106Keyboard ? '8' : '9';
1976+ return m_Config.b106Keyboard ? '8' : '9';
19571977 case _T(')'):
1958- return m_b106Keyboard ? '9' : '0';
1978+ return m_Config.b106Keyboard ? '9' : '0';
19591979 case _T('*'):
1960- return m_b106Keyboard ? (BYTE) 0xba : '8'; // VK_OEM_1
1980+ return m_Config.b106Keyboard ? (BYTE) 0xba : '8'; // VK_OEM_1
19611981 case _T('+'):
19621982 return 0xbb; // VK_OEM_PLUS
19631983 case _T(','):
@@ -1973,17 +1993,17 @@ BYTE CXkeymacsDll::a2v(TCHAR nAscii)
19731993 case _T(':'):
19741994 return 0xba; // VK_OEM_1
19751995 case _T(';'):
1976- return m_b106Keyboard ? (BYTE) 0xbb : (BYTE) 0xba; // VK_OEM_PLUS VK_OEM_1
1996+ return m_Config.b106Keyboard ? (BYTE) 0xbb : (BYTE) 0xba; // VK_OEM_PLUS VK_OEM_1
19771997 case _T('<'):
19781998 return 0xbc; // VK_OEM_COMMA
19791999 case _T('='):
1980- return m_b106Keyboard ? (BYTE) 0xbd : (BYTE) 0xbb; // VK_OEM_MINUS VK_OEM_PLUS
2000+ return m_Config.b106Keyboard ? (BYTE) 0xbd : (BYTE) 0xbb; // VK_OEM_MINUS VK_OEM_PLUS
19812001 case _T('>'):
19822002 return 0xbe; // VK_OEM_PERIOD
19832003 case _T('?'):
19842004 return 0xbf; // VK_OEM_2
19852005 case _T('@'):
1986- return m_b106Keyboard ? (BYTE) 0xc0 : '2';
2006+ return m_Config.b106Keyboard ? (BYTE) 0xc0 : '2';
19872007 case _T('A'): case _T('B'): case _T('C'): case _T('D'): case _T('E'): case _T('F'): case _T('G'): case _T('H'): case _T('I'): case _T('J'):
19882008 case _T('K'): case _T('L'): case _T('M'): case _T('N'): case _T('O'): case _T('P'): case _T('Q'): case _T('R'): case _T('S'): case _T('T'):
19892009 case _T('U'): case _T('V'): case _T('W'): case _T('X'): case _T('Y'): case _T('Z'):
@@ -1995,9 +2015,9 @@ BYTE CXkeymacsDll::a2v(TCHAR nAscii)
19952015 case _T(']'):
19962016 return 0xdd; // VK_OEM_6
19972017 case _T('^'):
1998- return m_b106Keyboard ? (BYTE) 0xde : '6'; // VK_OEM_7
2018+ return m_Config.b106Keyboard ? (BYTE) 0xde : '6'; // VK_OEM_7
19992019 case _T('_'):
2000- return m_b106Keyboard ? (BYTE) 0xe2 : (BYTE) 0xbd; // VK_OEM_102 VK_OEM_MINUS
2020+ return m_Config.b106Keyboard ? (BYTE) 0xe2 : (BYTE) 0xbd; // VK_OEM_102 VK_OEM_MINUS
20012021 case _T('`'):
20022022 return 0xc0; // VK_OEM_3
20032023 case _T('a'): case _T('b'): case _T('c'): case _T('d'): case _T('e'): case _T('f'): case _T('g'): case _T('h'): case _T('i'): case _T('j'):
@@ -2011,7 +2031,7 @@ BYTE CXkeymacsDll::a2v(TCHAR nAscii)
20112031 case _T('}'):
20122032 return 0xdd; // VK_OEM_6
20132033 case _T('~'):
2014- return m_b106Keyboard ? (BYTE) 0xde : (BYTE) 0xc0; // VK_OEM_7 VK_OEM_3
2034+ return m_Config.b106Keyboard ? (BYTE) 0xde : (BYTE) 0xc0; // VK_OEM_7 VK_OEM_3
20152035 default:
20162036 return 0;
20172037 }
@@ -2096,12 +2116,12 @@ void CXkeymacsDll::DoSetCursor()
20962116
20972117 void CXkeymacsDll::Set326Compatible(int nApplicationID, BOOL b326Compatible)
20982118 {
2099- m_b326Compatible[nApplicationID] = b326Compatible;
2119+ m_Config.b326Compatible[nApplicationID] = b326Compatible;
21002120 }
21012121
21022122 BOOL CXkeymacsDll::Get326Compatible()
21032123 {
2104- return m_b326Compatible[m_nApplicationID];
2124+ return m_Config.b326Compatible[m_nApplicationID];
21052125 }
21062126
21072127 void CXkeymacsDll::InvokeM_x(const TCHAR *const szPath)
--- a/xkeymacsdll/xkeymacsdll.h
+++ b/xkeymacsdll/xkeymacsdll.h
@@ -53,6 +53,8 @@ struct KeyName
5353 class AFX_EXT_CLASS CXkeymacsDll
5454 {
5555 public:
56+ static BOOL SaveConfig();
57+ static BOOL LoadConfig();
5658 static void SetM_xTip(const TCHAR *const szPath);
5759 static BOOL Get326Compatible();
5860 static void Set326Compatible(int nApplicationID, BOOL b326Compatible);
@@ -74,6 +76,7 @@ public:
7476 static void SetIgnoreUndefinedC_x(int nApplicationID, BOOL bIgnoreUndefinedC_x);
7577 static void SetIgnoreUndefinedMetaCtrl(int nApplicationID, BOOL bIgnoreUndefinedMetaCtrl);
7678 static void SetHooks();
79+ static void EnableKeyboardHook();
7780 static void SetKeyboardHook();
7881 static void SetSettingStyle(int nApplicationID, int nSettingStyle);
7982 static void SetUseDialogSetting(int nApplicationID, BOOL bUseDialogSetting);
@@ -100,7 +103,6 @@ public:
100103 private:
101104 static TCHAR m_M_xTip[128];
102105 static void InvokeM_x(const TCHAR* const szPath);
103- static BOOL m_b326Compatible[MAX_APP];
104106 static void LogCallWndProcMessage(WPARAM wParam, LPARAM lParam);
105107 static void DoSetCursor();
106108 static HCURSOR m_hCurrentCursor;
@@ -111,7 +113,6 @@ private:
111113 static HHOOK m_hHookCallWndRet;
112114 static LRESULT CALLBACK CallWndRetProc(int nCode, WPARAM wParam, LPARAM lParam);
113115 static BOOL IsMatchWindowText(CString szWindowText);
114- static TCHAR m_szWindowText[MAX_APP][WINDOW_TEXT_LENGTH];
115116 static BOOL m_bEnableKeyboardHook;
116117 static HHOOK m_hHookCallWnd;
117118 static HHOOK m_hHookGetMessage;
@@ -128,12 +129,7 @@ private:
128129 static KeyBind ParseKey(const int nFunctionID, unsigned int &i);
129130 static BYTE a2v(TCHAR nAscii);
130131 static BOOL IsShift(TCHAR nAscii);
131- static TCHAR m_szFunctionDefinition[MAX_FUNCTION][MAX_DEFINITION];
132132 static void CallFunction(int nFunctionID);
133- static int m_nFunctionID[MAX_APP][MAX_COMMAND_TYPE][MAX_KEY];
134- static BOOL m_bEnableCUA[MAX_APP];
135- static TCHAR m_szOldApplicationName[MAX_PATH];
136- static TCHAR m_szApplicationName[MAX_PATH];
137133 static int IsPassThrough(BYTE nKey);
138134 static BOOL IsDepressedShiftKeyOnly(BYTE nKey);
139135 static BOOL IsDepressedModifier(int Modifier(), BOOL bPhysicalKey = TRUE);
@@ -142,25 +138,17 @@ private:
142138 static BOOL m_bDefiningMacro;
143139 static void Original(int nCommandType, BYTE bVk, int nOriginal);
144140 static int Original(int nCommandType, BYTE bVk);
145- static BOOL m_bUseDialogSetting[MAX_APP];
146141 static void InitKeyboardProc(BOOL bImeComposition);
147- static BOOL m_bIgnoreUndefinedC_x[MAX_APP];
148- static BOOL m_bIgnoreUndefinedMetaCtrl[MAX_APP];
149- static int m_nSettingStyle[MAX_APP];
150142 static int m_nApplicationID;
151143 static int m_nOriginal[MAX_COMMAND_TYPE][MAX_KEY];
152144 static int m_nKillRing;
153145 static CList<CClipboardSnap *, CClipboardSnap *> m_oKillRing;
154- static int m_nKillRingMax[MAX_APP];
155146 static int GetMickey(int nDifferential, int nThreshold1, int nThreshold2, int nAcceleration, int nSpeed);
156147 static BOOL m_bHook;
157148 static BOOL m_bRightShift;
158149 static BOOL m_bRightAlt;
159150 static BOOL m_bRightControl;
160- static TCHAR m_szSpecialApp[MAX_APP][CLASS_NAME_LENGTH];
161- static int m_nCommandID[MAX_APP][MAX_COMMAND_TYPE][MAX_KEY];
162- static BOOL m_bAtIbeamCursorOnly[MAX_APP][MAX_COMMAND_TYPE][MAX_KEY];
163- static BOOL m_b106Keyboard;
151+ static CONFIG m_Config;
164152 };
165153
166154 #endif // !defined(AFX_XKEYMACS_H__88552DEC_1233_4A0A_BE62_9EF7BC618EC6__INCLUDED_)