port 4-a: text input through CPythonIME (login typed, in-game chat)
- UserInterface/PythonIME(+Module) ported verbatim; ime module stubs removed, initime() after initdbg() - EterLib/IME.cpp in platform/: 40250 buffer/WMChar bodies, IMM/TSF processors no-op; committed multi-byte text via PythonBoot::UIChar emulating GCS_RESULTSTR - GameApplicationAdapter RunIME* -> CWindowManager; Godot keys -> ui_ime_key/ui_char - port.login_flow/login_live type the account through the IME; chat CG_CHAT round-trip on the fake server - python_game_render_test logs in with Godot key events Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
1bda4390d6
commit
6ea0fa9889
@@ -0,0 +1,119 @@
|
||||
#include "StdAfx.h"
|
||||
#include "PythonIME.h"
|
||||
#include "AbstractApplication.h"
|
||||
|
||||
CPythonIME::CPythonIME()
|
||||
: CIME()
|
||||
{
|
||||
ms_pEvent = this;
|
||||
}
|
||||
|
||||
CPythonIME::~CPythonIME()
|
||||
{
|
||||
Tracen("PythonIME Clear");
|
||||
}
|
||||
|
||||
void CPythonIME::Create(HWND hWnd)
|
||||
{
|
||||
Initialize(hWnd);
|
||||
}
|
||||
|
||||
void CPythonIME::MoveLeft()
|
||||
{
|
||||
DecCurPos();
|
||||
}
|
||||
|
||||
void CPythonIME::MoveRight()
|
||||
{
|
||||
IncCurPos();
|
||||
}
|
||||
|
||||
void CPythonIME::MoveHome()
|
||||
{
|
||||
ms_curpos = 0;
|
||||
}
|
||||
|
||||
void CPythonIME::MoveEnd()
|
||||
{
|
||||
ms_curpos = ms_lastpos;
|
||||
}
|
||||
|
||||
void CPythonIME::SetCursorPosition(int iPosition)
|
||||
{
|
||||
SetCurPos(iPosition);
|
||||
}
|
||||
|
||||
void CPythonIME::Delete()
|
||||
{
|
||||
DelCurPos();
|
||||
}
|
||||
|
||||
void CPythonIME::OnUpdate()
|
||||
{
|
||||
IAbstractApplication::GetSingleton().RunIMEUpdate();
|
||||
}
|
||||
|
||||
void CPythonIME::OnTab()
|
||||
{
|
||||
IAbstractApplication::GetSingleton().RunIMETabEvent();
|
||||
}
|
||||
|
||||
void CPythonIME::OnReturn()
|
||||
{
|
||||
IAbstractApplication::GetSingleton().RunIMEReturnEvent();
|
||||
}
|
||||
|
||||
void CPythonIME::OnEscape()
|
||||
{
|
||||
// IAbstractApplication::GetSingleton().RunIMEEscapeEvent();
|
||||
}
|
||||
|
||||
bool CPythonIME::OnWM_CHAR( WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
unsigned char c = (unsigned char)(wParam & 0xff); // PORT: functional cast of a two-word type is MSVC-only.
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case VK_RETURN:
|
||||
OnReturn();
|
||||
return true;
|
||||
|
||||
case VK_TAB:
|
||||
if(ms_bCaptureInput == false)
|
||||
return 0;
|
||||
OnTab();
|
||||
return true;
|
||||
|
||||
case VK_ESCAPE:
|
||||
if(ms_bCaptureInput == false)
|
||||
return 0;
|
||||
OnEscape();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void CPythonIME::OnChangeCodePage()
|
||||
{
|
||||
IAbstractApplication::GetSingleton().RunIMEChangeCodePage();
|
||||
}
|
||||
|
||||
void CPythonIME::OnOpenCandidateList()
|
||||
{
|
||||
IAbstractApplication::GetSingleton().RunIMEOpenCandidateListEvent();
|
||||
}
|
||||
|
||||
void CPythonIME::OnCloseCandidateList()
|
||||
{
|
||||
IAbstractApplication::GetSingleton().RunIMECloseCandidateListEvent();
|
||||
}
|
||||
|
||||
void CPythonIME::OnOpenReadingWnd()
|
||||
{
|
||||
IAbstractApplication::GetSingleton().RunIMEOpenReadingWndEvent();
|
||||
}
|
||||
|
||||
void CPythonIME::OnCloseReadingWnd()
|
||||
{
|
||||
IAbstractApplication::GetSingleton().RunIMECloseReadingWndEvent();
|
||||
}
|
||||
Reference in New Issue
Block a user