Created
April 30, 2014 08:46
-
-
Save ms2sato/11421439 to your computer and use it in GitHub Desktop.
日本語入力時のエンターキーの入力のハンドルはこうすると共通かなぁ ref: http://qiita.com/ms2sato/items/469b13fcdae6ced6e236
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# キーダウンイベント | |
keydowned: (event)-> | |
@downedKey = event.keyCode | |
# Firefoxでは@downedKeyが日本語変換直前のキーコード | |
# Chrome等では229が入ります。 | |
# キーアップイベント | |
keyupped: (event)-> | |
# enter押下でかつ日本語入力ではない | |
if event.keyCode == 13 && (@downedKey == event.keyCode) | |
# ...やりたい処理を書くのだ | |
@downedKey = null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment