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 all commits
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
15 changes: 15 additions & 0 deletions installer/installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ AllowSkipFiles off ; cannot skip a file
!define CHEDAYI_GUID "{E6943374-70F5-4540-AA0F-3205C7DCCA84}"
!define CHEPINYIN_GUID "{945765E9-9898-477B-B282-856FC3BA907E}"
!define CHESIMPLEX_GUID "{C7E3DA59-A9D8-4A3B-90DC-58700FAF20CD}"
!define EMOJIME_GUID "{A381D463-9338-4FBD-B83D-66FFB03523B3}"
!define CHEENG_GUID "{88BB09A8-4603-4D78-B052-DEE9EAE697EC}"


Expand Down Expand Up @@ -125,6 +126,7 @@ Function uninstallOldVersion
DeleteRegValue HKCU "Control Panel\International\User Profile\zh-Hant-TW" "0404:${PIME_CLSID}${CHEDAYI_GUID}"
DeleteRegValue HKCU "Control Panel\International\User Profile\zh-Hant-TW" "0404:${PIME_CLSID}${CHEPINYIN_GUID}"
DeleteRegValue HKCU "Control Panel\International\User Profile\zh-Hant-TW" "0404:${PIME_CLSID}${CHESIMPLEX_GUID}"
DeleteRegValue HKCU "Control Panel\International\User Profile\zh-Hant-TW" "0404:${PIME_CLSID}${EMOJIME_GUID}"
DeleteRegValue HKCU "Control Panel\International\User Profile\zh-Hant-TW" "0404:${PIME_CLSID}${CHEENG_GUID}"
${EndIf}

Expand Down Expand Up @@ -435,6 +437,12 @@ SectionGroup /e "輸入法模組"
File /r "..\python\input_methods\chesimplex"
SectionEnd

Section "emojime" emojime
SectionIn 2
SetOutPath "$INSTDIR\node\input_methods"
File /r "..\node\input_methods\emojime"
SectionEnd

Section /o "英數" cheeng
${If} ${AtLeastWin8}
SectionIn 2
Expand Down Expand Up @@ -534,6 +542,11 @@ Section "" Register
WriteRegDWORD HKCU "Control Panel\International\User Profile\zh-Hant-TW" "0404:${PIME_CLSID}${CHESIMPLEX_GUID}" $R0
${EndIf}

${If} ${SectionIsSelected} ${emojime}
IntOp $R0 $R0 + 1
WriteRegDWORD HKCU "Control Panel\International\User Profile\zh-Hant-TW" "0404:${PIME_CLSID}${EMOJIME_GUID}" $R0
${EndIf}

${If} ${SectionIsSelected} ${cheeng}
IntOp $R0 $R0 + 1
WriteRegDWORD HKCU "Control Panel\International\User Profile\zh-Hant-TW" "0404:${PIME_CLSID}${CHEENG_GUID}" $R0
Expand Down Expand Up @@ -597,6 +610,7 @@ LangString MB_REBOOT_REQUIRED ${CHT} "安裝程式需要重新開機來完成解
!insertmacro MUI_DESCRIPTION_TEXT ${chedayi} "安裝大易輸入法模組。"
!insertmacro MUI_DESCRIPTION_TEXT ${chepinyin} "安裝拼音輸入法模組。"
!insertmacro MUI_DESCRIPTION_TEXT ${chesimplex} "安裝速成輸入法模組。"
!insertmacro MUI_DESCRIPTION_TEXT ${emojime} "安裝 emojime 輸入法模組。"
!insertmacro MUI_DESCRIPTION_TEXT ${cheeng} "安裝英數輸入法模組。"
!insertmacro MUI_FUNCTION_DESCRIPTION_END

Expand All @@ -615,6 +629,7 @@ Section "Uninstall"
DeleteRegValue HKCU "Control Panel\International\User Profile\zh-Hant-TW" "0404:${PIME_CLSID}${CHEDAYI_GUID}"
DeleteRegValue HKCU "Control Panel\International\User Profile\zh-Hant-TW" "0404:${PIME_CLSID}${CHEPINYIN_GUID}"
DeleteRegValue HKCU "Control Panel\International\User Profile\zh-Hant-TW" "0404:${PIME_CLSID}${CHESIMPLEX_GUID}"
DeleteRegValue HKCU "Control Panel\International\User Profile\zh-Hant-TW" "0404:${PIME_CLSID}${EMOJIME_GUID}"
DeleteRegValue HKCU "Control Panel\International\User Profile\zh-Hant-TW" "0404:${PIME_CLSID}${CHEENG_GUID}"
${EndIf}

Expand Down
15 changes: 15 additions & 0 deletions node/input_methods/emojime/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# editorconfig.org
root = true

[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.js]
indent_size = 2
17 changes: 17 additions & 0 deletions node/input_methods/emojime/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

