diff --git a/core/src/ldml/ldml_processor.cpp b/core/src/ldml/ldml_processor.cpp index 031669fbe5..e79a1f90be 100644 --- a/core/src/ldml/ldml_processor.cpp +++ b/core/src/ldml/ldml_processor.cpp @@ -179,20 +179,13 @@ ldml_processor::process_event( ldml_state.clear(); try { - switch (vk) { - // Currently, only one VK gets special treatment. - // Special handling for backspace VK - case KM_CORE_VKEY_BKSP: + if (vk == KM_CORE_VKEY_BKSP) { process_backspace(ldml_state); - break; - default: - // all other VKs - if (is_key_down) { - process_key_down(ldml_state); - } else { - process_key_up(ldml_state); - } - } // end of switch + } else if (is_key_down) { + process_key_down(ldml_state); + } else { + process_key_up(ldml_state); + } // all key-up and key-down events end up here. // commit the ldml state into the core state ldml_state.commit(); diff --git a/core/src/state.hpp b/core/src/state.hpp index 8e6584b05c..0cf58fb614 100644 --- a/core/src/state.hpp +++ b/core/src/state.hpp @@ -187,7 +187,7 @@ public: * whether or not the keydown handled it internally. Therefore this * flag exists. * - * Only used when processing KM_CORE_VKEY_BKSP. + * Only used when processing KM_CORE_VKEY_BKSP with LDML keyboards. */ void set_backspace_handled_internally(bool handled) { _backspace_handled_internally = handled; } bool backspace_handled_internally() const { return _backspace_handled_internally; }