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 emojime input method #133

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[emojime]: Update to v0.3.0
  • Loading branch information
jessy1092 committed Jul 15, 2016
commit a6b2eebe70977b5ec3e43a07ff26b0ed94c0d393
16 changes: 16 additions & 0 deletions node/input_methods/emojime/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
<a name="0.3.0"></a>
# [0.3.0](https://github.com/EasyIME/emojime/compare/v0.2.0...v0.3.0) (2016-07-15)


### Bug Fixes

* Should not delete the ':' if there have other char([edd90f8](https://github.com/EasyIME/emojime/commit/edd90f8))
* Support _ char in composition mode([04b68b5](https://github.com/EasyIME/emojime/commit/04b68b5))


### Features

* ':' + `space` would fast input ': ' for normal typing([2bbe4e6](https://github.com/EasyIME/emojime/commit/2bbe4e6))



<a name="0.2.0"></a>
# 0.2.0 (2016-07-14)

Expand Down
2 changes: 1 addition & 1 deletion node/input_methods/emojime/ime.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name":"emojime",
"version": "0.2.0",
"version": "0.3.0",
"guid": "{A381D463-9338-4FBD-B83D-66FFB03523B3}",
"locale": "zh-TW",
"icon": "icon.ico",
Expand Down
2 changes: 1 addition & 1 deletion node/input_methods/emojime/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "emojime",
"version": "0.2.0",
"version": "0.3.0",
"description": "The 'real' input method editor of Emoji on windows. Implement by emojione, PIME, NIME.",
"main": "index.js",
"scripts": {
Expand Down
18 changes: 15 additions & 3 deletions node/input_methods/emojime/src/reducer/compositionMode.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ function compositionMode(request, preState) {
showCandidates
} = preState;

// ':' + space would fast input ': ' for typing
if (keyCode == KEYCODE.VK_SPACE && compositionString == ':') {
return Object.assign({}, preState, {
action: 'COMMIT_STRING',
compositionString: '',
compositionCursor: 0,
commitString: ': '
});
}

// Show candidate list
if (keyCode === KEYCODE.VK_DOWN) {

Expand Down Expand Up @@ -69,9 +79,10 @@ function compositionMode(request, preState) {
});
}

// Delete compositionString
// Delete compositionString. But should not delete ':' if has other char
if (keyCode === KEYCODE.VK_BACK) {
if (compositionString === '') {
if ((compositionString === '') ||
(compositionCursor <= 1 && compositionString !== ':')) {
return Object.assign({}, preState, {action: ''});
}
let cursor = compositionCursor;
Expand Down Expand Up @@ -102,7 +113,8 @@ function compositionMode(request, preState) {

if (
(charCode >= 'a'.charCodeAt(0) && charCode <= 'z'.charCodeAt(0)) ||
(charCode >= 'A'.charCodeAt(0) && charCode <= 'Z'.charCodeAt(0))) {
(charCode >= 'A'.charCodeAt(0) && charCode <= 'Z'.charCodeAt(0)) ||
(charCode == '_'.charCodeAt(0))) {

return Object.assign({}, preState, {
action: 'UPDATE_STRING',
Expand Down