<table><tr><td style="">guoyunhe added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D22535">View Revision</a></tr></table><br /><div><div><p>Uploaded latest code. It is unfinished. Just for anyone who may accidentally be interested.</p>
<p>What works:</p>
<ol class="remarkup-list">
<li class="remarkup-list-item">Make the widget a system tray icon.</li>
<li class="remarkup-list-item">The system tray icon can show current input method.</li>
<li class="remarkup-list-item">Right click the system tray icon, context menu allow you to configure keyboard and input method (Fcitx).</li>
</ol>
<p>What doesn't work:</p>
<ol class="remarkup-list">
<li class="remarkup-list-item">Switch input method. ( <a href="https://phabricator.kde.org/p/gpark/" style="
border-color: #f1f7ff;
color: #19558d;
background-color: #f1f7ff;
border: 1px solid transparent;
border-radius: 3px;
font-weight: bold;
padding: 0 4px;">@gpark</a> 's work implemented that)</li>
<li class="remarkup-list-item">Switch fullwidth/halfwidth.</li>
<li class="remarkup-list-item">Switch punction.</li>
<li class="remarkup-list-item">Virtual keyboard.</li>
</ol>
<p>The main difficulty I had is <strong>state jumping</strong>:</p>
<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>When you click the system tray icon, the text field loses focus. Then you are not configuring input method for that field anymore.</p></blockquote>
<p>An idea for possible solution:</p>
<ol class="remarkup-list">
<li class="remarkup-list-item">When you click the system tray icon, the state of KIMPanel will lock, remaining the state of your previous input field.</li>
<li class="remarkup-list-item">When you perform changes of input method, fullwidth, punction, etc., the change will not be performed immediately.</li>
<li class="remarkup-list-item">When you go back to input field, switching to the previous input method, the change will be applied.</li>
</ol></div></div><br /><div><strong>REPOSITORY</strong><div><div>R119 Plasma Desktop</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D22535">https://phabricator.kde.org/D22535</a></div></div><br /><div><strong>To: </strong>guoyunhe, ngraham, VDG, Plasma, xuetianweng<br /><strong>Cc: </strong>xuetianweng, gpark, hein, mart, ngraham, apol, plasma-devel, LeGast00n, jraleigh, fbampaloukas, GB_2, ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas<br /></div>