~mir-team/mir/development-branch

« back to all changes in this revision

Viewing changes to src/client/input/input_event.cpp

Unify keyboard action enums.

The removed mir_key_action_multiple corresponds to a kind of "textual" event which we do not support (as input methods go via another channel).

repeat_count is unified in to mir_keyboard_action_repeat.

Approved by PS Jenkins bot, Andreas Pokorny, Alan Griffiths, Alexandros Frantzis, Kevin DuBois.

Show diffs side-by-side

added added

removed removed

Lines of Context:
209
209
MirKeyboardAction mir_keyboard_event_action(MirKeyboardEvent const* kev)
210
210
{
211
211
    auto const& old_kev = old_kev_from_new(kev);
212
 
    
213
 
    switch (old_kev.action)
214
 
    {
215
 
    case mir_key_action_down:
216
 
        if (old_kev.repeat_count != 0)
217
 
            return mir_keyboard_action_repeat;
218
 
        else
219
 
            return mir_keyboard_action_down;
220
 
    case mir_key_action_up:
221
 
        return mir_keyboard_action_up;
222
 
    default:
223
 
        // TODO:? This means we got key_action_multiple which I dont think is 
224
 
        // actually emitted yet (and never will be as in the future it would fall under text
225
 
        // event in the new model).
226
 
        return mir_keyboard_action_down;
227
 
    }
 
212
 
 
213
    return old_kev.action;
228
214
}
229
215
 
230
216
xkb_keysym_t mir_keyboard_event_key_code(MirKeyboardEvent const* kev)