# node
!/node_modules
/node_modules/*

# npm
*.log

# emojione
!/node_modules/emojione
/node_modules/emojione/*
!/node_modules/emojione/package.json
!/node_modules/emojione/lib/
/node_modules/emojione/lib/*
!/node_modules/emojione/lib/js/
/node_modules/emojione/lib/js/*
!/node_modules/emojione/lib/js/emojione.js
36 changes: 36 additions & 0 deletions node/input_methods/emojime/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<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)


### Bug Fixes

* Set composition string to empty after commit string([30d10e0](https://github.com/EasyIME/emojime/commit/30d10e0))


### Features

* emojime implement quickly 🚀([3497b7a](https://github.com/EasyIME/emojime/commit/3497b7a))
* Support backspace to delete composition string([910f436](https://github.com/EasyIME/emojime/commit/910f436))
* Support candidate list, now can match the composition string to show candidate list. close #1([95543eb](https://github.com/EasyIME/emojime/commit/95543eb)), closes [#1](https://github.com/EasyIME/emojime/issues/1)
* Support esc to exist composition mode([a2b4979](https://github.com/EasyIME/emojime/commit/a2b4979))
* Support move cursor([eaed042](https://github.com/EasyIME/emojime/commit/eaed042))
* Upgrade to use nime 0.2.0 and refactor the architecture([762f6d1](https://github.com/EasyIME/emojime/commit/762f6d1))



64 changes: 64 additions & 0 deletions node/input_methods/emojime/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
Emoji Input Method Editor
=============
The 'real' input method editor of Emoji on windows. Implement by [emojione](http://emojione.com/), [PIME](https://github.com/EasyIME/PIME), [NIME](https://github.com/EasyIME/NIME).


#### Node

- Node v4.x 32 bit (Must be 32 bit.)
- Install [node-gyp](https://github.com/nodejs/node-gyp) dependecise for c binding through [node-ffi](https://github.com/node-ffi/node-ffi). Please see [node-gyp document](https://github.com/nodejs/node-gyp#installation) to setup your environment.


#### Development

Now NIME doesn't has it own installation, so we use PIME for development `emojime`.

- Prepare Node v6.x environment.
- Install [PIME](https://github.com/EasyIME/PIME/releases) v0.14.x
- Create `emojime` folder into `C:\Program Files (x86)\PIME\server\input_methods\`
- Copy `ime.json` and `icon.ico` into `C:\Program Files (x86)\PIME\server\input_methods\emojime\`
- `regsvr32 "C:\Program Files (X86)\PIME\x86\PIMETextService.dll" (run as administrator)`
- `regsvr32 "C:\Program Files (X86)\PIME\x64\PIMETextService.dll" (run as administrator)`
- `npm i`
- `npm start`


#### Input method rule

It is following [emojione codes](http://emoji.codes/).

- `:rocket:` => 🚀
- `:heart:` => ❤️
- `:relaxed:` => ☺️


## Reference

- [PIME](https://github.com/EasyIME/PIME)
- [Virtual-Key Codes](https://msdn.microsoft.com/zh-tw/library/windows/desktop/dd375731%28v=vs.85%29.aspx)
- [NIME](https://github.com/EasyIME/NIME)
- [emojione](http://emojione.com/)


## License

The MIT License (MIT)

Copyright (c) 2016 Lee < jessy1092@gmail.com >

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Binary file added node/input_methods/emojime/icon.ico
Binary file not shown.
10 changes: 10 additions & 0 deletions node/input_methods/emojime/ime.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name":"emojime",
"version": "0.3.0",
"guid": "{A381D463-9338-4FBD-B83D-66FFB03523B3}",
"locale": "zh-TW",
"icon": "icon.ico",
"win8_icon": "",
"moduleName": "index",
"serviceName": ""
}
4 changes: 4 additions & 0 deletions node/input_methods/emojime/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

'use strict';

module.exports = require('./src');
509 changes: 509 additions & 0 deletions node/input_methods/emojime/node_modules/emojione/lib/js/emojione.js

Large diffs are not rendered by default.

110 changes: 110 additions & 0 deletions node/input_methods/emojime/node_modules/emojione/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions node/input_methods/emojime/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "emojime",
"version": "0.3.0",
"description": "The 'real' input method editor of Emoji on windows. Implement by emojione, PIME, NIME.",
"main": "index.js",
"scripts": {
"start": "cross-env DEBUG=nime:* node server.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Lee <jessy1092@gmail.com>",
"license": "MIT",
"dependencies": {
"debug": "^2.2.0",
"emojione": "^2.2.5"
},
"engines": {
"node": ">=6"
},
"devDependencies": {
"cross-env": "^1.0.8",
"nime": "^0.2.0"
}
}
16 changes: 16 additions & 0 deletions node/input_methods/emojime/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use strict';

let nime = require('nime');
let fs = require('fs');
let path = require('path');

let service = require('./index');

let configFile = fs.readFileSync(path.join(process.cwd(), 'ime.json'), 'utf8');
let config = JSON.parse(configFile);

config['textService'] = service;

let server = nime.createServer(undefined, [config]);

server.listen();
Loading