Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Unified Diff: src/IBusChewingEngine-keys.c

Issue 1733014: Fix the space bar to insert spaces in ibus-chewing (Closed)
Patch Set: Code Review Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IBusChewingEngine-def.c ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IBusChewingEngine-keys.c
diff --git a/src/IBusChewingEngine-keys.c b/src/IBusChewingEngine-keys.c
index e9d52354b65c1ad842fa826fcb89df0935f2dba3..98d4e1bbbbc3d891d156e764f459cdac2f3df721 100644
--- a/src/IBusChewingEngine-keys.c
+++ b/src/IBusChewingEngine-keys.c
@@ -41,13 +41,19 @@ gboolean ibus_chewing_engine_process_key_event(IBusEngine *engine,
chewing_handle_Enter(self->context);
break;
case IBUS_Escape:
+ if (self->inputMode==CHEWING_INPUT_MODE_BYPASS)
+ return FALSE;
chewing_handle_Esc(self->context);
break;
case IBUS_BackSpace:
+ if (self->inputMode==CHEWING_INPUT_MODE_BYPASS)
+ return FALSE;
chewing_handle_Backspace(self->context);
break;
case IBUS_Delete:
case IBUS_KP_Delete:
+ if (self->inputMode==CHEWING_INPUT_MODE_BYPASS)
+ return FALSE;
chewing_handle_Del(self->context);
break;
case IBUS_space:
@@ -56,7 +62,8 @@ gboolean ibus_chewing_engine_process_key_event(IBusEngine *engine,
* Fix for space in Temporary mode.
*/
chewing_handle_Space(self->context);
- if (self->inputMode==CHEWING_INPUT_MODE_SELECTING_DONE)
+ if (self->inputMode==CHEWING_INPUT_MODE_SELECTING_DONE ||
+ self->inputMode==CHEWING_INPUT_MODE_BYPASS )
ibus_chewing_engine_set_status_flag(self,ENGINE_STATUS_NEED_COMMIT);
break;
case IBUS_Page_Up:
@@ -113,6 +120,12 @@ gboolean ibus_chewing_engine_process_key_event(IBusEngine *engine,
chewing_handle_Tab(self->context);
break;
case IBUS_Caps_Lock:
+ /* When Chi->Eng with incomplete character */
+ if (chewing_get_ChiEngMode(self->context) && !chewing_zuin_Check(self->context)){
+ /* chewing_zuin_Check==0 means incomplete character */
+ /* Send a space to finish the character */
+ chewing_handle_Space(self->context);
+ }
chewing_handle_Capslock(self->context);
self_refresh_property(self,"chewing_chieng_prop");
break;
@@ -146,8 +159,17 @@ gboolean ibus_chewing_engine_process_key_event(IBusEngine *engine,
chewing_handle_ShiftRight(self->context);
break;
case IBUS_Up:
- return FALSE;
+ case IBUS_KP_Up:
case IBUS_Down:
+ case IBUS_KP_Down:
+ case IBUS_Page_Up:
+ case IBUS_KP_Page_Up:
+ case IBUS_Page_Down:
+ case IBUS_KP_Page_Down:
+ case IBUS_Home:
+ case IBUS_End:
+ if (self->_priv->statusFlags & ENGINE_STATUS_NEED_COMMIT)
+ self_force_commit(self);
return FALSE;
case IBUS_space:
case IBUS_KP_Space:
@@ -176,4 +198,3 @@ gboolean ibus_chewing_engine_process_key_event(IBusEngine *engine,
}
return self_update(self);
}
-
« no previous file with comments | « src/IBusChewingEngine-def.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698