From 49d02b602cf303dfde3ca4bb2f509c7a3a44364c Mon Sep 17 00:00:00 2001 From: "Amir E. Aharoni" Date: Sun, 17 Mar 2013 11:02:20 +0200 Subject: [PATCH 1/2] Check for AltGr if replacement equals to input If replacement equals to input, no replacement is made, because there's apparently nothing to do. However, there may be something to do if AltGr was pressed. For example, if a layout is built in a way that allows typing the original character instead of the replacement by pressing it with AltGr. This happens in a layout for the Udmurt language. --- src/jquery.ime.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jquery.ime.js b/src/jquery.ime.js index 888d8008..1acd3c88 100644 --- a/src/jquery.ime.js +++ b/src/jquery.ime.js @@ -134,7 +134,7 @@ } // it is a noop - if ( replacement === input ) { + if ( !altGr && replacement === input ) { return true; } From b7febf9e03faa9490acad74b463834cd4d644b70 Mon Sep 17 00:00:00 2001 From: "Amir E. Aharoni" Date: Tue, 23 Apr 2013 14:08:47 +0300 Subject: [PATCH 2/2] Add doc about altGr in the code --- src/jquery.ime.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/jquery.ime.js b/src/jquery.ime.js index 1acd3c88..8b488052 100644 --- a/src/jquery.ime.js +++ b/src/jquery.ime.js @@ -133,7 +133,11 @@ - this.inputmethod.contextLength ); } - // it is a noop + // If replacement equals to input, no replacement is made, because + // there's apparently nothing to do. However, there may be something + // to do if AltGr was pressed. For example, if a layout is built in + // a way that allows typing the original character instead of + // the replacement by pressing it with AltGr. if ( !altGr && replacement === input ) { return true; }