mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-16 20:57:40 +00:00
* Keyman for Windows 10.0 Open Source * Squashed 'windows/src/ext/jedi/jedi/' content from commit f444ad2 git-subtree-dir: windows/src/ext/jedi/jedi git-subtree-split: f444ad2da4693851e523f1ea6bd541f701904c24 * Squashed 'windows/src/ext/jedi/jcl/' content from commit d63d3c9fd git-subtree-dir: windows/src/ext/jedi/jcl git-subtree-split: d63d3c9fd9ff84efdd8159084ec6a60313644243 * Squashed 'windows/src/ext/jedi/jvcl/' content from commit bee19f3b4 git-subtree-dir: windows/src/ext/jedi/jvcl git-subtree-split: bee19f3b46909fde2fa92c06cd2706f41d99f6c3 * Add required .res files * Add required .res files * Add docbook files (forced) * Add required libxslt * Add required jedi files * Add installation files * Tweak .gitignore for open * CI * Remove KMW from Developer source (#122) * Remove KMW from Developer source (copies during build) * Remove KMW from Developer source (copies during build) * Remove KMW from Developer source (copies during build) * Fixup release build and copy license, readme from kmw during build * Remove obsolete build help documentation * Keyman Engine 10 on Windows regression for shift states (#129) * Improve #128 -- cleaner debug messages * Fixes #127, shift state now resets correctly; and more work for #128 * Fixes #130 (#131)
238 lines
12 KiB
HTML
238 lines
12 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html>
|
|
<head><link rel="stylesheet" type="text/css" href="description/Combined.css,0:HeaderFooterSprite,0:Header.NonMtps,1:LinkList;/Areas/Centers/Themes/StandardDevCenter/Content:0,/Areas/Epx/Themes/Base/Content:1&amp;hashKey=C9973DA951AE6202C9B348379A1BE49D" xmlns="http://www.w3.org/1999/xhtml" />
|
|
<link type="text/css" rel="stylesheet" xmlns="http://www.w3.org/1999/xhtml" />
|
|
<link rel="stylesheet" type="text/css" href="description/0aac1760-b513-488a-ba57-e31d9413a075Combined.css,0:HeaderFooterSprite,0:Footer.NonMtps,1:LinkList;/Areas/Centers/Themes/StandardDevCenter/Content:0,/Areas/Epx/Themes/Base/Content:1&amp;hashKey=F576C687BC536B84D6E5B3246EE39B49" xmlns="http://www.w3.org/1999/xhtml" />
|
|
<link type="text/css" rel="stylesheet" xmlns="http://www.w3.org/1999/xhtml" />
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<title>Input Method Editor (IME) sample</title>
|
|
<link href="description/Galleries.css" type="text/css" rel="Stylesheet" /><link href="description/Layout.css" type="text/css" rel="Stylesheet" /><link href="description/Brand.css" type="text/css" rel="Stylesheet" />
|
|
<link href="description/iframedescription.css" rel="Stylesheet" type="text/css" />
|
|
<script src="description/offline.js" type="text/javascript"></script>
|
|
<style type="text/css">
|
|
#projectInfo {
|
|
overflow: auto;
|
|
}
|
|
#longDesc {
|
|
clear:both;
|
|
margin: 25px 0 10px 0;
|
|
}
|
|
|
|
#SampleIndexList{
|
|
margin-left: 15px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="offlineDescription">
|
|
<h1>Input Method Editor (IME) sample</h1>
|
|
<br/>
|
|
<div id="projectInfo">
|
|
<div class="section">
|
|
<div class="itemBarLong tagsContainer">
|
|
<label for="Technologies">Technologies</label>
|
|
<div id="Technologies">
|
|
Win32
|
|
</div>
|
|
</div>
|
|
<div class="itemBarLong tagsContainer">
|
|
<label for="Topics">Topics</label>
|
|
<div id="Topics">
|
|
input
|
|
</div>
|
|
</div>
|
|
<div class="itemBarLong">
|
|
<label for="Platforms">Platforms</label>
|
|
<div id="Platforms">
|
|
Desktop
|
|
</div>
|
|
</div>
|
|
<div class="itemBarLong">
|
|
<label for="Requirements">Requirements</label>
|
|
<div id="Requirements">
|
|
|
|
</div>
|
|
</div>
|
|
<div class="itemBar">
|
|
<label for="LastUpdated">Primary language</label>
|
|
<div id="LastUpdated">en-US</div>
|
|
</div>
|
|
<div class="itemBar">
|
|
<label for="LastUpdated">Updated</label>
|
|
<div id="LastUpdated">10/17/2013</div>
|
|
</div>
|
|
<div class="itemBarLong">
|
|
<label for="License">License</label>
|
|
<div id="License">
|
|
<a href="license.rtf">MS-LPL</a></div>
|
|
</div>
|
|
<div class="itemBar">
|
|
<div class="viewonlinecont">
|
|
<a data-link="online" href="http://code.msdn.microsoft.com/Input-Method-Editor-IME-b1610980">View this sample online</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script type="text/javascript">
|
|
function initializePage() {
|
|
var otherTabClass = 'otherTab';
|
|
var hiddenPreClass = 'hidden';
|
|
|
|
var htmlDecode = function(encodedData) {
|
|
var decodedData = "";
|
|
if (encodedData) {
|
|
var div = document.createElement('div');
|
|
div.innerHTML = encodedData;
|
|
decodedData = div.firstChild.nodeValue.replace( /\\r\\n/ig , '\r\n');
|
|
}
|
|
return decodedData;
|
|
};
|
|
|
|
Galleries.iterateElem(Galleries.findElem(null, 'div', 'scriptcode'), function (index, scriptBlock) {
|
|
var titleElem = Galleries.findElem(scriptBlock, 'div', 'title')[0];
|
|
var labelElems = Galleries.findElem(titleElem, 'span');
|
|
if (labelElems.length == 0) {
|
|
labelElems = titleElem;
|
|
}
|
|
var languageSpans = Galleries.findElem(scriptBlock, 'span', 'hidden');
|
|
var pres = Galleries.findElem(scriptBlock, 'pre');
|
|
if (languageSpans.length > 0 && pres.length > 1) {
|
|
Galleries.iterateElem(labelElems, function(index, elem) {
|
|
var codePre = pres[index];
|
|
var labelSpan = elem;
|
|
var languageSpan = languageSpans[index];
|
|
|
|
elem.code = codePre.innerHTML.replace( /(\r(\n)?)|((\r)?\n)/ig , '\\r\\n');
|
|
|
|
codePre.className = codePre.className.replace(hiddenPreClass, '');
|
|
|
|
languageSpan.parentNode.removeChild(languageSpan);
|
|
});
|
|
|
|
pres = Galleries.findElem(scriptBlock, 'pre');
|
|
Galleries.iterateElem(labelElems, function(index, elem) {
|
|
var codePre = pres[index];
|
|
var labelSpan = elem;
|
|
if (index == 0) {
|
|
scriptBlock.activeTab = 0;
|
|
}
|
|
else {
|
|
labelSpan.className += otherTabClass;
|
|
codePre.className += hiddenPreClass;
|
|
}
|
|
Galleries.attachEventHandler(labelSpan, 'click', function(e) {
|
|
var activeTab = scriptBlock.activeTab;
|
|
labelElems[activeTab].className += otherTabClass;
|
|
pres[activeTab].className += hiddenPreClass;
|
|
|
|
codePre.className = codePre.className.replace(hiddenPreClass, '');
|
|
labelSpan.className = labelSpan.className.replace(otherTabClass, '');
|
|
scriptBlock.activeTab = index;
|
|
});
|
|
});
|
|
|
|
var preview = Galleries.findElem(scriptBlock, 'div', 'preview');
|
|
if (preview.length == 0) {
|
|
preview.push(pres[pres.length - 1]);
|
|
}
|
|
Galleries.iterateElem(preview, function(index, elem) {
|
|
elem.parentNode.removeChild(elem);
|
|
});
|
|
|
|
if (window.clipboardData && clipboardData.setData) {
|
|
var copyLink = document.createElement('a');
|
|
copyLink.href = 'javascript:void(0);';
|
|
copyLink.className = 'copyCode';
|
|
copyLink.innerHTML = 'Copy code';
|
|
Galleries.attachEventHandler(copyLink, 'click', function (e) {
|
|
clipboardData.setData("Text", htmlDecode(labelElems[scriptBlock.activeTab].code));
|
|
return false;
|
|
});
|
|
scriptBlock.insertBefore(copyLink, scriptBlock.childNodes[0]);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
Galleries.onWindowLoad(function(){
|
|
initializePage();
|
|
});
|
|
|
|
</script>
|
|
<div id="longDesc">
|
|
|
|
<div id="mainSection">
|
|
<p>This sample shows how to create an Input Method Editor (IME) that works in Windows Store apps and Windows 8.1 desktop apps.
|
|
</p>
|
|
<p></p>
|
|
<p>The sample IME has the following features:</p>
|
|
<ul>
|
|
<li>Uses the Text Services Framework (TSF) </li><li>Runs in base trust </li><li>Compatible with Windows Store apps </li><li>Compatible with Systray and desktop </li><li>Interacts with touch keyboard </li><li>Integrates with Search contract </li><li>Interacts with light-dismiss </li></ul>
|
|
<p></p>
|
|
<p>The IME sample uses the following code to obtain the parent window:</p>
|
|
<p><code>pView->GetWnd(&parentWndHandle);</code></p>
|
|
<p>This implementation works only for Windows Store apps that use the built-in edit controls. This implementation won't work if the app uses the custom edit control from the subset of Text Service Framework (TSF) APIs available in the Windows Runtime. To ensure
|
|
that the IME gets the proper parent window, so that the owned window is set correctly and works for desktop and Windows Store apps, replace the previous code with the following code:</p>
|
|
<p><code>if (FAILED(pView->GetWnd(&parentWndHandle)) || (parentWndHandle == nullptr)) { parentWndHandle = GetFocus(); }</code></p>
|
|
<p>To obtain an evaluation copy of Windows 8.1, go to <a href="http://go.microsoft.com/fwlink/p/?linkid=301696">
|
|
Windows 8.1</a>. </p>
|
|
<p>To obtain an evaluation copy of Microsoft Visual Studio 2013, go to <a href="http://go.microsoft.com/fwlink/p/?linkid=301697">
|
|
Visual Studio 2013</a>.</p>
|
|
<h3><a id="related_topics"></a>Related topics</h3>
|
|
<dl><dt><a href="http://go.microsoft.com/fwlink/?LinkId=262401">Guidelines and checklist for IME development</a>
|
|
</dt></dl>
|
|
<h3>Related technologies</h3>
|
|
<a href="http://go.microsoft.com/fwlink/?LinkId=262402">Text Services Framework</a>
|
|
<h3>Operating system requirements</h3>
|
|
<table>
|
|
<tbody>
|
|
<tr>
|
|
<th>Client</th>
|
|
<td><dt>Windows 8.1 </dt></td>
|
|
</tr>
|
|
<tr>
|
|
<th>Server</th>
|
|
<td><dt>Windows Server 2012 R2 </dt></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3>Build the sample</h3>
|
|
<ol>
|
|
<li>
|
|
<p>Start Visual Studio and select <b>File</b> > <b>Open</b> > <b>Project/Solution</b>.</p>
|
|
</li><li>
|
|
<p>Go to the directory in which you unzipped the sample. Go to the directory named for the sample, and double-click the Microsoft Visual Studio Solution (.sln) file titled SampleIME.sln.</p>
|
|
</li><li>
|
|
<p>Press F7 (or F6 for Visual Studio 2013) or use <b>Build</b> > <b>Build Solution</b> to build the sample.</p>
|
|
</li></ol>
|
|
<h3>Run the sample</h3>
|
|
<p>If you build the IME sample by using Visual Studio 2013, create an installation experience for the IME by using a third-party installer that supports Windows 8.1, like InstallShield from Flexera Software.</p>
|
|
<p></p>
|
|
<p>The following steps show how to use InstallShield to create a setup project for your IME DLL.</p>
|
|
<ul>
|
|
<li>Install Visual Studio 2013. </li><li>Start Visual Studio 2013. </li><li>On the <b>File</b> menu, point to <b>New</b> and select <b>Project</b>. The <b>
|
|
New Project</b> dialog opens. </li><li>In the left pane, navigate to <b>Templates > Other Project Types > Setup and Deployment</b>, click
|
|
<b>Enable InstallShield Limited Edition</b>, and click <b>OK</b>. Follow the installation instructions.
|
|
</li><li>Restart Visual Studio 2013. </li><li>Open the IME solution (.sln) file. </li><li>Press F6 to build the solution. </li><li>In Solution Explorer, right-click the solution, point to <b>Add</b>, and select
|
|
<b>New Project</b>. The <b>Add New Project</b> dialog opens. </li><li>In the left tree view control, navigate to <b>Templates > Other Project Types > InstallShield Limited Edition</b>.
|
|
</li><li>In the center window, click <b>InstallShield Limited Edition Project</b>. </li><li>In the <b>Name</b> text box, type "SetupIME" and click <b>OK</b>. </li><li>In the <b>Project Assistant</b> dialog, click <b>Application Information</b>.
|
|
</li><li>Fill in your company name and the other fields. </li><li>Click <b>Application Files</b>. </li><li>In the left pane, right-click the <b>[INSTALLDIR]</b> folder, and select <b>New Folder</b>. Name the folder "Plugins".
|
|
</li><li>Click <b>Add Files</b>. Navigate to SampleIME.dll, which is in the C++\Debug folder, and add it to the
|
|
<b>Plugins</b> folder. Repeat this step for the IME dictionary, which is in the C++\SampleIME\Dictionary folder.
|
|
</li><li>Right-click the IME DLL and select <b>Properties</b>. The <b>Properties</b> dialog opens.
|
|
</li><li>In the <b>Properties</b> dialog, click the <b>COM & .NET Settings</b> tab.
|
|
</li><li>Under <b>Registration Type</b>, select <b>Self-registration</b> and click <b>
|
|
OK</b>. </li><li>Build the solution. The IME DLL is built, and InstallShield creates a setup.exe file that enables users to install your IME on Windows 8.1. The setup.exe file is located in the SetupIME\SetupIME\Express\DVD-5\DiskImages\DISK1 folder.
|
|
</li></ul>
|
|
<p></p>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</body>
|
|
</html>
|