Mir

Code review comment for lp:~mir-team/mir/unify-keyboard-actions

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

114 MirKeyboardAction mir_keyboard_event_action(MirKeyboardEvent const* kev)
115 {
116 auto const& old_kev = old_kev_from_new(kev);
117-
118- switch (old_kev.action)
119- {
120- case mir_key_action_down:
121- if (old_kev.repeat_count != 0)
122- return mir_keyboard_action_repeat;
123- else
124- return mir_keyboard_action_down;
125- case mir_key_action_up:
126- return mir_keyboard_action_up;
127- default:
128- // TODO:? This means we got key_action_multiple which I dont think is
129- // actually emitted yet (and never will be as in the future it would fall under text
130- // event in the new model).
131- return mir_keyboard_action_down;
132- }
133+
134+ return old_kev.action;
135 }

Could be a one liner:

    return old_kev_from_new(kev).action;

« Back to merge proposal