Lines Matching refs:device
37 Device* device = new Device(classes); in addDevice() local
38 device->identifier.name = name; in addDevice()
39 device->identifier.bus = bus; in addDevice()
40 mDevices.add(deviceId, device); in addDevice()
53 Device* device = getDevice(deviceId); in isDeviceEnabled() local
54 if (device == nullptr) { in isDeviceEnabled()
58 return device->enabled; in isDeviceEnabled()
63 Device* device = getDevice(deviceId); in enableDevice() local
64 if (device == nullptr) { in enableDevice()
68 if (device->enabled) { in enableDevice()
72 result = device->enable(); in enableDevice()
77 Device* device = getDevice(deviceId); in disableDevice() local
78 if (device == nullptr) { in disableDevice()
82 if (!device->enabled) { in disableDevice()
86 return device->disable(); in disableDevice()
103 Device* device = getDevice(deviceId); in addAbsoluteAxis() local
112 device->absoluteAxes.add(axis, info); in addAbsoluteAxis()
141 Device* device = getDevice(deviceId); in addKey() local
146 device->keysByScanCode.add(scanCode, info); in addKey()
149 device->keysByUsageCode.add(usageCode, info); in addKey()
158 Device* device = getDevice(deviceId); in addKeyRemapping() local
159 device->keyRemapping.insert_or_assign(fromKeyCode, toKeyCode); in addKeyRemapping()
245 Device* device = getDevice(deviceId); in getDeviceClasses() local
246 return device ? device->classes : ftl::Flags<InputDeviceClass>(0); in getDeviceClasses()
250 Device* device = getDevice(deviceId); in getDeviceIdentifier() local
251 return device ? device->identifier : InputDeviceIdentifier(); in getDeviceIdentifier()
259 Device* device = getDevice(deviceId); in getConfiguration() local
260 if (device == nullptr) { in getConfiguration()
263 return device->configuration; in getConfiguration()
268 Device* device = getDevice(deviceId); in getAbsoluteAxisInfo() local
269 if (device) { in getAbsoluteAxisInfo()
270 ssize_t index = device->absoluteAxes.indexOfKey(axis); in getAbsoluteAxisInfo()
272 *outAxisInfo = device->absoluteAxes.valueAt(index); in getAbsoluteAxisInfo()
281 Device* device = getDevice(deviceId); in hasRelativeAxis() local
282 if (device) { in hasRelativeAxis()
283 return device->relativeAxes.indexOfKey(axis) >= 0; in hasRelativeAxis()
293 Device* device = getDevice(deviceId); in hasMscEvent() local
294 if (device) { in hasMscEvent()
295 return mscEvent >= 0 && mscEvent <= MSC_MAX ? device->mscBitmask.test(mscEvent) : false; in hasMscEvent()
303 Device* device = getDevice(deviceId); in mapKey() local
304 if (device) { in mapKey()
305 const KeyInfo* key = getKey(device, scanCode, usageCode); in mapKey()
308 auto it = device->keyRemapping.find(key->keyCode); in mapKey()
309 *outKeycode = it != device->keyRemapping.end() ? it->second : key->keyCode; in mapKey()
323 const FakeEventHub::KeyInfo* FakeEventHub::getKey(Device* device, int32_t scanCode, in getKey() argument
326 ssize_t index = device->keysByUsageCode.indexOfKey(usageCode); in getKey()
328 return &device->keysByUsageCode.valueAt(index); in getKey()
332 ssize_t index = device->keysByScanCode.indexOfKey(scanCode); in getKey()
334 return &device->keysByScanCode.valueAt(index); in getKey()
346 Device* device = getDevice(deviceId); in mapSensor() local
347 if (!device) { in mapSensor()
350 auto it = device->sensorsByAbsCode.find(absCode); in mapSensor()
351 if (it == device->sensorsByAbsCode.end()) { in mapSensor()
383 Device* device = getDevice(deviceId); in getScanCodeState() local
384 if (device) { in getScanCodeState()
385 ssize_t index = device->scanCodeStates.indexOfKey(scanCode); in getScanCodeState()
387 return device->scanCodeStates.valueAt(index); in getScanCodeState()
394 Device* device = getDevice(deviceId); in getRawLayoutInfo() local
395 return device ? device->layoutInfo : std::nullopt; in getRawLayoutInfo()
399 Device* device = getDevice(deviceId); in getKeyCodeState() local
400 if (device) { in getKeyCodeState()
401 ssize_t index = device->keyCodeStates.indexOfKey(keyCode); in getKeyCodeState()
403 return device->keyCodeStates.valueAt(index); in getKeyCodeState()
410 Device* device = getDevice(deviceId); in getSwitchState() local
411 if (device) { in getSwitchState()
412 ssize_t index = device->switchStates.indexOfKey(sw); in getSwitchState()
414 return device->switchStates.valueAt(index); in getSwitchState()
422 Device* device = getDevice(deviceId); in getAbsoluteAxisValue() local
423 if (device) { in getAbsoluteAxisValue()
424 ssize_t index = device->absoluteAxisValue.indexOfKey(axis); in getAbsoluteAxisValue()
426 *outValue = device->absoluteAxisValue.valueAt(index); in getAbsoluteAxisValue()
436 Device* device = getDevice(deviceId); in setMtSlotValues() local
437 if (!device) { in setMtSlotValues()
440 device->mtSlotValues[axis] = values; in setMtSlotValues()
445 Device* device = getDevice(deviceId); in getMtSlotValues() local
446 if (!device) { in getMtSlotValues()
450 const auto& mtSlotValuesIterator = device->mtSlotValues.find(axis); in getMtSlotValues()
451 if (mtSlotValuesIterator == device->mtSlotValues.end()) { in getMtSlotValues()
467 Device* device = getDevice(deviceId); in getKeyCodeForKeyLocation() local
468 if (!device) { in getKeyCodeForKeyLocation()
471 auto it = device->keyCodeMapping.find(locationKeyCode); in getKeyCodeForKeyLocation()
472 return it != device->keyCodeMapping.end() ? it->second : locationKeyCode; in getKeyCodeForKeyLocation()
478 Device* device = getDevice(deviceId); in markSupportedKeyCodes() local
479 if (!device) return false; in markSupportedKeyCodes()
481 bool result = device->keysByScanCode.size() > 0 || device->keysByUsageCode.size() > 0; in markSupportedKeyCodes()
483 for (size_t j = 0; j < device->keysByScanCode.size(); j++) { in markSupportedKeyCodes()
484 if (keyCodes[i] == device->keysByScanCode.valueAt(j).keyCode) { in markSupportedKeyCodes()
488 for (size_t j = 0; j < device->keysByUsageCode.size(); j++) { in markSupportedKeyCodes()
489 if (keyCodes[i] == device->keysByUsageCode.valueAt(j).keyCode) { in markSupportedKeyCodes()
498 Device* device = getDevice(deviceId); in hasScanCode() local
499 if (device) { in hasScanCode()
500 ssize_t index = device->keysByScanCode.indexOfKey(scanCode); in hasScanCode()
507 Device* device = getDevice(deviceId); in hasKeyCode() local
508 if (!device) { in hasKeyCode()
511 for (size_t i = 0; i < device->keysByScanCode.size(); i++) { in hasKeyCode()
512 if (keyCode == device->keysByScanCode.valueAt(i).keyCode) { in hasKeyCode()
516 for (size_t j = 0; j < device->keysByUsageCode.size(); j++) { in hasKeyCode()
517 if (keyCode == device->keysByUsageCode.valueAt(j).keyCode) { in hasKeyCode()
525 Device* device = getDevice(deviceId); in hasLed() local
526 return device && device->leds.indexOfKey(led) >= 0; in hasLed()
530 Device* device = getDevice(deviceId); in setLedState() local
531 if (device) { in setLedState()
532 ssize_t index = device->leds.indexOfKey(led); in setLedState()
534 device->leds.replaceValueAt(led, on); in setLedState()
547 Device* device = getDevice(deviceId); in getVirtualKeyDefinitions() local
548 if (device) { in getVirtualKeyDefinitions()
549 outVirtualKeys = device->virtualKeys; in getVirtualKeyDefinitions()
630 Device* device = getDevice(deviceId); in setSysfsRootPath() local
631 if (device == nullptr) { in setSysfsRootPath()
634 device->sysfsRootPath = sysfsRootPath; in setSysfsRootPath()