Full Unicode patch with RTL Support & BiDi logic.

This commit is well documented, so no need to tell you my life story.

Full Unicode patch with RTL Support & BiDi logic.

Removed the legacy codePage, normalised to UTF8 (65001).

It also comes with:

CTRL + A : select text (highlighted)
CTRL + C : copy
CTRL + V : paste
CTRL + X : cut
CTRL + Y : redo
CTRL + Z : undo
This commit is contained in:
rtw1x1
2025-12-26 12:32:43 +00:00
parent d37607baa1
commit a955c50744
86 changed files with 4076 additions and 3839 deletions

View File

@@ -68,34 +68,88 @@ void CPythonIME::OnEscape()
// IAbstractApplication::GetSingleton().RunIMEEscapeEvent();
}
bool CPythonIME::OnWM_CHAR( WPARAM wParam, LPARAM lParam )
bool CPythonIME::OnWM_CHAR(WPARAM wParam, LPARAM lParam)
{
unsigned char c = unsigned char(wParam & 0xff);
const wchar_t wc = (wchar_t)wParam;
switch (c)
const bool ctrlDown = (GetKeyState(VK_CONTROL) & 0x8000) != 0;
// Ctrl+<key> combos only when Ctrl is pressed
if (ctrlDown)
{
case VK_RETURN:
OnReturn();
return true;
switch (wc)
{
case 0x01: // Ctrl+A
if (ms_bCaptureInput)
{
SelectAll();
if (ms_pEvent) ms_pEvent->OnUpdate();
return true;
}
return false;
case VK_TAB:
if(ms_bCaptureInput == false)
return 0;
OnTab();
return true;
case 0x1A: // Ctrl+Z
if (ms_bCaptureInput)
{
CIME::Undo();
return true;
}
return false;
case VK_ESCAPE:
if(ms_bCaptureInput == false)
return 0;
OnEscape();
return true;
case 0x03: // Ctrl+C
if (ms_bCaptureInput)
{
CopySelectionToClipboard();
return true;
}
return false;
case 0x16: // Ctrl+V
if (ms_bCaptureInput)
{
PasteTextFromClipBoard();
return true;
}
return false;
case 0x18: // Ctrl+X
if (ms_bCaptureInput)
{
CutSelection();
if (ms_pEvent) ms_pEvent->OnUpdate();
return true;
}
return false;
case 0x19: // Ctrl+Y
if (ms_bCaptureInput)
{
CIME::Redo();
return true;
}
return false;
}
}
return false;
}
void CPythonIME::OnChangeCodePage()
{
IAbstractApplication::GetSingleton().RunIMEChangeCodePage();
// Non-Ctrl special keys (WM_CHAR gives these too)
switch (wc)
{
case VK_RETURN:
OnReturn();
return true;
case VK_TAB:
if (!ms_bCaptureInput) return 0;
OnTab();
return true;
case VK_ESCAPE:
if (!ms_bCaptureInput) return 0;
OnEscape();
return true;
}
return false;
}
void CPythonIME::OnOpenCandidateList()
@@ -117,3 +171,29 @@ void CPythonIME::OnCloseReadingWnd()
{
IAbstractApplication::GetSingleton().RunIMECloseReadingWndEvent();
}
void CPythonIME::SelectAll()
{
CIME::SelectAll();
}
void CPythonIME::DeleteSelection()
{
CIME::DeleteSelection();
}
void CPythonIME::CopySelectionToClipboard()
{
CIME::CopySelectionToClipboard(ms_hWnd);
}
void CPythonIME::CutSelection()
{
CIME::CopySelectionToClipboard(ms_hWnd);
CIME::DeleteSelection();
}
void CPythonIME::PasteTextFromClipBoard()
{
CIME::PasteTextFromClipBoard();
}