{
this.commit ();
this.keys.val.splice (0, this.key_head);
- this.key_head = 0;
+ this.key_head = this.state_key_head = this.commit_key_head0;
this.prev_state = null;
}
}
{
this.keys.val.splice (0, this.commit_key_head);
this.key_head -= this.commit_key_head;
- if (this.key_head < 0)
- {
- Xex.Log ('RECOVER key_head');
- this.key_head = 0;
- }
this.state_key_head -= this.commit_key_head;
- if (this.state_key_head < 0)
- {
- Xex.Log ('RECOVER state_key_head');
- this.state_key_head = 0;
- }
this.commit_key_head = 0;
}
if (this.key_unhandled)
ic.range[0] += ic.produced.length;
ic.range[1] = ic.range[0] + ic.preedit.length;
MIM.set_caret (target, ic);
- target.wait_update = false;
};
MIM.focus_in = function (event)
{
var target = event.target;
var ic = target.mim_ic;
- if (target.wait_focus_in);
+ if (ic.wait_update == true)
{
Xex.Log ("Focus in " + target.tagName + ' IGNORED');
event.preventDefault ();
- return;
+ return false;
}
Xex.Log ("Focus in " + target.tagName);
ic.Filter (MIM.Key.FocusIn);
- //target.removeEventListener (target, 'focus', MIM.focus_in);
- target.wait_update = true;
- setTimeout (MIM.update (target, ic), 100);
+ MIM.update (target, ic);
}
MIM.focus_out = function (event)
{
var target = event.target;
var ic = target.mim_ic;
- if (target.wait_focus_out)
+ function reset_update () { ic.wait_update = false; };
+ if (ic.wait_update == true)
{
Xex.Log ("Focus out " + target.tagName + ' IGNORED');
event.preventDefault ();
- return;
+ return false;
}
Xex.Log ("Focus out " + target.tagName);
ic.Filter (MIM.Key.FocusOut);
- //target.removeEventListener (target, 'blur', MIM.focus_out);
- target.wait_update = true;
- setTimeout (MIM.update (target, ic), 100);
+ ic.wait_update = true;
+ MIM.update (target, ic, true);
+ setTimeout (reset_update, 1000);
};
MIM.keydown = function (event)
}
else
{
- while (target.wait_update);
if (! MIM.get_range (target, ic))
ic.reset ();
}