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 }
114 MirKeyboardAction mir_keyboard_ event_action( MirKeyboardEven t const* kev) from_new( kev); action_ down: repeat_ count != 0) action_ repeat; action_ down; action_ up; action_ down;
115 {
116 auto const& old_kev = old_kev_
117-
118- switch (old_kev.action)
119- {
120- case mir_key_
121- if (old_kev.
122- return mir_keyboard_
123- else
124- return mir_keyboard_
125- case mir_key_action_up:
126- return mir_keyboard_
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_
132- }
133+
134+ return old_kev.action;
135 }
Could be a one liner:
return old_kev_ from_new( kev).action;