Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI tests with a TSF client #9

Open
saschanaz opened this issue Jun 19, 2022 · 4 comments
Open

Add CI tests with a TSF client #9

saschanaz opened this issue Jun 19, 2022 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@saschanaz
Copy link
Owner

Installing the DLL should be easy, but not sure how to select the IME to actually attach it the the client app.

@saschanaz saschanaz added the help wanted Extra attention is needed label Jun 19, 2022
@saschanaz
Copy link
Owner Author

Mocking a client with direct ITf* API calls is probably the best thing to do here.

@saschanaz
Copy link
Owner Author

Seriously this is the biggest blocker right now as I need to manually test everything by hand right now and that's booooring (and prone to mistake).

@saschanaz
Copy link
Owner Author

@yukawa
Copy link

yukawa commented May 1, 2023

Installing the DLL should be easy, but not sure how to select the IME to actually attach it the the client app.

Maybe you can try InstallLayoutOrTip API and/or ITfInputProcessorProfileMgr::ActivateProfile API. While the latter one has more flexibility (e.g. try to enable your TIP only on the calling process), afaik Microsoft recommends the former one for general installation purpose.

https://learn.microsoft.com/en-us/windows/apps/design/input/input-method-editor-requirements#ime-installation

To create your own installation experience, call the ITfInputProcessorProfileMgr::RegisterProfile method to register the IME during installation. Don't write registry entries directly.

If the IME must be usable immediately after installation, call InstallLayoutOrTip to add the IME to user-enabled input methods, using the following format for the psz parameter:

<LangID 1>:{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}

Haven't tried, but maybe you can play with the following PowerShell code snippet to enable your TIP programmatically.

$memberDefinition = @'
[DllImport("input.dll", EntryPoint="InstallLayoutOrTip")]
public static extern bool InstallLayoutOrTip(
    [MarshalAs(UnmanagedType.LPWStr)] string psz,
    int dwFlags);
'@
$inputDll = Add-Type -Name InputDll -MemberDefinition $memberDefinition -PassThru
$inputDll::InstallLayoutOrTip("0x0804:{89ADF27C-0863-4AD3-A463-F7ECFC75D01D}{2B574D86-3844-4136-8DD9-41E7829AC9F8}", 0)

There is also a nice write-up from the Keyman team about installing an IME/TIP.

https://github.com/keymanapp/keyman/wiki/Making-sense-of-the-Windows-Layout-Registration

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants