MCPcopy Create free account
hub / github.com/canonical/mir / DefaultDevice

Method DefaultDevice

src/server/input/default_device.cpp:32–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30namespace mi = mir::input;
31
32mi::DefaultDevice::DefaultDevice(MirInputDeviceId id,
33 std::shared_ptr<dispatch::ActionQueue> const& actions,
34 InputDevice& device,
35 std::shared_ptr<KeyMapper> const& key_mapper,
36 std::function<void(Device*)> const& callback)
37 : device_id{id},
38 device{device},
39 info(device.get_device_info()),
40 pointer{device.get_pointer_settings()},
41 touchpad{device.get_touchpad_settings()},
42 touchscreen{device.get_touchscreen_settings()},
43 actions{actions},
44 key_mapper{key_mapper},
45 device_changed_callback{callback}
46{
47 if (contains(info.capabilities, mi::DeviceCapability::keyboard))
48 {
49 keyboard = MirKeyboardConfig{};
50 key_mapper->set_keymap_for_device(device_id, keyboard.value().device_keymap());
51 }
52}
53
54mi::DefaultDevice::DefaultDevice(MirInputDeviceId id, std::shared_ptr<dispatch::ActionQueue> const& actions,
55 InputDevice& device, std::shared_ptr<KeyMapper> const& key_mapper)

Callers

nothing calls this directly

Calls 13

containsFunction · 0.85
device_keymapMethod · 0.80
has_touchpad_configMethod · 0.80
has_keyboard_configMethod · 0.80
has_pointer_configMethod · 0.80
get_device_infoMethod · 0.45
get_pointer_settingsMethod · 0.45
get_touchpad_settingsMethod · 0.45
set_keymap_for_deviceMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected