~andreas-pokorny/mir/disable-key-state-tracking-in-input-dispatcher

« back to all changes in this revision

Viewing changes to src/server/graphics/nested/input_platform.cpp

  • Committer: Andreas Pokorny
  • Date: 2016-06-04 19:12:19 UTC
  • Revision ID: andreas.pokorny@canonical.com-20160604191219-10rq1kcywxn3503v
fix merge 

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
#include "mir/dispatch/action_queue.h"
32
32
#include "mir/events/event_builders.h"
33
33
#include "mir/events/event_private.h"
 
34
#include "mir/event_printer.h"
34
35
 
35
36
#include <chrono>
 
37
#include <iostream>
36
38
 
37
39
namespace mi = mir::input;
38
40
namespace mgn = mir::graphics::nested;
107
109
        case mir_input_event_type_key:
108
110
            {
109
111
                auto const* key_event = mir_input_event_get_keyboard_event(event);
110
 
                destination->handle_input(*builder->key_event(
 
112
 
 
113
                auto new_kev = builder->key_event(
111
114
                        event_time,
112
115
                        mir_keyboard_event_action(key_event),
113
116
                        mir_keyboard_event_key_code(key_event),
114
117
                        mir_keyboard_event_scan_code(key_event)
115
 
                        ));
116
 
 
 
118
                        );
 
119
                using mir::operator<<;
 
120
                std::cout << "now emitting " << *new_kev << std::endl;
 
121
                destination->handle_input(*new_kev);
117
122
                break;
118
123
            }
119
124
        case mir_input_event_type_pointer:
249
254
                    auto device_state_event = front->builder->device_state_event(
250
255
                        mir_input_device_state_event_pointer_axis(device_state, mir_pointer_axis_x),
251
256
                        mir_input_device_state_event_pointer_axis(device_state, mir_pointer_axis_y));
 
257
                    using mir::operator<<;
 
258
                    std::cout << "now emitting " << *device_state_event << std::endl;
252
259
                    front->destination->handle_input(*device_state_event);
253
260
                }
254
261
            }
255
 
 
256
 
            auto const* input_ev = mir_event_get_input_event(&event);
257
 
            auto const id = mir_input_event_get_device_id(input_ev);
258
 
            auto it = devices.find(id);
259
 
            if (it != end(devices))
260
 
                it->second->emit_event(input_ev, area);
261
262
        });
262
263
}
263
264