mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-21 23:37:44 +01:00
Prevent Tab key from breaking input
This commit is contained in:
parent
e089949a72
commit
f03552a2ab
1 changed files with 38 additions and 16 deletions
|
|
@ -139,7 +139,9 @@ internal sealed unsafe class DalamudIme : IDisposable, IServiceType
|
||||||
|
|
||||||
switch (args.Message)
|
switch (args.Message)
|
||||||
{
|
{
|
||||||
case WM.WM_IME_NOTIFY when (nint)args.WParam is IMN.IMN_OPENCANDIDATE or IMN.IMN_CLOSECANDIDATE or IMN.IMN_CHANGECANDIDATE:
|
case WM.WM_IME_NOTIFY
|
||||||
|
when (nint)args.WParam is IMN.IMN_OPENCANDIDATE or IMN.IMN_CLOSECANDIDATE
|
||||||
|
or IMN.IMN_CHANGECANDIDATE:
|
||||||
this.UpdateImeWindowStatus(hImc);
|
this.UpdateImeWindowStatus(hImc);
|
||||||
args.SuppressAndReturn(0);
|
args.SuppressAndReturn(0);
|
||||||
break;
|
break;
|
||||||
|
|
@ -185,6 +187,26 @@ internal sealed unsafe class DalamudIme : IDisposable, IServiceType
|
||||||
// Log.Verbose($"{nameof(WM.WM_IME_NOTIFY)}({(nint)args.WParam:X}): {this.ImmComp}");
|
// Log.Verbose($"{nameof(WM.WM_IME_NOTIFY)}({(nint)args.WParam:X}): {this.ImmComp}");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case WM.WM_KEYDOWN when (int)args.WParam is
|
||||||
|
VK.VK_TAB
|
||||||
|
or VK.VK_PRIOR
|
||||||
|
or VK.VK_NEXT
|
||||||
|
or VK.VK_END
|
||||||
|
or VK.VK_HOME
|
||||||
|
or VK.VK_LEFT
|
||||||
|
or VK.VK_UP
|
||||||
|
or VK.VK_RIGHT
|
||||||
|
or VK.VK_DOWN
|
||||||
|
or VK.VK_RETURN:
|
||||||
|
if (this.ImmCand.Count != 0)
|
||||||
|
{
|
||||||
|
TextState.Stb.SelectStart = TextState.Stb.Cursor = TextState.Stb.SelectEnd;
|
||||||
|
ImmNotifyIME(hImc, NI.NI_COMPOSITIONSTR, CPS_CANCEL, 0);
|
||||||
|
args.WParam = VK.VK_PROCESSKEY;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
case WM.WM_LBUTTONDOWN:
|
case WM.WM_LBUTTONDOWN:
|
||||||
case WM.WM_RBUTTONDOWN:
|
case WM.WM_RBUTTONDOWN:
|
||||||
case WM.WM_MBUTTONDOWN:
|
case WM.WM_MBUTTONDOWN:
|
||||||
|
|
@ -285,8 +307,8 @@ internal sealed unsafe class DalamudIme : IDisposable, IServiceType
|
||||||
(s, e) = (e, s);
|
(s, e) = (e, s);
|
||||||
|
|
||||||
var newString = finalCommit
|
var newString = finalCommit
|
||||||
? ImmGetCompositionString(hImc, GCS.GCS_RESULTSTR)
|
? ImmGetCompositionString(hImc, GCS.GCS_RESULTSTR)
|
||||||
: ImmGetCompositionString(hImc, GCS.GCS_COMPSTR);
|
: ImmGetCompositionString(hImc, GCS.GCS_COMPSTR);
|
||||||
|
|
||||||
if (s != e)
|
if (s != e)
|
||||||
textState.DeleteChars(s, e - s);
|
textState.DeleteChars(s, e - s);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue